From 946720f64e9f556141bba2412d99e4695b0fb7ec Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 20 Nov 2011 21:09:38 -0800 Subject: [PATCH] do m-r on more then one prime --- lib/hcrypto/libtommath/bn_mp_prime_next_prime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c b/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c index a2897f087..db2f46ddb 100644 --- a/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c +++ b/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c @@ -142,8 +142,8 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) } /* is this prime? */ - for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + for (x = 0; x < t && x < PRIME_SIZE; x++) { + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } -- 2.11.4.GIT