Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

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

@fangxiaoran

Description

@fangxiaoran

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions