X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbn%2Fbn_prime.c;h=6fa0f9be1ee32b4767e8ed154832b88923601119;hb=f18a93ab04f248de45a8bcdded9b91880c690dbd;hp=bd9900db4dee7c65b2c55fc554937fe2f7e88dbf;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c index bd9900db4d..6fa0f9be1e 100644 --- a/crypto/bn/bn_prime.c +++ b/crypto/bn/bn_prime.c @@ -60,7 +60,7 @@ #include #include "cryptlib.h" #include "bn_lcl.h" -#include "rand.h" +#include /* The quick seive algorithm approach to weeding out primes is * Philip Zimmermann's, as implemented in PGP. I have had a read of @@ -68,7 +68,6 @@ */ #include "bn_prime.h" -#ifndef NOPROTO static int witness(BIGNUM *a, BIGNUM *n, BN_CTX *ctx,BN_CTX *ctx2, BN_MONT_CTX *mont); static int probable_prime(BIGNUM *rnd, int bits); @@ -76,15 +75,8 @@ static int probable_prime_dh(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem, BN_CTX *ctx); static int probable_prime_dh_strong(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem, BN_CTX *ctx); -#else -static int witness(); -static int probable_prime(); -static int probable_prime_dh(); -static int probable_prime_dh_strong(); -#endif - BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int strong, BIGNUM *add, - BIGNUM *rem, void (*callback)(P_I_I_P), char *cb_arg) + BIGNUM *rem, void (*callback)(int,int,void *), void *cb_arg) { BIGNUM *rnd=NULL; BIGNUM t; @@ -159,8 +151,8 @@ err: return(ret); } -int BN_is_prime(BIGNUM *a, int checks, void (*callback)(P_I_I_P), - BN_CTX *ctx_passed, char *cb_arg) +int BN_is_prime(BIGNUM *a, int checks, void (*callback)(int,int,void *), + BN_CTX *ctx_passed, void *cb_arg) { int i,j,c2=0,ret= -1; BIGNUM *check; @@ -327,7 +319,7 @@ static int probable_prime_dh(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem, loop: for (i=1; i