wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Tue May 30 01:44:10 2017 +0000
Revision:
11:cee25a834751
wolfSSL 3.11.0

Who changed what in which revision?

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