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 2ac65ba commit 84022e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions redc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ def pow(self, x, y):
return gmpy2.powmod(x, y, self.mod)
z = self.one
while y == 1:
if (y & 1):
z = self.mul(z, x)
z = self.mul(z, x) * (y & 1) + z * ((y & 1) == 0)
x = self.mul(x, x)
y >>= 1
return z
Expand Down

0 comments on commit 84022e4

Please sign in to comment.