[flint] 03/24: Allow large bases

felix salfelder felix-guest at moszumanska.debian.org
Wed Jun 25 11:16:10 UTC 2014


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

felix-guest pushed a commit to branch master
in repository flint.

commit 21b131f0e92bddb3358f6a922937128ac2c7f458
Author: Dana Jacobsen <dana at acm.org>
Date:   Tue May 13 01:03:59 2014 -0700

    Allow large bases
---
 ulong_extras/is_strong_probabprime_precomp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ulong_extras/is_strong_probabprime_precomp.c b/ulong_extras/is_strong_probabprime_precomp.c
index be9e212..e9a4fea 100644
--- a/ulong_extras/is_strong_probabprime_precomp.c
+++ b/ulong_extras/is_strong_probabprime_precomp.c
@@ -35,6 +35,10 @@ n_is_strong_probabprime_precomp(mp_limb_t n, double npre, mp_limb_t a,
     mp_limb_t t = d;
     mp_limb_t y;
 
+    /* Map large base to range 2 .. n-1 */
+    if (a >= n)  a %= n;
+    if ( (a <= 1) || (a == n-1) )  return 1;
+
     y = n_powmod_ui_precomp(a, t, n, npre);
 
     if (y == UWORD(1))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git



More information about the debian-science-commits mailing list