X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fdsa%2Fdsa.h;h=ca301c533632a949a00fcdb9b85d6c3ba9c8e32d;hb=7b224903f4d4e2c74d1548b6f0ca8b0ba31113ad;hp=a68d3f6681c14d3244bcec0635a3fa7c150edddf;hpb=dd9d233e2aa493fa1398b527afbf6aa5cdb23f23;p=oweals%2Fopenssl.git diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h index a68d3f6681..ca301c5336 100644 --- a/crypto/dsa/dsa.h +++ b/crypto/dsa/dsa.h @@ -65,10 +65,6 @@ #ifndef HEADER_DSA_H #define HEADER_DSA_H -#ifdef __cplusplus -extern "C" { -#endif - #ifdef NO_DSA #error DSA is disabled. #endif @@ -81,6 +77,10 @@ extern "C" { #define DSA_FLAG_CACHE_MONT_P 0x01 +#ifdef __cplusplus +extern "C" { +#endif + typedef struct dsa_st DSA; typedef struct DSA_SIG_st @@ -182,7 +182,7 @@ DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length); DSA * DSA_generate_parameters(int bits, unsigned char *seed,int seed_len, int *counter_ret, unsigned long *h_ret,void - (*callback)(),char *cb_arg); + (*callback)(int, int, void *),void *cb_arg); int DSA_generate_key(DSA *a); int i2d_DSAPublicKey(DSA *a, unsigned char **pp); int i2d_DSAPrivateKey(DSA *a, unsigned char **pp); @@ -197,7 +197,11 @@ int DSAparams_print_fp(FILE *fp, DSA *x); int DSA_print_fp(FILE *bp, DSA *x, int off); #endif -int DSA_is_prime(BIGNUM *q,void (*callback)(),char *cb_arg); +#define DSS_prime_checks 50 +/* Primality test according to FIPS PUB 186[-1], Appendix 2.1: + * 50 rounds of Rabin-Miller */ +#define DSA_is_prime(n, callback, cb_arg) \ + BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) #ifndef NO_DH /* Convert DSA structure (key or just parameters) into DH structure @@ -218,7 +222,6 @@ DH *DSA_dup_DH(DSA *r); #define DSA_F_DSAPARAMS_PRINT_FP 101 #define DSA_F_DSA_DO_SIGN 112 #define DSA_F_DSA_DO_VERIFY 113 -#define DSA_F_DSA_IS_PRIME 102 #define DSA_F_DSA_NEW 103 #define DSA_F_DSA_PRINT 104 #define DSA_F_DSA_PRINT_FP 105