29 #ifndef __AES_EAX_HEADER__ 30 #define __AES_EAX_HEADER__ 32 #include "../cap/capdecl.h" 34 #ifdef __ENABLE_MOCANA_CRYPTO_INTERFACE__ 35 #include "../crypto_interface/crypto_interface_aes_eax_priv.h" 43 typedef struct AES_EAX_Ctx
45 AES_CTR_Ctx *pAesCTRCtx;
46 AES_OMAC_Ctx headerOMAC;
47 AES_OMAC_Ctx cipherOMAC;
48 ubyte N[AES_BLOCK_SIZE];
74 MOC_EXTERN MSTATUS
AES_EAX_init(MOC_SYM(hwAccelDescr hwAccelCtx)
const ubyte* keyMaterial,
95 MOC_EXTERN MSTATUS
AES_EAX_updateHeader(MOC_SYM(hwAccelDescr hwAccelCtx)
const ubyte* headerData,
114 sbyte4 msgLen, AES_EAX_Ctx* pCtx);
135 sbyte4 msgLen, AES_EAX_Ctx* pCtx);
157 MOC_EXTERN MSTATUS
AES_EAX_final(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte tag[],
158 sbyte4 tagLen, AES_EAX_Ctx* pCtx);
183 const ubyte* cipherText, sbyte4 cipherLen,
184 const ubyte* header, sbyte4 headerLen,
185 ubyte tag[], sbyte4 tagLen,
208 ubyte* cipherText, sbyte4 cipherLen,
223 MOC_EXTERN MSTATUS
AES_EAX_clear(MOC_SYM(hwAccelDescr hwAccelCtx) AES_EAX_Ctx* pCtx);
MOC_EXTERN MSTATUS AES_EAX_final(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte tag[], sbyte4 tagLen, AES_EAX_Ctx *pCtx)
Finalizes an AES-EAX encryption or decryption and outputs the tag for authentication.
MOC_EXTERN MSTATUS AES_EAX_encryptMessage(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *msgData, sbyte4 msgLen, AES_EAX_Ctx *pCtx)
Encrypts in-place a buffer of data with an initialized AES-EAX context.
MOC_EXTERN MSTATUS AES_EAX_generateTag(MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *cipherText, sbyte4 cipherLen, const ubyte *header, sbyte4 headerLen, ubyte tag[], sbyte4 tagLen, AES_EAX_Ctx *pCtx)
Generates an AES-EAX tag from the ciphertext and header.
MOC_EXTERN MSTATUS AES_EAX_getPlainText(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *cipherText, sbyte4 cipherLen, AES_EAX_Ctx *pCtx)
Decrypts ciphertext in-place from an initialized AES-EAX context.
MOC_EXTERN MSTATUS AES_EAX_decryptMessage(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *msgData, sbyte4 msgLen, AES_EAX_Ctx *pCtx)
Decrypts in-place a buffer of data with an initialized AES-EAX context.
MOC_EXTERN MSTATUS AES_EAX_clear(MOC_SYM(hwAccelDescr hwAccelCtx) AES_EAX_Ctx *pCtx)
Zeros and frees memory allocated within an AES-EAX context.
MOC_EXTERN MSTATUS AES_EAX_init(MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *keyMaterial, ubyte4 keyLength, const ubyte *nonce, ubyte4 nonceLength, AES_EAX_Ctx *pCtx)
Initializes an AES-EAX context with a key and nonce value.
MOC_EXTERN MSTATUS AES_EAX_updateHeader(MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *headerData, sbyte4 dataLength, AES_EAX_Ctx *pCtx)
Updates the header portion of an AES-EAX context with a buffer of data.