[flint] 05/24: Added copyright for Dana Jacobsen and copied large base code over to precomp version of is_strong_probab_prime2.

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 294a8be2205697499aaf012e96750c9a8e9b5377
Author: William Hart <goodwillhart at googlemail.com>
Date:   Tue Jun 17 15:14:28 2014 +0100

    Added copyright for Dana Jacobsen and copied large base code over to precomp
    version of is_strong_probab_prime2.
---
 ulong_extras/is_prime.c                      | 1 +
 ulong_extras/is_probabprime.c                | 1 +
 ulong_extras/is_strong_probabprime2_preinv.c | 5 +++++
 ulong_extras/is_strong_probabprime_precomp.c | 7 ++++---
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ulong_extras/is_prime.c b/ulong_extras/is_prime.c
index 126efa4..2d8626a 100644
--- a/ulong_extras/is_prime.c
+++ b/ulong_extras/is_prime.c
@@ -20,6 +20,7 @@
 /******************************************************************************
 
     Copyright (C) 2009 William Hart
+    Copyright (C) 2014 Dana Jacobsen
 
 ******************************************************************************/
 
diff --git a/ulong_extras/is_probabprime.c b/ulong_extras/is_probabprime.c
index 365abcb..98a7a11 100644
--- a/ulong_extras/is_probabprime.c
+++ b/ulong_extras/is_probabprime.c
@@ -20,6 +20,7 @@
 /******************************************************************************
 
     Copyright (C) 2009 William Hart
+    Copyright (C) 2014 Dana Jacobsen
 
 ******************************************************************************/
 
diff --git a/ulong_extras/is_strong_probabprime2_preinv.c b/ulong_extras/is_strong_probabprime2_preinv.c
index 8fdd1e7..442480a 100644
--- a/ulong_extras/is_strong_probabprime2_preinv.c
+++ b/ulong_extras/is_strong_probabprime2_preinv.c
@@ -21,6 +21,7 @@
 
     Copyright (C) 2008, Peter Shrimpton
     Copyright (C) 2009 William Hart
+    Copyright (C) 2014 Dana Jacobsen
 
 ******************************************************************************/
 
@@ -35,6 +36,10 @@ n_is_strong_probabprime2_preinv(mp_limb_t n, mp_limb_t ninv, 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_powmod2_ui_preinv(a, t, n, ninv);
 
     if (y == UWORD(1))
diff --git a/ulong_extras/is_strong_probabprime_precomp.c b/ulong_extras/is_strong_probabprime_precomp.c
index e9a4fea..c3f86e1 100644
--- a/ulong_extras/is_strong_probabprime_precomp.c
+++ b/ulong_extras/is_strong_probabprime_precomp.c
@@ -19,8 +19,9 @@
 =============================================================================*/
 /******************************************************************************
 
-    Copyright (C) 2008, Peter Shrimpton
+    Copyright (C) 2008 Peter Shrimpton
     Copyright (C) 2009 William Hart
+    Copyright (C) 2014 Dana Jacobsen
 
 ******************************************************************************/
 
@@ -35,9 +36,9 @@ 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 */
+    /* Map large base to range 2 ... n-1 */
     if (a >= n)  a %= n;
-    if ( (a <= 1) || (a == n-1) )  return 1;
+    if ((a <= 1) || (a == n-1))  return 1;
 
     y = n_powmod_ui_precomp(a, t, n, npre);
 

-- 
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