diff libtommath/bn_mp_prime_rabin_miller_trials.c @ 1656:a36e545fb43d

Prime-related bugfixes (#81) * Merge pull request #180 from czurnieden/isprimeerror Fixed bug in mp_prime_isprime (cherry picked from commit f3ff7064f3301a2fc11b84d389fd67769862d437) * do 2 MR rounds for numbers >=2048bits * back-port modified mp_prime_next_prime()
author Steffen Jaeckel <s@jaeckel.eu>
date Tue, 17 Sep 2019 16:11:09 +0200
parents f52919ffd3b1
children 1051e4eea25a
line wrap: on
line diff
--- a/libtommath/bn_mp_prime_rabin_miller_trials.c	Mon Sep 16 15:50:38 2019 +0200
+++ b/libtommath/bn_mp_prime_rabin_miller_trials.c	Tue Sep 17 16:11:09 2019 +0200
@@ -29,8 +29,7 @@
    {   768,     5 },
    {   896,     4 },
    {  1024,     4 },
-   {  2048,     2 },
-   {  4096,     1 },
+   {  2048,     2 }  /* For bigger keysizes use always at least 2 Rounds */
 };
 
 /* returns # of RM trials required for a given bit size and max. error of 2^(-96)*/
@@ -45,7 +44,7 @@
          return (x == 0) ? sizes[0].t : sizes[x - 1].t;
       }
    }
-   return sizes[x-1].t + 1;
+   return sizes[x-1].t;
 }