aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec/mod.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/ec/mod.py')
-rw-r--r--pyecsca/ec/mod.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyecsca/ec/mod.py b/pyecsca/ec/mod.py
index 52f4a80..ebeea57 100644
--- a/pyecsca/ec/mod.py
+++ b/pyecsca/ec/mod.py
@@ -585,8 +585,10 @@ if has_gmp:
return object.__new__(cls)
def __init__(self, x: Union[int, gmpy2.mpz], n: Union[int, gmpy2.mpz]):
- self.n = gmpy2.mpz(n) if not isinstance(n, gmpy2.mpz) else n
- self.x = gmpy2.mpz(x % self.n) if not isinstance(x, gmpy2.mpz) else x % self.n
+ self.n = gmpy2.mpz(n) if not type(n) is gmpy2.mpz else n
+ self.x = gmpy2.mpz(x % self.n) if not type(x) is gmpy2.mpz else x % self.n
+ # self.x = gmpy2.mpz(x % n)
+ # self.n = gmpy2.mpz(n)
def inverse(self) -> "GMPMod":
if self.x == 0: