Cryptographic Interface header file for declaring HMAC-KDF functions.
More...
Go to the source code of this file.
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_HmacKdfExpand (MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo *pDigest, ubyte *pPseudoRandomKey, ubyte4 pseudoRandomKeyLen, ubyte *pContext, ubyte4 contextLen, ubyte *pIv, ubyte4 ivLen, ubyte *pOutput, ubyte4 keyLength) |
| Perform the expand operation for Hmac KDF. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_HmacKdfExpandExt (MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo *pDigest, ubyte *pPseudoRandomKey, ubyte4 pseudoRandomKeyLen, ubyte *pContext, ubyte4 contextLen, ubyte *pIv, ubyte4 ivLen, ubyte *pOutput, ubyte4 keyLength, void *pExtCtx) |
| Perform the expand operation for Hmac KDF. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_HmacKdfExtract (MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo *pDigest, ubyte *pSalt, ubyte4 saltLen, ubyte *pInputKeyMaterial, ubyte4 inputKeyMaterialLen, ubyte *pOutput, ubyte4 outputLen) |
| Perform the extract operation for Hmac KDF. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_HmacKdfExtractExt (MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo *pDigest, ubyte *pSalt, ubyte4 saltLen, ubyte *pInputKeyMaterial, ubyte4 inputKeyMaterialLen, ubyte *pOutput, ubyte4 outputLen, void *pExtCtx) |
| Perform the extract operation for Hmac KDF. More...
|
|
◆ CRYPTO_INTERFACE_HmacKdfExpand()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_HmacKdfExpand |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo * |
pDigest, |
|
|
ubyte * |
pPseudoRandomKey, |
|
|
ubyte4 |
pseudoRandomKeyLen, |
|
|
ubyte * |
pContext, |
|
|
ubyte4 |
contextLen, |
|
|
ubyte * |
pIv, |
|
|
ubyte4 |
ivLen, |
|
|
ubyte * |
pOutput, |
|
|
ubyte4 |
keyLength |
|
) |
| |
This function will take in the psuedo random key generated from the extract step and generate key material bits. There is an optional context which can be passed in.
- Parameters
-
pDigest | The digest suite used for the Hmac operations. |
pPseudoRandomKey | This is the psuedo random key of at least digest length bytes. This is usually the pseudo random key from the extract step. |
pseudoRandomKeyLen | The length of the psuedo random key. Must be at least digest length in bytes. |
pContext | Optional context information specific to the application. |
contextLen | The length of the context in bytes. |
pIV | The 'initial value' byte array. Can be NULL when 'ivLen' is zero (0). |
ivLen | The length of the 'initial vector' in bytes. Is allowed to be zero. |
pOutput | The output buffer where the keying material will be deposited. |
keyLength | This parameter it the amount of key material bytes that the caller is requesting. It cannot exceed 255 multiplied by the digest size. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_HmacKdfExpandExt()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_HmacKdfExpandExt |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo * |
pDigest, |
|
|
ubyte * |
pPseudoRandomKey, |
|
|
ubyte4 |
pseudoRandomKeyLen, |
|
|
ubyte * |
pContext, |
|
|
ubyte4 |
contextLen, |
|
|
ubyte * |
pIv, |
|
|
ubyte4 |
ivLen, |
|
|
ubyte * |
pOutput, |
|
|
ubyte4 |
keyLength, |
|
|
void * |
pExtCtx |
|
) |
| |
This function will take in the psuedo random key generated from the extract step and generate key material bits. There is an optional context which can be passed in.
- Parameters
-
pDigest | The digest suite used for the Hmac operations. |
pPseudoRandomKey | This is the psuedo random key of at least digest length bytes. This is usually the pseudo random key from the extract step. |
pseudoRandomKeyLen | The length of the psuedo random key. Must be at least digest length in bytes. |
pContext | Optional context information specific to the application. |
contextLen | The length of the context in bytes. |
pIV | The 'initial value' byte array. Can be NULL when 'ivLen' is zero (0). |
ivLen | The length of the 'initial vector' in bytes. Is allowed to be zero. |
pOutput | The output buffer where the keying material will be deposited. |
keyLength | The size of the output buffer. Must have at least keyLength bytes. |
pExtCtx | An extended context reserved for future use. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_HmacKdfExtract()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_HmacKdfExtract |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo * |
pDigest, |
|
|
ubyte * |
pSalt, |
|
|
ubyte4 |
saltLen, |
|
|
ubyte * |
pInputKeyMaterial, |
|
|
ubyte4 |
inputKeyMaterialLen, |
|
|
ubyte * |
pOutput, |
|
|
ubyte4 |
outputLen |
|
) |
| |
This function will take in the input key material as well as an optional salt value and generate a pseudo random key bits. Note that the output of the psuedo random key will be the size of the digest output of the digest functions provided as input.
IMPORTANT: Do not use the output of the extract function as actual key material. The output material should be passed into the Hmac KDF expand method.
- Parameters
-
pDigest | The digest suite used for the Hmac operations. |
pSalt | Optional salt value. Providing a salt value is recommended. The salt value should ideally be a random or pseudorandom value of digest length. |
saltLen | The length of the salt buffer. |
pInputKeyMaterial | The input keying material. This is keying material which may be non-uniformly distributed, and the caller wants to create a "stronger" or more evenly dispersed key. The key material can be any length. |
inputKeyMaterialLen | The length of the key material which can be any length. |
pOutput | The output buffer. This is where the pseudo random key will be placed. Note that the key should not be used as actual key material. The key will be digest length in size (Based on the digest suite passed in by the caller). |
outputLen | The size of the output buffer. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_HmacKdfExtractExt()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_HmacKdfExtractExt |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) const BulkHashAlgo * |
pDigest, |
|
|
ubyte * |
pSalt, |
|
|
ubyte4 |
saltLen, |
|
|
ubyte * |
pInputKeyMaterial, |
|
|
ubyte4 |
inputKeyMaterialLen, |
|
|
ubyte * |
pOutput, |
|
|
ubyte4 |
outputLen, |
|
|
void * |
pExtCtx |
|
) |
| |
This function will take in the input key material as well as an optional salt value and generate a pseudo random key bits. Note that the output of the psuedo random key will be the size of the digest output of the digest functions provided as input.
IMPORTANT: Do not use the output of the extract function as actual key material. The output material should be passed into the Hmac KDF expand method.
- Parameters
-
pDigest | The digest suite used for the Hmac operations. |
pSalt | Optional salt value. Providing a salt value is recommended. The salt value should ideally be a random or pseudorandom value of digest length. |
saltLen | The length of the salt buffer. |
pInputKeyMaterial | The input keying material. This is keying material which may be non-uniformly distributed, and the caller wants to create a "stronger" or more evenly dispersed key. The key material can be any length. |
inputKeyMaterialLen | The length of the key material which can be any length. |
pOutput | The output buffer. This is where the pseudo random key will be placed. Note that the key should not be used as actual key material. The key will be digest length in size (Based on the digest suite passed in by the caller). |
outputLen | The size of the output buffer. |
pExtCtx | An extended context reserved for future use. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.