comparison libtommath/bn_mp_prime_next_prime.c @ 588:a55b97f5a485

Fix bug in primality testing, see http://bugs.gentoo.org/show_bug.cgi?id=328383 http://bugs.gentoo.org/show_bug.cgi?id=328409 https://bugzilla.redhat.com/show_bug.cgi?id=615088 Exact effects of the bug are uncertain.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 21 Jul 2010 13:33:07 +0000
parents 5ff8218bcee9
children 60fc6476e044
comparison
equal deleted inserted replaced
587:1151059c5eff 588:a55b97f5a485
141 continue; 141 continue;
142 } 142 }
143 143
144 /* is this prime? */ 144 /* is this prime? */
145 for (x = 0; x < t; x++) { 145 for (x = 0; x < t; x++) {
146 mp_set(&b, ltm_prime_tab[t]); 146 mp_set(&b, ltm_prime_tab[x]);
147 if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { 147 if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
148 goto LBL_ERR; 148 goto LBL_ERR;
149 } 149 }
150 if (res == MP_NO) { 150 if (res == MP_NO) {
151 break; 151 break;