Skip to content

Commit

Permalink
Update barret.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daedalus authored Feb 10, 2024
1 parent 9a54494 commit 11da0b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions barret.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def __init__(self, m):
def reduce(self, a):
# if 0 <= a <= self.m**2: raise ValueError("a must be >0 and < n^2")
a -= ((a * self.q) >> self.shift) * self.m
if a >= self.m:
a -= self.m
a -= self.m * (a >= self.m)
return a


Expand Down

0 comments on commit 11da0b7

Please sign in to comment.