Cryptographic Interface header file for declaring AES-CMAC methods.
More...
Go to the source code of this file.
|
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...
|
|
◆ CRYPTO_INTERFACE_AESCMAC_clear()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_clear |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx * |
pCtx | ) |
|
- Parameters
-
pCtx | A 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
-
pDest | Pointer to an already allocated destination context. |
pSrc | Pointer 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
-
cmac | The resulting CMAC. 16 bytes must be available. |
pCtx | A 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
-
cmac | The resulting CMAC. 16 bytes must be available. |
pCtx | A 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
-
cmac | The resulting CMAC. 16 bytes must be available. |
pCtx | A previously initialized and updated context. |
pExtCtx | An 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
-
pKeyMaterial | Key material to use for the cipher operation. |
keyLength | Length in bytes of the key material. This must be 16, 24, or 32. |
pCtx | A 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
-
pKeyMaterial | Key material to use for the cipher operation. |
keyLength | Length in bytes of the key material. This must be 16, 24, or 32. |
pCtx | A pointer to the context to be initialized. |
pExtCtx | An 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
-
pData | The message data or portion thereof that is being MAC'd. |
dataLength | The length of the pData buffer in bytes. |
pCtx | A 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
-
pData | The message data or portion thereof that is being MAC'd. |
dataLength | The length of the pData buffer in bytes. |
pCtx | A previously initialized context. |
pExtCtx | An extended context reserved for future use. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.