[337] | 1 | /* dsa.h for openSSL */
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | #ifndef WOLFSSL_DSA_H_
|
---|
| 5 | #define WOLFSSL_DSA_H_
|
---|
| 6 |
|
---|
| 7 | #include <wolfssl/openssl/bn.h>
|
---|
| 8 |
|
---|
| 9 | #ifdef __cplusplus
|
---|
| 10 | extern "C" {
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
| 13 | #ifndef WOLFSSL_DSA_TYPE_DEFINED /* guard on redeclaration */
|
---|
| 14 | typedef struct WOLFSSL_DSA WOLFSSL_DSA;
|
---|
| 15 | #define WOLFSSL_DSA_TYPE_DEFINED
|
---|
| 16 | #endif
|
---|
| 17 |
|
---|
| 18 | typedef WOLFSSL_DSA DSA;
|
---|
| 19 |
|
---|
| 20 | struct WOLFSSL_DSA {
|
---|
| 21 | WOLFSSL_BIGNUM* p;
|
---|
| 22 | WOLFSSL_BIGNUM* q;
|
---|
| 23 | WOLFSSL_BIGNUM* g;
|
---|
| 24 | WOLFSSL_BIGNUM* pub_key; /* our y */
|
---|
| 25 | WOLFSSL_BIGNUM* priv_key; /* our x */
|
---|
| 26 | void* internal; /* our Dsa Key */
|
---|
| 27 | char inSet; /* internal set from external ? */
|
---|
| 28 | char exSet; /* external set from internal ? */
|
---|
| 29 | };
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | WOLFSSL_API WOLFSSL_DSA* wolfSSL_DSA_new(void);
|
---|
| 33 | WOLFSSL_API void wolfSSL_DSA_free(WOLFSSL_DSA*);
|
---|
| 34 |
|
---|
| 35 | WOLFSSL_API int wolfSSL_DSA_generate_key(WOLFSSL_DSA*);
|
---|
| 36 | WOLFSSL_API int wolfSSL_DSA_generate_parameters_ex(WOLFSSL_DSA*, int bits,
|
---|
| 37 | unsigned char* seed, int seedLen, int* counterRet,
|
---|
| 38 | unsigned long* hRet, void* cb);
|
---|
| 39 |
|
---|
| 40 | WOLFSSL_API int wolfSSL_DSA_LoadDer(WOLFSSL_DSA*, const unsigned char*, int sz);
|
---|
| 41 |
|
---|
| 42 | WOLFSSL_API int wolfSSL_DSA_do_sign(const unsigned char* d,
|
---|
| 43 | unsigned char* sigRet, WOLFSSL_DSA* dsa);
|
---|
| 44 |
|
---|
| 45 | WOLFSSL_API int wolfSSL_DSA_do_verify(const unsigned char* d,
|
---|
| 46 | unsigned char* sig,
|
---|
| 47 | WOLFSSL_DSA* dsa, int *dsacheck);
|
---|
| 48 |
|
---|
| 49 | #define DSA_new wolfSSL_DSA_new
|
---|
| 50 | #define DSA_free wolfSSL_DSA_free
|
---|
| 51 |
|
---|
| 52 | #define DSA_generate_key wolfSSL_DSA_generate_key
|
---|
| 53 | #define DSA_generate_parameters_ex wolfSSL_DSA_generate_parameters_ex
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | #ifdef __cplusplus
|
---|
| 57 | } /* extern "C" */
|
---|
| 58 | #endif
|
---|
| 59 |
|
---|
| 60 | #endif /* header */
|
---|