TrustCore SDK NanoCrypto API reference  version 7.0
aes_ccm.h
Go to the documentation of this file.
1 /*
2  * aes_ccm.h
3  *
4  * AES-CCM Implementation
5  *
6  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
7  * Proprietary and Confidential Material.
8  *
9  */
19 /*------------------------------------------------------------------*/
20 
21 #ifndef __AES_CCM_HEADER__
22 #define __AES_CCM_HEADER__
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
29 /*------------------------------------------------------------------*/
30 
31 /* Function prototypes */
32 /* AES Counter with CBC-MAC (CCM) -- cf RFC 3610 for explanations of parameters. encryption is in place */
33 
132 MOC_EXTERN MSTATUS AESCCM_encrypt(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte M, ubyte L, ubyte* keyMaterial, sbyte4 keyLength,
133  const ubyte* nonce, ubyte* encData, ubyte4 eDataLength,
134  const ubyte* authData, ubyte4 aDataLength, ubyte U[/*M*/]);
135 
191 MOC_EXTERN MSTATUS AESCCM_decrypt(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte M, ubyte L, ubyte* keyMaterial, sbyte4 keyLength,
192  const ubyte* nonce, ubyte* encData, ubyte4 eDataLength,
193  const ubyte* authData, ubyte4 aDataLength, const ubyte U[/*M*/]);
194 
215 MOC_EXTERN BulkCtx AESCCM_createCtx(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte* key, sbyte4 keylen, sbyte4 encrypt);
216 
236 MOC_EXTERN MSTATUS AESCCM_deleteCtx(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx);
237 
261 MOC_EXTERN MSTATUS AESCCM_cipher(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte* nonce, ubyte4 nlen, ubyte* aData, ubyte4 aDataLength, ubyte* data, ubyte4 dataLength, ubyte4 verifyLen, sbyte4 encrypt);
262 
277 MOC_EXTERN MSTATUS AESCCM_clone(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx);
278 
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif /* __AES_CCM_HEADER__ */
284 
MOC_EXTERN MSTATUS AESCCM_encrypt(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte M, ubyte L, ubyte *keyMaterial, sbyte4 keyLength, const ubyte *nonce, ubyte *encData, ubyte4 eDataLength, const ubyte *authData, ubyte4 aDataLength, ubyte U[])
Encrypt and protect a data buffer using AES-CCM, as defined in RFC 3610.
MOC_EXTERN MSTATUS AESCCM_deleteCtx(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx)
Delete an AES-CCM context created with AESCCM_createCtx.
MOC_EXTERN BulkCtx AESCCM_createCtx(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *key, sbyte4 keylen, sbyte4 encrypt)
Create a new AES-CCM context for use in AESCCM_cipher.
MOC_EXTERN MSTATUS AESCCM_clone(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx)
Clone an AES-CCM context.
MOC_EXTERN MSTATUS AESCCM_cipher(MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *aData, ubyte4 aDataLength, ubyte *data, ubyte4 dataLength, ubyte4 verifyLen, sbyte4 encrypt)
Encyrpt or decrypt data using AES in CCM mode.
MOC_EXTERN MSTATUS AESCCM_decrypt(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte M, ubyte L, ubyte *keyMaterial, sbyte4 keyLength, const ubyte *nonce, ubyte *encData, ubyte4 eDataLength, const ubyte *authData, ubyte4 aDataLength, const ubyte U[])
Decrypt and authenticate a data buffer using AES-CCM.