[libmath-prime-util-perl] 40/72: ECPP verification: floor(2*sqrt(n)) instead of 2*floor(sqrt(n))

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:49:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.32
in repository libmath-prime-util-perl.

commit 041e0c844467cda0ae647c62c12b1501146c7025
Author: Dana Jacobsen <dana at acm.org>
Date:   Mon Sep 23 10:10:39 2013 -0700

    ECPP verification: floor(2*sqrt(n)) instead of 2*floor(sqrt(n))
---
 lib/Math/Prime/Util/PrimalityProving.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Math/Prime/Util/PrimalityProving.pm b/lib/Math/Prime/Util/PrimalityProving.pm
index 70c6808..26501cc 100644
--- a/lib/Math/Prime/Util/PrimalityProving.pm
+++ b/lib/Math/Prime/Util/PrimalityProving.pm
@@ -560,8 +560,8 @@ sub _verify_ecpp {
     unless Math::BigInt::bgcd(4*$a*$a*$a+27*$b*$b,$n) == 1;
   return _pfail "ECPP: $n failed Y^2 = X^3 + A*X + B mod N"
     unless ($y*$y) % $n == ($x*$x*$x + $a*$x + $b) % $n;
-  return _pfail "ECPP: $n failed M >= N - 2*sqrt(N) + 1" unless $m >= $n - 2*$n->copy->bsqrt() + 1;
-  return _pfail "ECPP: $n failed M <= N + 2*sqrt(N) + 1" unless $m <= $n + 2*$n->copy->bsqrt() + 1;
+  return _pfail "ECPP: $n failed M >= N - 2*sqrt(N) + 1" unless $m >= $n + 1 - $n->copy->bmul(4)->bsqrt();
+  return _pfail "ECPP: $n failed M <= N + 2*sqrt(N) + 1" unless $m <= $n + 1 + $n->copy->bmul(4)->bsqrt();
   return _pfail "ECPP: $n failed Q > (N^(1/4)+1)^2" unless $q > $n->copy->broot(4)->badd(1)->bpow(2);
   return _pfail "ECPP: $n failed Q < N" unless $q < $n;
   return _pfail "ECPP: $n failed M != Q" unless $m != $q;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list