TrustCore SDK NanoCrypto API reference  version 7.0
nist_kdf.h File Reference

Header file for the NanoCrypto NIST-KDF APIs. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS KDF_NIST_CounterMode (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4 counterSize, void *prfContext, const PRF_NIST_108 *prfAlgo, const ubyte *label, ubyte4 labelSize, const ubyte *context, ubyte4 contextSize, ubyte4 keyMaterialEncodingSize, ubyte4 littleEndian, ubyte *keyMaterial, ubyte4 keyMaterialSize)
 Performs the NIST key derivation function in Counter Mode. More...
 
MOC_EXTERN MSTATUS KDF_NIST_DoublePipelineMode (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4 counterSize, void *prfContext, const PRF_NIST_108 *prfAlgo, const ubyte *label, ubyte4 labelSize, const ubyte *context, ubyte4 contextSize, ubyte4 keyMaterialEncodingSize, ubyte4 littleEndian, ubyte *keyMaterial, ubyte4 keyMaterialSize)
 Performs the NIST key derivation function in Double Pipeline Mode. More...
 
MOC_EXTERN MSTATUS KDF_NIST_FeedbackMode (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4 counterSize, void *prfContext, const PRF_NIST_108 *prfAlgo, const ubyte *iv, ubyte4 ivSize, const ubyte *label, ubyte4 labelSize, const ubyte *context, ubyte4 contextSize, ubyte4 keyMaterialEncodingSize, ubyte4 littleEndian, ubyte *keyMaterial, ubyte4 keyMaterialSize)
 Performs the NIST key derivation function in Feedback Mode. More...
 

Detailed Description

This file contains the NanoCrypto NIST-KDF API methods.

nist_kdf.h

Function Documentation

◆ KDF_NIST_CounterMode()

MOC_EXTERN MSTATUS KDF_NIST_CounterMode ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4  counterSize,
void *  prfContext,
const PRF_NIST_108 prfAlgo,
const ubyte *  label,
ubyte4  labelSize,
const ubyte *  context,
ubyte4  contextSize,
ubyte4  keyMaterialEncodingSize,
ubyte4  littleEndian,
ubyte *  keyMaterial,
ubyte4  keyMaterialSize 
)

Performs the NIST key derivation function in Counter Mode.

Parameters
counterSizeThe number of bytes used to encode the counter. This must be 1 to 4.
prfContextPointer to the pseudo random function (PRF) context used by your prfAlgo.
prfAlgoThe PRF algorithm suite you wish to use. Please see the structure definition and function pointer types in nist_prf.h.
labelOptional. Buffer holding the label as a byte array.
labelSizeThe length of the label in bytes.
contextOptional. Buffer holding the context as a byte array.
contextSizeThe length of the context in bytes.
keyMaterialEncodingSizeThe number of bytes used to encode the requested key material size.
littleEndianTRUE (1) if the counter and key material size parameters are to be encoded Little Endian. FALSE (0) if otherwise.
keyMaterialBuffer that will hold the resulting key material.
keyMaterialSizeThe length of the key material requested in bytes.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.

nist_kdf.h

◆ KDF_NIST_DoublePipelineMode()

MOC_EXTERN MSTATUS KDF_NIST_DoublePipelineMode ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4  counterSize,
void *  prfContext,
const PRF_NIST_108 prfAlgo,
const ubyte *  label,
ubyte4  labelSize,
const ubyte *  context,
ubyte4  contextSize,
ubyte4  keyMaterialEncodingSize,
ubyte4  littleEndian,
ubyte *  keyMaterial,
ubyte4  keyMaterialSize 
)

Performs the NIST key derivation function in Double Pipeline Mode.

Parameters
counterSizeThe number of bytes used to encode the optional counter. Enter 0 for no counter and 1 to 4 otherwise.
prfContextPointer to the pseudo random function (PRF) context used by your prfAlgo.
prfAlgoThe PRF algorithm suite you wish to use. Please see the structure definition and function pointer types in nist_prf.h.
labelOptional. Buffer holding the label as a byte array.
labelSizeThe length of the label in bytes.
contextOptional. Buffer holding the context as a byte array.
contextSizeThe length of the context in bytes.
keyMaterialEncodingSizeThe number of bytes used to encode the requested key material size.
littleEndianTRUE (1) if the counter and key material size parameters are to be encoded Little Endian. FALSE (0) if otherwise.
keyMaterialBuffer that will hold the resulting key material.
keyMaterialSizeThe length of the key material requested in bytes.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.

nist_kdf.h

◆ KDF_NIST_FeedbackMode()

MOC_EXTERN MSTATUS KDF_NIST_FeedbackMode ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte4  counterSize,
void *  prfContext,
const PRF_NIST_108 prfAlgo,
const ubyte *  iv,
ubyte4  ivSize,
const ubyte *  label,
ubyte4  labelSize,
const ubyte *  context,
ubyte4  contextSize,
ubyte4  keyMaterialEncodingSize,
ubyte4  littleEndian,
ubyte *  keyMaterial,
ubyte4  keyMaterialSize 
)

Performs the NIST key derivation function in Feedback Mode.

Parameters
counterSizeThe number of bytes used to encode the optional counter. Enter 0 for no counter and 1 to 4 otherwise.
prfContextPointer to the pseudo random function (PRF) context used by your prfAlgo.
prfAlgoThe PRF algorithm suite you wish to use. Please see the structure definition and function pointer types in nist_prf.h.
ivOptional. Buffer holding the initialization vector as a byte array.
ivSizeThe length of the iv in bytes.
labelBOptional. uffer holding the label as a byte array.
labelSizeThe length of the label in bytes.
contextOptional. Buffer holding the context as a byte array.
contextSizeThe length of the context in bytes.
keyMaterialEncodingSizeThe number of bytes used to encode the requested key material size.
littleEndianTRUE (1) if the counter and key material size parameters are to be encoded Little Endian. FALSE (0) if otherwise.
keyMaterialBuffer that will hold the resulting key material.
keyMaterialSizeThe length of the key material requested in bytes.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.

nist_kdf.h