#include "bn.h"
+#define DSA_FLAG_CACHE_MONT_P 0x01
+
typedef struct dsa_st
{
/* This first variable is used to pick up errors where
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, \
#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(unsigned char *dgst,int dlen,DSA *dsa);
+int DSA_do_verify(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 */
#else
+DSA_SIG * DSA_SIG_new();
+void DSA_SIG_free();
+int i2d_DSA_SIG();
+DSA_SIG * d2i_DSA_SIG();
+
+DSA_SIG * DSA_do_sign();
+int DSA_do_verify();
+
DSA * DSA_new();
int DSA_size();
int DSA_sign_setup();
#define DSA_F_DSA_SIGN 106
#define DSA_F_DSA_SIGN_SETUP 107
#define DSA_F_DSA_VERIFY 108
+#define DSA_F_DSA_SIG_NEW 109
+#define DSA_F_D2I_DSA_SIG 110
+#define DSA_F_I2D_DSA_SIG 111
+#define DSA_F_DSA_DO_SIGN 112
+#define DSA_F_DSA_DO_VERIFY 113
/* Reason codes. */
#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100