dsa.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* dsa.h for openSSL */
  2. #ifndef CYASSL_DSA_H_
  3. #define CYASSL_DSA_H_
  4. #include <cyassl/openssl/ssl.h>
  5. #include <cyassl/openssl/bn.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. struct CYASSL_DSA {
  10. CYASSL_BIGNUM* p;
  11. CYASSL_BIGNUM* q;
  12. CYASSL_BIGNUM* g;
  13. CYASSL_BIGNUM* pub_key; /* our y */
  14. CYASSL_BIGNUM* priv_key; /* our x */
  15. void* internal; /* our Dsa Key */
  16. char inSet; /* internal set from external ? */
  17. char exSet; /* external set from internal ? */
  18. };
  19. CYASSL_API CYASSL_DSA* CyaSSL_DSA_new(void);
  20. CYASSL_API void CyaSSL_DSA_free(CYASSL_DSA*);
  21. CYASSL_API int CyaSSL_DSA_generate_key(CYASSL_DSA*);
  22. CYASSL_API int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA*, int bits,
  23. unsigned char* seed, int seedLen, int* counterRet,
  24. unsigned long* hRet, void* cb);
  25. CYASSL_API int CyaSSL_DSA_LoadDer(CYASSL_DSA*, const unsigned char*, int sz);
  26. CYASSL_API int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
  27. CYASSL_DSA* dsa);
  28. #define DSA_new CyaSSL_DSA_new
  29. #define DSA_free CyaSSL_DSA_free
  30. #define DSA_generate_key CyaSSL_DSA_generate_key
  31. #define DSA_generate_parameters_ex CyaSSL_DSA_generate_parameters_ex
  32. #ifdef __cplusplus
  33. } /* extern "C" */
  34. #endif
  35. #endif /* header */