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

Header file for declaring AES-XCBC functions. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS 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 AES_XCBC_MAC_96_final (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[AES_XCBC_MAC_96_RESULT_SIZE], 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 AES_XCBC_MAC_96_init (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte keyMaterial[AES_BLOCK_SIZE], AES_XCBC_MAC_96_Ctx *pCtx)
 Initializes an AES_XCBC_MAC_96_Ctx context. More...
 
MOC_EXTERN MSTATUS AES_XCBC_MAC_96_reset (MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_MAC_96_Ctx *pCtx)
 Resets an AES_XCBC_MAC_96_Ctx context. More...
 
MOC_EXTERN MSTATUS AES_XCBC_MAC_96_update (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *data, sbyte4 dataLength, AES_XCBC_MAC_96_Ctx *pCtx)
 Updates the state of an AES_XCBC_MAC_96_Ctx context with data. More...
 
MOC_EXTERN MSTATUS AES_XCBC_PRF_128_final (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[AES_XCBC_PRF_128_RESULT_SIZE], 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 AES_XCBC_PRF_128_init (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte keyMaterial[], sbyte4 keyLength, AES_XCBC_PRF_128_Ctx *pCtx)
 Initializes an AES_XCBC_PRF_128_Ctx context. More...
 
MOC_EXTERN MSTATUS AES_XCBC_PRF_128_reset (MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_PRF_128_Ctx *pCtx)
 Resets an AES_XCBC_PRF_128_Ctx context. More...
 
MOC_EXTERN MSTATUS AES_XCBC_PRF_128_update (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *data, sbyte4 dataLength, AES_XCBC_PRF_128_Ctx *pCtx)
 Updates the state of an AES_XCBC_PRF_128_Ctx context with data. More...
 

Detailed Description

Header file for declaring AES-XCBC functions.

aes_xcbc_mac_96.h

Function Documentation

◆ AES_XCBC_clear()

MOC_EXTERN MSTATUS 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. 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.

◆ AES_XCBC_MAC_96_final()

MOC_EXTERN MSTATUS AES_XCBC_MAC_96_final ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  cmac[AES_XCBC_MAC_96_RESULT_SIZE],
AES_XCBC_MAC_96_Ctx *  pCtx 
)

Finalizes an AES_XCBC_MAC_96_Ctx and outputs the resulting 96 bit (12 byte) MAC.

Parameters
cmacBuffer 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.

◆ AES_XCBC_MAC_96_init()

MOC_EXTERN MSTATUS AES_XCBC_MAC_96_init ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte  keyMaterial[AES_BLOCK_SIZE],
AES_XCBC_MAC_96_Ctx *  pCtx 
)

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

Parameters
keyMaterialKey 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.

◆ AES_XCBC_MAC_96_reset()

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

Resets an AES_XCBC_MAC_96_Ctx context. The internal buffer is cleared but the AES context and key are not cleared.

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

◆ AES_XCBC_MAC_96_update()

MOC_EXTERN MSTATUS AES_XCBC_MAC_96_update ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  data,
sbyte4  dataLength,
AES_XCBC_MAC_96_Ctx *  pCtx 
)

Updates the state of an AES_XCBC_MAC_96_Ctx context with data.

Parameters
dataThe 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.

◆ AES_XCBC_PRF_128_final()

MOC_EXTERN MSTATUS AES_XCBC_PRF_128_final ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte  cmac[AES_XCBC_PRF_128_RESULT_SIZE],
AES_XCBC_PRF_128_Ctx *  pCtx 
)

Finalizes an AES_XCBC_PRF_128_Ctx and outputs the resulting 128 bit (16 byte) MAC.

Parameters
cmacBuffer 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.

◆ AES_XCBC_PRF_128_init()

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

Initializes an AES_XCBC_PRF_128_Ctx context. Note it is the callers responsibility to clear this object after use by calling AES_XCBC_clear.

Parameters
keyMaterialKey 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.

◆ AES_XCBC_PRF_128_reset()

MOC_EXTERN MSTATUS AES_XCBC_PRF_128_reset ( MOC_SYM(hwAccelDescr hwAccelCtx) AES_XCBC_PRF_128_Ctx *  pCtx)

Resets an AES_XCBC_PRF_128_Ctx context. The internal buffer is cleared but the AES context and key are not cleared. This method is a macro which is expanded to AES_XCBC_MAC_96_reset.

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

◆ AES_XCBC_PRF_128_update()

MOC_EXTERN MSTATUS AES_XCBC_PRF_128_update ( MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *  data,
sbyte4  dataLength,
AES_XCBC_PRF_128_Ctx *  pCtx 
)

Updates the state of an AES_XCBC_PRF_128_Ctx context with data. This method is a macro which is expanded to AES_XCBC_MAC_96_update.

Parameters
dataThe 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.