aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/ressol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/numbertheory/ressol.cpp')
-rw-r--r--src/math/numbertheory/ressol.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/math/numbertheory/ressol.cpp b/src/math/numbertheory/ressol.cpp
index 2e01406f8..adacd27f7 100644
--- a/src/math/numbertheory/ressol.cpp
+++ b/src/math/numbertheory/ressol.cpp
@@ -63,10 +63,10 @@ BigInt ressol(const BigInt& a, const BigInt& p)
{
q = mod_p.square(q);
++i;
- }
- if(s <= i)
- return -BigInt(1);
+ if(i >= s)
+ return -BigInt(1);
+ }
c = power_mod(c, BigInt(BigInt::Power2, s-i-1), p);
r = mod_p.multiply(r, c);