diff options
author | 1999-09-29 04:35:07 +0000 | |
---|---|---|
committer | 1999-09-29 04:35:07 +0000 | |
commit | 913ec974266f8a62ab2e5ca34a31d6e6f75b3cf0 (patch) | |
tree | 62c001f84cb6413a049c5c811a08bfbe7c747b77 /lib/libssl/src/crypto/dsa/dsa.h | |
parent | fix byte counters; imain@netidea.com (diff) | |
download | wireguard-openbsd-913ec974266f8a62ab2e5ca34a31d6e6f75b3cf0.tar.xz wireguard-openbsd-913ec974266f8a62ab2e5ca34a31d6e6f75b3cf0.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'lib/libssl/src/crypto/dsa/dsa.h')
-rw-r--r-- | lib/libssl/src/crypto/dsa/dsa.h | 80 |
1 files changed, 45 insertions, 35 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa.h b/lib/libssl/src/crypto/dsa/dsa.h index 1ca87c1cbea..20b3f8d90a0 100644 --- a/lib/libssl/src/crypto/dsa/dsa.h +++ b/lib/libssl/src/crypto/dsa/dsa.h @@ -69,7 +69,16 @@ extern "C" { #endif -#include "bn.h" +#ifdef NO_DSA +#error DSA is disabled. +#endif + +#include <openssl/bn.h> +#ifndef NO_DH +# include <openssl/dh.h> +#endif + +#define DSA_FLAG_CACHE_MONT_P 0x01 typedef struct dsa_st { @@ -88,9 +97,19 @@ typedef struct dsa_st BIGNUM *kinv; /* Signing pre-calc */ BIGNUM *r; /* Signing pre-calc */ + int flags; + /* Normally used to cache montgomery values */ + char *method_mont_p; + int references; } DSA; +typedef struct DSA_SIG_st + { + BIGNUM *r; + BIGNUM *s; + } DSA_SIG; + #define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \ (char *(*)())d2i_DSAparams,(char *)(x)) #define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ @@ -102,15 +121,23 @@ typedef struct dsa_st #define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio(i2d_DSAparams,(bp), \ (unsigned char *)(x)) -#ifndef NOPROTO + +DSA_SIG * DSA_SIG_new(void); +void DSA_SIG_free(DSA_SIG *a); +int i2d_DSA_SIG(DSA_SIG *a, unsigned char **pp); +DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length); + +DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); +int DSA_do_verify(const unsigned char *dgst,int dgst_len, + DSA_SIG *sig,DSA *dsa); DSA * DSA_new(void); int DSA_size(DSA *); /* next 4 return -1 on error */ int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); -int DSA_sign(int type,unsigned char *dgst,int dlen, +int DSA_sign(int type,const unsigned char *dgst,int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa); -int DSA_verify(int type,unsigned char *dgst,int dgst_len, +int DSA_verify(int type,const unsigned char *dgst,int dgst_len, unsigned char *sigbuf, int siglen, DSA *dsa); void DSA_free (DSA *r); @@ -138,55 +165,38 @@ int DSA_print_fp(FILE *bp, DSA *x, int off); int DSA_is_prime(BIGNUM *q,void (*callback)(),char *cb_arg); -#else - -DSA * DSA_new(); -int DSA_size(); -int DSA_sign_setup(); -int DSA_sign(); -int DSA_verify(); -void DSA_free (); - -void ERR_load_DSA_strings(); - -DSA * d2i_DSAPublicKey(); -DSA * d2i_DSAPrivateKey(); -DSA * d2i_DSAparams(); -DSA * DSA_generate_parameters(); -int DSA_generate_key(); -int i2d_DSAPublicKey(); -int i2d_DSAPrivateKey(); -int i2d_DSAparams(); - -int DSA_is_prime(); - -int DSAparams_print(); -int DSA_print(); - -#ifndef NO_FP_API -int DSAparams_print_fp(); -int DSA_print_fp(); -#endif - +#ifndef NO_DH +/* Convert DSA structure (key or just parameters) into DH structure + * (be careful to avoid small subgroup attacks when using this!) */ +DH *DSA_dup_DH(DSA *r); #endif /* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + /* Error codes for the DSA functions. */ /* Function codes. */ +#define DSA_F_D2I_DSA_SIG 110 #define DSA_F_DSAPARAMS_PRINT 100 #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 #define DSA_F_DSA_SIGN 106 #define DSA_F_DSA_SIGN_SETUP 107 +#define DSA_F_DSA_SIG_NEW 109 #define DSA_F_DSA_VERIFY 108 +#define DSA_F_I2D_DSA_SIG 111 /* Reason codes. */ #define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 - + #ifdef __cplusplus } #endif |