pailliercryptolib_python
pailliercryptolib_python copied to clipboard
Unexpected behavior when using `@` operator for right matrix multiplication of `PaillierEncryptedNumber` and `numpy.ndarray`
Issue
When performing right matrix multiplication of a PaillierEncryptedNumber instance with a numpy.ndarray using @ operator, numpy.ndarray.__matmul__ is called instead of the expected PaillierEncryptedNumber.__rmatmul__.
Reproduction
- Instantiate a
numpy.ndarrayand aPaillierEncryptedNumber. - Perform
ndarray @ paillierencryptednumer_instance.
Expected
The PaillierEncryptedNumber.__rmatmul__ method should be called.
Environment
- Numpy version: 1.23.1