pailliercryptolib_python icon indicating copy to clipboard operation
pailliercryptolib_python copied to clipboard

Unexpected behavior when using `@` operator for right matrix multiplication of `PaillierEncryptedNumber` and `numpy.ndarray`

Open fangxiaoran opened this issue 2 years ago • 0 comments

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

  1. Instantiate a numpy.ndarray and a PaillierEncryptedNumber.
  2. Perform ndarray @ paillierencryptednumer_instance.

Expected The PaillierEncryptedNumber.__rmatmul__ method should be called.

Environment

  • Numpy version: 1.23.1

fangxiaoran avatar Dec 07 '23 04:12 fangxiaoran