AESCCMXXF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2025, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
72 #ifndef ti_drivers_aesccm_AESCCMXXF3__include
73 #define ti_drivers_aesccm_AESCCMXXF3__include
74 
75 #include <stdbool.h>
76 #include <stdint.h>
77 
78 #include <ti/drivers/AESCCM.h>
80 
81 #include <ti/devices/DeviceFamily.h>
82 #if (DeviceFamily_PARENT != DeviceFamily_PARENT_CC35XX)
83  #include DeviceFamily_constructPath(driverlib/aes.h)
84 #endif
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
90 #define AESCCMXXF3_AAD_BUFFER_SIZE 2U
91 
99 
105 typedef struct
106 {
107  /* Common member first to allow struct to be cast to the common type */
109  const uint8_t *aad;
110  const uint8_t *input;
111  uint8_t *output;
112  const uint8_t *nonce;
113  uint8_t *mac;
114  volatile uint32_t intermediateCounter[AES_IV_LENGTH_BYTES / 4];
115  volatile uint32_t intermediateTag[AES_TAG_LENGTH_BYTES / 4];
118  size_t inputLength;
119  volatile size_t inputCBCMACLengthRemaining;
120  volatile size_t inputCTRLengthRemaining;
124  volatile size_t totalCBCMACLengthRemaining;
125  volatile size_t totalCTRLengthRemaining;
127  uint8_t bufferedAAD[AESCCMXXF3_AAD_BUFFER_SIZE];
129  uint8_t macLength;
130  uint8_t nonceLength;
131 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)
132  uint8_t KeyStore_keyingMaterial[AESCommonXXF3_256_KEY_LENGTH_BYTES];
133  uint8_t inputFinalBlock[AES_BLOCK_SIZE];
134  uint8_t aadFinalBlock[AES_BLOCK_SIZE];
135  uint8_t outputFinalBlock[AES_BLOCK_SIZE] __attribute__((aligned(4)));
136  size_t aadLength;
137  volatile size_t totalDataLengthRemaining;
138  volatile size_t totalAADLengthRemaining;
144  int_fast16_t hsmStatus;
145  uint32_t tempAssetID;
146  uint32_t keyAssetID;
147  /* Intentionally use implementation-independent uint32_t datatype for
148  * keyLocation to avoid user dependencies on any implementation-specific
149  * headers (e.g. mbedTLS). This data type must be large enough to hold any
150  * implementation-specific keyLocation data.
151  */
152  uint32_t keyLocation;
153  /* To indicate whether a segmented operation is in progress */
155 #endif
157 
158 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)
159 
182 int_fast16_t AESCCMXXF3HSM_setMac(AESCCM_Handle handle, const uint8_t *mac, size_t macLength);
183 #endif
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* ti_drivers_aesccm_AESCCMXXF3__include */
uint8_t macLength
Definition: AESCCMXXF3.h:129
size_t inputLength
Definition: AESCCMXXF3.h:118
bool segmentedOperationInProgress
Definition: AESCCMXXF3.h:154
uint32_t keyAssetID
Definition: AESCCMXXF3.h:146
uint8_t bufferedAADLength
Definition: AESCCMXXF3.h:128
#define AESCCMXXF3_AAD_BUFFER_SIZE
Definition: AESCCMXXF3.h:90
AESCCMXXF3 Object.
Definition: AESCCMXXF3.h:105
volatile size_t totalDataLengthRemaining
Definition: AESCCMXXF3.h:137
size_t aadBytesProcessed
Definition: AESCCMXXF3.h:123
AES Global configuration.
Definition: AESCommon.h:154
AESCommon driver implementation for the Low Power F3 family.
AESCCM_OperationUnion * operation
Definition: AESCCMXXF3.h:117
volatile size_t inputCTRLengthRemaining
Definition: AESCCMXXF3.h:120
AESCCM_OperationType operationType
Definition: AESCCMXXF3.h:126
#define AES_BLOCK_SIZE
Block size in number of bytes.
Definition: AESCommonXXF3.h:103
AESCommonXXF3_HWAttrs AESCCMXXF3_HWAttrs
AESCCMXXF3 Hardware Attributes.
Definition: AESCCMXXF3.h:98
#define AES_IV_LENGTH_BYTES
Definition: AESCommonXXF3.h:110
volatile size_t totalCBCMACLengthRemaining
Definition: AESCCMXXF3.h:124
AESCCM_CallbackFxn callbackFxn
Definition: AESCCMXXF3.h:116
uint32_t tempAssetID
Definition: AESCCMXXF3.h:145
uint8_t * mac
Definition: AESCCMXXF3.h:113
const uint8_t * nonce
Definition: AESCCMXXF3.h:112
#define AESCommonXXF3_256_KEY_LENGTH_BYTES
Definition: AESCommonXXF3.h:96
int_fast16_t AESCCMXXF3HSM_setMac(AESCCM_Handle handle, const uint8_t *mac, size_t macLength)
Function to set the mac for an AES CCM segmented operation. This API needs to be called only when the...
volatile size_t totalAADLengthRemaining
Definition: AESCCMXXF3.h:138
const uint8_t * input
Definition: AESCCMXXF3.h:110
AESCommonXXF3_Object common
Definition: AESCCMXXF3.h:108
size_t totalAADLength
Definition: AESCCMXXF3.h:121
uint32_t keyLocation
Definition: AESCCMXXF3.h:152
void(* AESCCM_CallbackFxn)(AESCCM_Handle handle, int_fast16_t returnValue, AESCCM_OperationUnion *operation, AESCCM_OperationType operationType)
The definition of a callback function used by the AESCCM driver when used in AESCCM_RETURN_BEHAVIOR_C...
Definition: AESCCM.h:1148
uint8_t nonceLength
Definition: AESCCMXXF3.h:130
size_t totalDataLength
Definition: AESCCMXXF3.h:122
const uint8_t * aad
Definition: AESCCMXXF3.h:109
Union containing a reference to a one step, segmented AAD, segmented data, or segmented finalize oper...
Definition: AESCCM.h:1106
int_fast16_t hsmStatus
The status of the HSM Boot up process if HSMXXF3_STATUS_SUCCESS, the HSM booted properly. if HSMXXF3_STATUS_ERROR, the HSM did not boot properly.
Definition: AESCCMXXF3.h:144
AESCommonXXF3 Object.
Definition: AESCommonXXF3.h:143
AESCCM_OperationType
Enum for the operation types supported by the driver.
Definition: AESCCM.h:1118
volatile size_t inputCBCMACLengthRemaining
Definition: AESCCMXXF3.h:119
AESCCM driver header.
uint8_t * output
Definition: AESCCMXXF3.h:111
volatile size_t totalCTRLengthRemaining
Definition: AESCCMXXF3.h:125
AESCommonXXF3 Hardware Attributes.
Definition: AESCommonXXF3.h:121
size_t aadLength
Definition: AESCCMXXF3.h:136
#define AES_TAG_LENGTH_BYTES
Definition: AESCommonXXF3.h:111
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale