My Project
dh.h
Go to the documentation of this file.
1 
21 int wc_InitDhKey(DhKey* key);
22 
43 void wc_FreeDhKey(DhKey* key);
44 
94 int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv,
95  word32* privSz, byte* pub, word32* pubSz);
96 
145 int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz,
146  const byte* priv, word32 privSz, const byte* otherPub,
147  word32 pubSz);
148 
187 int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
188  word32);
189 
228 int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
229  word32 gSz);
230 
272 int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p,
273  word32* pInOutSz, byte* g, word32* gInOutSz);
274 
286 const DhParams* wc_Dh_ffdhe2048_Get(void);
287 
299 const DhParams* wc_Dh_ffdhe3072_Get(void);
300 
312 const DhParams* wc_Dh_ffdhe4096_Get(void);
313 
325 const DhParams* wc_Dh_ffdhe6144_Get(void);
326 
338 const DhParams* wc_Dh_ffdhe8192_Get(void);
339 
346 int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz,
347  const byte* priv, word32 privSz);
348 
354 int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz);
355 
359 int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz,
360  const byte* prime, word32 primeSz);
361 
365 int wc_DhCheckPubKey(DhKey* key, const byte* pub, word32 pubSz);
366 
370 int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz,
371  const byte* prime, word32 primeSz);
372 
376 int wc_DhExportParamsRaw(DhKey* dh, byte* p, word32* pSz,
377  byte* q, word32* qSz, byte* g, word32* gSz);
378 
382 int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh);
383 
387 int wc_DhSetCheckKey(DhKey* key, const byte* p, word32 pSz,
388  const byte* g, word32 gSz, const byte* q, word32 qSz,
389  int trusted, WC_RNG* rng);
390 
394 int wc_DhSetKey_ex(DhKey* key, const byte* p, word32 pSz,
395  const byte* g, word32 gSz, const byte* q, word32 qSz);
396 
400 int wc_FreeDhKey(DhKey* key);
wc_FreeDhKey
void wc_FreeDhKey(DhKey *key)
This function frees a Diffie-Hellman key after it has been used to negotiate a secure secret key with...
wc_DhCheckPrivKey_ex
int wc_DhCheckPrivKey_ex(DhKey *key, const byte *priv, word32 pubSz, const byte *prime, word32 primeSz)
wc_DhCheckKeyPair
int wc_DhCheckKeyPair(DhKey *key, const byte *pub, word32 pubSz, const byte *priv, word32 privSz)
Checks DH keys for pair-wise consistency per process in SP 800-56Ar3, section 5.6....
wc_DhKeyDecode
int wc_DhKeyDecode(const byte *input, word32 *inOutIdx, DhKey *key, word32)
This function decodes a Diffie-Hellman key from the given input buffer containing the key in DER form...
wc_DhSetCheckKey
int wc_DhSetCheckKey(DhKey *key, const byte *p, word32 pSz, const byte *g, word32 gSz, const byte *q, word32 qSz, int trusted, WC_RNG *rng)
wc_DhParamsLoad
int wc_DhParamsLoad(const byte *input, word32 inSz, byte *p, word32 *pInOutSz, byte *g, word32 *gInOutSz)
This function loads the Diffie-Hellman parameters, p (prime) and g (base) out of the given input buff...
wc_Dh_ffdhe4096_Get
const DhParams * wc_Dh_ffdhe4096_Get(void)
This function returns ... and requires that HAVE_FFDHE_4096 be defined.
wc_Dh_ffdhe2048_Get
const DhParams * wc_Dh_ffdhe2048_Get(void)
This function returns ... and requires that HAVE_FFDHE_2048 be defined.
wc_DhGenerateKeyPair
int wc_DhGenerateKeyPair(DhKey *key, WC_RNG *rng, byte *priv, word32 *privSz, byte *pub, word32 *pubSz)
This function generates a public/private key pair based on the Diffie-Hellman public parameters,...
wc_DhAgree
int wc_DhAgree(DhKey *key, byte *agree, word32 *agreeSz, const byte *priv, word32 privSz, const byte *otherPub, word32 pubSz)
This function generates an agreed upon secret key based on a local private key and a received public ...
wc_DhCheckPubKey
int wc_DhCheckPubKey(DhKey *key, const byte *pub, word32 pubSz)
wc_DhCheckPubKey_ex
int wc_DhCheckPubKey_ex(DhKey *key, const byte *pub, word32 pubSz, const byte *prime, word32 primeSz)
wc_Dh_ffdhe8192_Get
const DhParams * wc_Dh_ffdhe8192_Get(void)
This function returns ... and requires that HAVE_FFDHE_8192 be defined.
wc_DhCheckPrivKey
int wc_DhCheckPrivKey(DhKey *key, const byte *priv, word32 pubSz)
Check DH private key for invalid numbers.
wc_DhGenerateParams
int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh)
wc_Dh_ffdhe6144_Get
const DhParams * wc_Dh_ffdhe6144_Get(void)
This function returns ... and requires that HAVE_FFDHE_6144 be defined.
wc_DhSetKey_ex
int wc_DhSetKey_ex(DhKey *key, const byte *p, word32 pSz, const byte *g, word32 gSz, const byte *q, word32 qSz)
wc_DhExportParamsRaw
int wc_DhExportParamsRaw(DhKey *dh, byte *p, word32 *pSz, byte *q, word32 *qSz, byte *g, word32 *gSz)
wc_InitDhKey
int wc_InitDhKey(DhKey *key)
This function initializes a Diffie-Hellman key for use in negotiating a secure secret key with the Di...
wc_DhSetKey
int wc_DhSetKey(DhKey *key, const byte *p, word32 pSz, const byte *g, word32 gSz)
This function sets the key for a DhKey structure using the input private key parameters....
wc_Dh_ffdhe3072_Get
const DhParams * wc_Dh_ffdhe3072_Get(void)
This function returns ... and requires that HAVE_FFDHE_3072 be defined.