From ab011d51be7c468899b486c235fc6db17d51a959 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 18 Sep 2007 20:55:10 +0000 Subject: [PATCH] Minimize stack utilization in probable_prime [from HEAD]. --- crypto/bn/bn_prime.c | 4 ++-- crypto/bn/bn_prime.h | 4 +++- crypto/bn/bn_prime.pl | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c index 5bab019553..7b25979dd1 100644 --- a/crypto/bn/bn_prime.c +++ b/crypto/bn/bn_prime.c @@ -377,14 +377,14 @@ static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1, static int probable_prime(BIGNUM *rnd, int bits) { int i; - BN_ULONG mods[NUMPRIMES]; + prime_t mods[NUMPRIMES]; BN_ULONG delta,maxdelta; again: if (!BN_rand(rnd,bits,1,1)) return(0); /* we now have a random number 'rand' to test. */ for (i=1; i