Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
crys_dh.h File Reference
This module defines the API that supports Diffie-Hellman key exchange, as defined in [PKCS3] and in [X9.42] (key lengths 1024 and 2048 bits). More...
Go to the source code of this file.
Data Structures | |
struct | CRYS_DH_ExpTemp_t |
struct | CRYS_DH_Temp_t |
struct | CRYS_DH_HybrTemp_t |
struct | CRYS_DH_FipsKat_t |
Enumerations | |
enum | CRYS_DH_OpMode_t { CRYS_DH_PKCS3_mode = 0, CRYS_DH_ANSI_X942_mode = 1, CRYS_DH_NumOfModes, CRYS_DH_OpModeLast = 0x7FFFFFFF } |
enum | CRYS_DH_HASH_OpMode_t { CRYS_DH_HASH_SHA1_mode = CRYS_HASH_SHA1_mode, CRYS_DH_HASH_SHA224_mode = CRYS_HASH_SHA224_mode, CRYS_DH_HASH_SHA256_mode = CRYS_HASH_SHA256_mode, CRYS_DH_HASH_SHA384_mode = CRYS_HASH_SHA384_mode, CRYS_DH_HASH_SHA512_mode = CRYS_HASH_SHA512_mode, CRYS_DH_HASH_MD5_mode = CRYS_HASH_MD5_mode, CRYS_DH_HASH_NumOfModes = CRYS_HASH_MD5_mode, CRYS_DH_HASH_OperationModeLast = 0x7FFFFFFF } |
enum | CRYS_DH_DerivationFunc_Mode { CRYS_DH_ASN1_Der_mode = CRYS_KDF_ASN1_DerivMode, CRYS_DH_Concat_Der_mode = CRYS_KDF_ConcatDerivMode, CRYS_DH_X963_DerMode = CRYS_KDF_ConcatDerivMode, CRYS_DH_DerivationFunc_ModeLast = 0x7FFFFFFF } |
Functions | |
CIMPORT_C CRYSError_t | _DX_DH_GeneratePubPrv (void *rndState_ptr, SaSiRndGenerateVectWorkFunc_t rndGenerateVectFunc, uint8_t *Generator_ptr, uint16_t GeneratorSize, uint8_t *Prime_ptr, uint16_t PrimeSize, uint16_t L, uint8_t *Q_ptr, uint16_t QSize, CRYS_DH_OpMode_t DH_mode, CRYS_DHUserPubKey_t *tmpPubKey_ptr, CRYS_DHPrimeData_t *tmpPrimeData_ptr, uint8_t *ClientPrvKey_ptr, uint16_t *ClientPrvKeySize_ptr, uint8_t *ClientPub1_ptr, uint16_t *ClientPubSize_ptr) |
This function has two purposes: | |
CIMPORT_C CRYSError_t | CRYS_DH_GetSecretKey (uint8_t *ClientPrvKey_ptr, uint16_t ClientPrvKeySize, uint8_t *ServerPubKey_ptr, uint16_t ServerPubKeySize, uint8_t *Prime_ptr, uint16_t PrimeSize, CRYS_DHUserPubKey_t *tmpPubKey_ptr, CRYS_DHPrimeData_t *tmpPrimeData_ptr, uint8_t *SecretKey_ptr, uint16_t *SecretKeySize_ptr) |
This function computes the shared secret key (value) accordng to [ANSI X9.42], 7.5.1: SecretKey = ServerPubKey ^ ClientPrvKey mod Prime. | |
CIMPORT_C CRYSError_t | CRYS_DH_X942_GetSecretData (uint8_t *ClientPrvKey_ptr, uint16_t ClientPrvKeySize, uint8_t *ServerPubKey_ptr, uint16_t ServerPubKeySize, uint8_t *Prime_ptr, uint16_t PrimeSize, CRYS_DH_OtherInfo_t *otherInfo_ptr, CRYS_DH_HASH_OpMode_t hashMode, CRYS_DH_DerivationFunc_Mode DerivFunc_mode, CRYS_DH_Temp_t *tmpBuff_ptr, uint8_t *SecretKeyingData_ptr, uint16_t SecretKeyingDataSize) |
This function extracts the shared secret keying data from the shared secret value. It should be called by using macros CRYS_DH_X942_GetSecretDataAsn1 and CRYS_DH_X942_GetSecretDataConcat. | |
CIMPORT_C CRYSError_t | CRYS_DH_X942_HybridGetSecretData (uint8_t *ClientPrvKey_ptr1, uint16_t ClientPrvKeySize1, uint8_t *ClientPrvKey_ptr2, uint16_t ClientPrvKeySize2, uint8_t *ServerPubKey_ptr1, uint16_t ServerPubKeySize1, uint8_t *ServerPubKey_ptr2, uint16_t ServerPubKeySize2, uint8_t *Prime_ptr, uint16_t PrimeSize, CRYS_DH_OtherInfo_t *otherInfo_ptr, CRYS_DH_HASH_OpMode_t hashMode, CRYS_DH_DerivationFunc_Mode DerivFunc_mode, CRYS_DH_HybrTemp_t *tmpDhHybr_ptr, uint8_t *SecretKeyingData_ptr, uint16_t SecretKeyingDataSize) |
The function computes shared secret data using two pairs of public and private keys: | |
CIMPORT_C CRYSError_t | CRYS_DH_CheckPubKey (uint8_t *modP_ptr, uint32_t modPsizeBytes, uint8_t *orderQ_ptr, uint32_t orderQsizeBytes, uint8_t *pubKey_ptr, uint32_t pubKeySizeBytes, CRYS_DH_Temp_t *tempBuff_ptr) |
The function checks the obtained DH public key according to its domain parameters [ANSI X9.42-2001]. |
Detailed Description
This module defines the API that supports Diffie-Hellman key exchange, as defined in [PKCS3] and in [X9.42] (key lengths 1024 and 2048 bits).
Definition in file crys_dh.h.
Generated on Tue Jul 12 2022 13:55:06 by
