AESCCMLPF3.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_AESCCMLPF3__include
73 #define ti_drivers_aesccm_AESCCMLPF3__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 AESCCMLPF3_AAD_BUFFER_SIZE 2U
91 
92 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)
94 #endif
95 
103 
109 typedef struct
110 {
111  /* Common member first to allow struct to be cast to the common type */
113  const uint8_t *aad;
114  const uint8_t *input;
115  uint8_t *output;
116  const uint8_t *nonce;
117  uint8_t *mac;
118  volatile uint32_t intermediateCounter[AES_IV_LENGTH_BYTES / 4];
119  volatile uint32_t intermediateTag[AES_TAG_LENGTH_BYTES / 4];
122  size_t inputLength;
123  volatile size_t inputCBCMACLengthRemaining;
124  volatile size_t inputCTRLengthRemaining;
128  volatile size_t totalCBCMACLengthRemaining;
129  volatile size_t totalCTRLengthRemaining;
131  uint8_t bufferedAAD[AESCCMLPF3_AAD_BUFFER_SIZE];
133  uint8_t macLength;
134  uint8_t nonceLength;
135 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)
136  uint8_t KeyStore_keyingMaterial[AESCommonLPF3_256_KEY_LENGTH_BYTES];
137  uint8_t inputFinalBlock[AES_BLOCK_SIZE];
138  uint8_t aadFinalBlock[AES_BLOCK_SIZE];
139  uint8_t outputFinalBlock[AES_BLOCK_SIZE] __attribute__((aligned(4)));
140  size_t aadLength;
141  volatile size_t totalDataLengthRemaining;
142  volatile size_t totalAADLengthRemaining;
148  int_fast16_t hsmStatus;
149  uint32_t tempAssetID;
150  uint32_t keyAssetID;
152  /* To indicate whether a segmented operation is in progress
153  */
155 #endif
157 
158 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX)
159 
182 int_fast16_t AESCCMLPF3HSM_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_AESCCMLPF3__include */
AESCommonLPF3_HWAttrs AESCCMLPF3_HWAttrs
AESCCMLPF3 Hardware Attributes.
Definition: AESCCMLPF3.h:102
const uint8_t * input
Definition: AESCCMLPF3.h:114
AESCommonLPF3_Object common
Definition: AESCCMLPF3.h:112
#define AESCCMLPF3_AAD_BUFFER_SIZE
Definition: AESCCMLPF3.h:90
int_fast16_t AESCCMLPF3HSM_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...
#define AES_BLOCK_SIZE
Block size in number of bytes.
Definition: AESCommonLPF3.h:85
volatile size_t totalCTRLengthRemaining
Definition: AESCCMLPF3.h:129
CryptoKeyKeyStore_PSA driver header.
AESCCM_CallbackFxn callbackFxn
Definition: AESCCMLPF3.h:120
AES Global configuration.
Definition: AESCommon.h:154
AESCCM_OperationUnion * operation
Definition: AESCCMLPF3.h:121
#define AES_IV_LENGTH_BYTES
Definition: AESCommonLPF3.h:92
size_t totalDataLength
Definition: AESCCMLPF3.h:126
volatile size_t totalAADLengthRemaining
Definition: AESCCMLPF3.h:142
const uint8_t * nonce
Definition: AESCCMLPF3.h:116
#define AESCommonLPF3_256_KEY_LENGTH_BYTES
Definition: AESCommonLPF3.h:78
#define AES_TAG_LENGTH_BYTES
Definition: AESCommonLPF3.h:93
size_t aadLength
Definition: AESCCMLPF3.h:140
AESCCMLPF3 Object.
Definition: AESCCMLPF3.h:109
size_t totalAADLength
Definition: AESCCMLPF3.h:125
size_t inputLength
Definition: AESCCMLPF3.h:122
uint8_t * output
Definition: AESCCMLPF3.h:115
AESCCM_OperationType operationType
Definition: AESCCMLPF3.h:130
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
AESCommonLPF3 Hardware Attributes.
Definition: AESCommonLPF3.h:103
psa_key_location_t KeyStore_PSA_KeyLocation
Definition: CryptoKeyKeyStore_PSA.h:251
const uint8_t * aad
Definition: AESCCMLPF3.h:113
bool segmentedOperationInProgress
Definition: AESCCMLPF3.h:154
volatile size_t totalDataLengthRemaining
Definition: AESCCMLPF3.h:141
Union containing a reference to a one step, segmented AAD, segmented data, or segmented finalize oper...
Definition: AESCCM.h:1106
AESCommon driver implementation for the Low Power F3 family.
volatile size_t inputCBCMACLengthRemaining
Definition: AESCCMLPF3.h:123
uint32_t tempAssetID
Definition: AESCCMLPF3.h:149
uint8_t macLength
Definition: AESCCMLPF3.h:133
volatile size_t totalCBCMACLengthRemaining
Definition: AESCCMLPF3.h:128
volatile size_t inputCTRLengthRemaining
Definition: AESCCMLPF3.h:124
size_t aadBytesProcessed
Definition: AESCCMLPF3.h:127
AESCCM_OperationType
Enum for the operation types supported by the driver.
Definition: AESCCM.h:1118
uint8_t * mac
Definition: AESCCMLPF3.h:117
uint32_t keyAssetID
Definition: AESCCMLPF3.h:150
AESCCM driver header.
int_fast16_t hsmStatus
The staus of the HSM Boot up process if HSMLPF3_STATUS_SUCCESS, the HSM booted properly. if HSMLPF3_STATUS_ERROR, the HSM did not boot properly.
Definition: AESCCMLPF3.h:148
uint8_t nonceLength
Definition: AESCCMLPF3.h:134
KeyStore_PSA_KeyLocation keyLocation
Definition: AESCCMLPF3.h:151
AESCommonLPF3 Object.
Definition: AESCommonLPF3.h:125
uint8_t bufferedAADLength
Definition: AESCCMLPF3.h:132
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale