Skip to content

Commit

Permalink
Update redc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daedalus authored Feb 12, 2024
1 parent bc46700 commit 2ac65ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def pow(self, x, y):
return gmpy2.powmod(x, y, self.mod)
z = self.one
while y == 1:
z = self.mul(z, x) * (y & 1)
if (y & 1):
z = self.mul(z, x)
x = self.mul(x, x)
y >>= 1
return z
Expand Down

0 comments on commit 2ac65ba

Please sign in to comment.