Skip to content

Commit 11da0b7

Browse files
authored
Update barret.py
1 parent 9a54494 commit 11da0b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

barret.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def __init__(self, m):
1515
def reduce(self, a):
1616
# if 0 <= a <= self.m**2: raise ValueError("a must be >0 and < n^2")
1717
a -= ((a * self.q) >> self.shift) * self.m
18-
if a >= self.m:
19-
a -= self.m
18+
a -= self.m * (a >= self.m)
2019
return a
2120

2221

0 commit comments

Comments
 (0)