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

Cryptographic Interface header file for declaring AES-XCBC functions. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_clear (MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_MAC_96_Ctx *pCtx)
 Clears a AES_XCBC_MAC_96_Ctx or AES_XCBC_PRF_128_Ctx context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_final (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte pCmac[12], AES_XCBC_MAC_96_Ctx *pCtx)
 Finalizes an AES_XCBC_MAC_96_Ctx and outputs the resulting 96 bit (12 byte) MAC. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_init (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte pKeyMaterial[16], AES_XCBC_MAC_96_Ctx *pCtx)
 Initializes an AES_XCBC_MAC_96_Ctx context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_reset (MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_MAC_96_Ctx *pCtx)
 Resets an AES_XCBC_MAC_96_Ctx or AES_XCBC_PRF_128_Ctx context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_update (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pData, sbyte4 dataLength, AES_XCBC_MAC_96_Ctx *pCtx)
 Updates the state of an AES_XCBC_MAC_96_Ctx or AES_XCBC_PRF_128_Ctx context with data. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_PRF_128_final (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte pCmac[16], AES_XCBC_PRF_128_Ctx *pCtx)
 Finalizes an AES_XCBC_PRF_128_Ctx and outputs the resulting 128 bit (16 byte) MAC. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_PRF_128_init (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte pKeyMaterial[], sbyte4 keyLength, AES_XCBC_PRF_128_Ctx *pCtx)
 Initializes an AES_XCBC_PRF_128_Ctx context. More...
 

Detailed Description

Function Documentation

◆ CRYPTO_INTERFACE_AES_XCBC_clear()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_clear ( MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_MAC_96_Ctx *  pCtx)

This does free internally allocated AES contexts.

Parameters
pCtxPointer to the context to be cleared.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_MAC_96_final()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_final ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  pCmac[12],
AES_XCBC_MAC_96_Ctx *  pCtx 
)
Parameters
pCmacBuffer that will hold the resulting MAC. It must be at least 12 bytes in length.
pCtxThe already initialized and updated context to be finalized.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_MAC_96_init()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_init ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte  pKeyMaterial[16],
AES_XCBC_MAC_96_Ctx *  pCtx 
)

Note this includes allocations of internal AES contexts. Note it is the callers responsibility to clear this object, and free its internals, by calling CRYPTO_INTERFACE_AES_XCBC_clear.

Parameters
pKeyMaterialKey material to be used for the mac operation. This must be 16 bytes.
pCtxPointer to the context to be initialized.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_MAC_96_reset()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_reset ( MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_MAC_96_Ctx *  pCtx)

Note: This method is shared between AES_XCBC_MAC_96 and AES_XCBC_PRF_128. Call this method to perform the AES_XCBC_PRF_128_reset operation.

Parameters
pCtxPointer to the context to be reset.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_MAC_96_update()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_MAC_96_update ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  pData,
sbyte4  dataLength,
AES_XCBC_MAC_96_Ctx *  pCtx 
)

Note: This method is shared between AES_XCBC_MAC_96 and AES_XCBC_PRF_128. Call this method to perform the AES_XCBC_PRF_128_update operation.

Parameters
pDataThe buffer of input data.
dataLengthThe length of pData in bytes.
pCtxThe already initialized context to be updated.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_PRF_128_final()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_PRF_128_final ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  pCmac[16],
AES_XCBC_PRF_128_Ctx *  pCtx 
)
Parameters
pCmacBuffer that will hold the resulting MAC. It must be at least 16 bytes in length.
pCtxThe already initialized and updated context to be finalized.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_AES_XCBC_PRF_128_init()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AES_XCBC_PRF_128_init ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte  pKeyMaterial[],
sbyte4  keyLength,
AES_XCBC_PRF_128_Ctx *  pCtx 
)

Note it is the callers responsibility to clear this object after use by calling CRYPTO_INTERFACE_AES_XCBC_clear.

Parameters
pKeyMaterialKey material to be used for the mac operation.
keyLengthThe length of the buffer pKeyMaterial in bytes. This may be any size.
pCtxPointer to the context to be initialized.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.