TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_aes_cmac.h
Go to the documentation of this file.
1 /*
2  * crypto_interface_aes_cmac.h
3  *
4  * Cryptographic Interface header file for declaring AES-CMAC methods
5  * for the Crypto Interface.
6  *
7  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
8  * Proprietary and Confidential Material.
9  *
10  */
11 
19 #ifndef __CRYPTO_INTERFACE_AES_CMAC_HEADER__
20 #define __CRYPTO_INTERFACE_AES_CMAC_HEADER__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
39 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_init(
40  MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial,
41  sbyte4 keyLength,
42  AESCMAC_Ctx *pCtx
43  );
44 
59 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_initExt(
60  MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial,
61  sbyte4 keyLength,
62  AESCMAC_Ctx *pCtx,
63  void *pExtCtx
64  );
65 
77 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_update(
78  MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pData,
79  sbyte4 dataLength,
80  AESCMAC_Ctx *pCtx
81  );
82 
95 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_updateExt(
96  MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pData,
97  sbyte4 dataLength,
98  AESCMAC_Ctx *pCtx,
99  void *pExtCtx
100  );
101 
112 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_final(
113  MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[16],
114  AESCMAC_Ctx *pCtx
115  );
116 
128 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalExt(
129  MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[CMAC_RESULT_SIZE],
130  AESCMAC_Ctx *pCtx,
131  void *pExtCtx
132  );
133 
142 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_clear(
143  MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx* pCtx
144  );
145 
157 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_cloneCtx (
158  MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *pDest,
159  AESCMAC_Ctx *pSrc
160  );
161 
174 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_finalAndReset(
175  MOC_SYM(hwAccelDescr hwAccelCtx) ubyte cmac[16],
176  AESCMAC_Ctx* pCtx
177  );
178 
179 #ifdef __cplusplus
180 }
181 #endif
182 
183 #endif /* __CRYPTO_INTERFACE_AES_CMAC_HEADER__ */
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.
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.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESCMAC_clear(MOC_SYM(hwAccelDescr hwAccelCtx) AESCMAC_Ctx *pCtx)
Frees the internal AES Context and zeros the outer context.
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.
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.
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.
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.
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.
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.