- Timestamp:
- Feb 7, 2019, 8:36:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/dh.h
r337 r372 20 20 */ 21 21 22 /*! 23 \file wolfssl/wolfcrypt/dh.h 24 */ 22 25 23 26 #ifndef WOLF_CRYPT_DH_H … … 27 30 28 31 #ifndef NO_DH 32 33 #if defined(HAVE_FIPS) && \ 34 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) 35 #include <wolfssl/wolfcrypt/fips.h> 36 #endif /* HAVE_FIPS_VERSION >= 2 */ 29 37 30 38 #include <wolfssl/wolfcrypt/integer.h> … … 39 47 #endif 40 48 typedef struct DhParams { 49 #ifdef HAVE_FFDHE_Q 50 const byte* q; 51 word32 q_len; 52 #endif /* HAVE_FFDHE_Q */ 41 53 const byte* p; 42 54 word32 p_len; … … 47 59 /* Diffie-Hellman Key */ 48 60 typedef struct DhKey { 49 mp_int p, g ;/* group parameters */61 mp_int p, g, q; /* group parameters */ 50 62 void* heap; 51 63 #ifdef WOLFSSL_ASYNC_CRYPT … … 73 85 WOLFSSL_API int wc_InitDhKey(DhKey* key); 74 86 WOLFSSL_API int wc_InitDhKey_ex(DhKey* key, void* heap, int devId); 75 WOLFSSL_API voidwc_FreeDhKey(DhKey* key);87 WOLFSSL_API int wc_FreeDhKey(DhKey* key); 76 88 77 89 WOLFSSL_API int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv, … … 85 97 WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, 86 98 word32 gSz); 99 WOLFSSL_API int wc_DhSetKey_ex(DhKey* key, const byte* p, word32 pSz, 100 const byte* g, word32 gSz, const byte* q, word32 qSz); 101 WOLFSSL_API int wc_DhSetCheckKey(DhKey* key, const byte* p, word32 pSz, 102 const byte* g, word32 gSz, const byte* q, word32 qSz, 103 int trusted, WC_RNG* rng); 87 104 WOLFSSL_API int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p, 88 105 word32* pInOutSz, byte* g, word32* gInOutSz); 89 106 WOLFSSL_API int wc_DhCheckPubKey(DhKey* key, const byte* pub, word32 pubSz); 107 WOLFSSL_API int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz, 108 const byte* prime, word32 primeSz); 109 WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz); 110 WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz, 111 const byte* prime, word32 primeSz); 112 WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz, 113 const byte* priv, word32 privSz); 114 WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh); 115 WOLFSSL_API int wc_DhExportParamsRaw(DhKey* dh, byte* p, word32* pSz, 116 byte* q, word32* qSz, byte* g, word32* gSz); 117 90 118 91 119 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.