2012-04-27 03:27:27 +04:00
|
|
|
/* dsa.h for openSSL */
|
2011-02-05 22:14:47 +03:00
|
|
|
|
2012-04-27 03:27:27 +04:00
|
|
|
|
|
|
|
#ifndef CYASSL_DSA_H_
|
|
|
|
#define CYASSL_DSA_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <cyassl/openssl/ssl.h>
|
|
|
|
#include <cyassl/openssl/bn.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct CYASSL_DSA {
|
2012-05-02 03:12:12 +04:00
|
|
|
CYASSL_BIGNUM* p;
|
|
|
|
CYASSL_BIGNUM* q;
|
|
|
|
CYASSL_BIGNUM* g;
|
2012-05-08 03:35:23 +04:00
|
|
|
CYASSL_BIGNUM* pub_key; /* our y */
|
|
|
|
CYASSL_BIGNUM* priv_key; /* our x */
|
|
|
|
void* internal; /* our Dsa Key */
|
|
|
|
char inSet; /* internal set from external ? */
|
|
|
|
char exSet; /* external set from internal ? */
|
2012-04-27 03:27:27 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-05-02 03:12:12 +04:00
|
|
|
CYASSL_API CYASSL_DSA* CyaSSL_DSA_new(void);
|
|
|
|
CYASSL_API void CyaSSL_DSA_free(CYASSL_DSA*);
|
2012-04-27 03:27:27 +04:00
|
|
|
|
2012-05-02 03:12:12 +04:00
|
|
|
CYASSL_API int CyaSSL_DSA_generate_key(CYASSL_DSA*);
|
|
|
|
CYASSL_API int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA*, int bits,
|
|
|
|
unsigned char* seed, int seedLen, int* counterRet,
|
|
|
|
unsigned long* hRet, void* cb);
|
|
|
|
|
2012-05-08 03:35:23 +04:00
|
|
|
CYASSL_API int CyaSSL_DSA_LoadDer(CYASSL_DSA*, const unsigned char*, int sz);
|
2012-05-08 05:19:48 +04:00
|
|
|
CYASSL_API int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
|
|
|
|
CYASSL_DSA* dsa);
|
2012-05-08 03:35:23 +04:00
|
|
|
|
2012-05-02 03:12:12 +04:00
|
|
|
#define DSA_new CyaSSL_DSA_new
|
|
|
|
#define DSA_free CyaSSL_DSA_free
|
|
|
|
|
|
|
|
#define DSA_generate_key CyaSSL_DSA_generate_key
|
|
|
|
#define DSA_generate_parameters_ex CyaSSL_DSA_generate_parameters_ex
|
2012-04-27 03:27:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* header */
|