diff options
Diffstat (limited to 'src/math/numbertheory/ressol.cpp')
-rw-r--r-- | src/math/numbertheory/ressol.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/math/numbertheory/ressol.cpp b/src/math/numbertheory/ressol.cpp index d51acb8bd..4696168b8 100644 --- a/src/math/numbertheory/ressol.cpp +++ b/src/math/numbertheory/ressol.cpp @@ -64,12 +64,11 @@ BigInt ressol(const BigInt& a, const BigInt& p) q = mod_p.square(q); ++i; } - u32bit t = s; - if(t <= i) + if(s <= i) return -BigInt(1); - c = power_mod(c, BigInt(BigInt::Power2, t-i-1), p); + c = power_mod(c, BigInt(BigInt::Power2, s-i-1), p); r = mod_p.multiply(r, c); c = mod_p.square(c); n = mod_p.multiply(n, c); |