TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_aes_cmac.h File Reference

Cryptographic Interface header file for declaring AES-CMAC methods. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_clear (MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *pCtx)
 Frees the internal AES Context and zeros the outer context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_cloneCtx (MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *pDest, AESCMAC_Ctx *pSrc)
 Makes a clone of a previously allocated AESCMAC_Ctx. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_final (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[16], AESCMAC_Ctx *pCtx)
 Finalizes a context and outputs the resulting CMAC. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalAndReset (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[16], AESCMAC_Ctx *pCtx)
 Finalizes a context and outputs the resulting CMAC. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalExt (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[CMAC_RESULT_SIZE], AESCMAC_Ctx *pCtx, void *pExtCtx)
 Finalizes a context and outputs the resulting CMAC. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_init (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial, sbyte4 keyLength, AESCMAC_Ctx *pCtx)
 Creates and initializes a new AESCMAC_Ctx context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_initExt (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial, sbyte4 keyLength, AESCMAC_Ctx *pCtx, void *pExtCtx)
 Creates and initializes a new AESCMAC_Ctx context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_update (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pData, sbyte4 dataLength, AESCMAC_Ctx *pCtx)
 Updates a previously initialized context with the data or portion thereof. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_updateExt (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pData, sbyte4 dataLength, AESCMAC_Ctx *pCtx, void *pExtCtx)
 Updates a previously initialized context with the data or portion thereof. More...
 

Detailed Description

Add details here.

crypto_interface_aes_cmac.h

Function Documentation

◆ CRYPTO_INTERFACE_AESCMAC_clear()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_clear ( MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *  pCtx)
Parameters
pCtxA previously used context that is no longer needed.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_cloneCtx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_cloneCtx ( MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *  pDest,
AESCMAC_Ctx *  pSrc 
)

Makes a clone of a previously allocated AESCMAC_Ctx.

Parameters
pDestPointer to an already allocated destination context.
pSrcPointer to the context to be copied.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_final()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_final ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  cmac[16],
AESCMAC_Ctx *  pCtx 
)

This will also free any memory allocated upon initialization.

Parameters
cmacThe resulting CMAC. 16 bytes must be available.
pCtxA previously initialized and updated context.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_finalAndReset()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalAndReset ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  cmac[16],
AESCMAC_Ctx *  pCtx 
)

This does not clear or free the aes-key however leaving the context ok to be re-used. Please be sure tall call CRYPTO_INTERFACE_AESCMAC_final when done to free the memory.

Parameters
cmacThe resulting CMAC. 16 bytes must be available.
pCtxA previously initialized and updated context.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_finalExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalExt ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  cmac[CMAC_RESULT_SIZE],
AESCMAC_Ctx *  pCtx,
void *  pExtCtx 
)

This will also free any memory allocated upon initialization.

Parameters
cmacThe resulting CMAC. 16 bytes must be available.
pCtxA previously initialized and updated context.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_init()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_init ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  pKeyMaterial,
sbyte4  keyLength,
AESCMAC_Ctx *  pCtx 
)

Note it is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_AESCMAC_final.

Parameters
pKeyMaterialKey material to use for the cipher operation.
keyLengthLength in bytes of the key material. This must be 16, 24, or 32.
pCtxA pointer to the context to be initialized.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_initExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_initExt ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  pKeyMaterial,
sbyte4  keyLength,
AESCMAC_Ctx *  pCtx,
void *  pExtCtx 
)

Note it is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_AESCMAC_final.

Parameters
pKeyMaterialKey material to use for the cipher operation.
keyLengthLength in bytes of the key material. This must be 16, 24, or 32.
pCtxA pointer to the context to be initialized.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_update()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_update ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  pData,
sbyte4  dataLength,
AESCMAC_Ctx *  pCtx 
)

CRYPTO_INTERFACE_AESCMAC_update may be called as many times as necessary.

Parameters
pDataThe message data or portion thereof that is being MAC'd.
dataLengthThe length of the pData buffer in bytes.
pCtxA previously initialized context.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AESCMAC_updateExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_updateExt ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  pData,
sbyte4  dataLength,
AESCMAC_Ctx *  pCtx,
void *  pExtCtx 
)

CRYPTO_INTERFACE_AESCMAC_update may be called as many times as necessary.

Parameters
pDataThe message data or portion thereof that is being MAC'd.
dataLengthThe length of the pData buffer in bytes.
pCtxA previously initialized context.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.