AESGCMXXF3HSM.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-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  */
65 #ifndef ti_drivers_aesgcm_AESGCMXXF3HSM__include
66 #define ti_drivers_aesgcm_AESGCMXXF3HSM__include
67 
68 #include <stdbool.h>
69 #include <stddef.h>
70 #include <stdint.h>
71 
72 #include <ti/drivers/AESGCM.h>
74 
75 #include <ti/devices/DeviceFamily.h>
76 #if (DeviceFamily_PARENT != DeviceFamily_PARENT_CC35XX)
77  #include DeviceFamily_constructPath(driverlib/aes.h)
78 #endif
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 
91 
97 typedef struct
98 {
99  /* Common member first to allow struct to be cast to the common type */
101  const uint8_t *aad;
102  const uint8_t *input;
103  uint8_t *output;
104  const uint8_t *iv;
105  uint8_t *mac;
106  uint32_t counter[AES_BLOCK_SIZE_WORDS];
107  volatile uint32_t intermediateTag[AES_BLOCK_SIZE_WORDS];
108  uint32_t hashKey[AES_BLOCK_SIZE_WORDS];
109  uint32_t tagOTP[AES_BLOCK_SIZE_WORDS];
112  size_t inputLength;
113  size_t aadLength;
117  volatile size_t totalDataLengthRemaining;
118  volatile size_t totalAADLengthRemaining;
120  uint8_t macLength;
121  uint8_t ivLength;
122  uint8_t KeyStore_keyingMaterial[AESCommonXXF3_256_KEY_LENGTH_BYTES];
123  uint8_t inputFinalBlock[AES_BLOCK_SIZE];
124  uint8_t aadFinalBlock[AES_BLOCK_SIZE];
125  uint8_t outputFinalBlock[AES_BLOCK_SIZE] __attribute__((aligned(4)));
131  int_fast16_t hsmStatus;
132  uint32_t keyAssetID;
133  uint32_t tempAssetID;
134  /* Intentionally use implementation-independent uint32_t datatype for
135  * keyLocation to avoid user dependencies on any implementation-specific
136  * headers (e.g. mbedTLS). This data type must be large enough to hold any
137  * implementation-specific keyLocation data.
138  */
139  uint32_t keyLocation;
140  /* To indicate whether a segmented operation is in progress */
143 
167 int_fast16_t AESGCMXXF3HSM_setMac(AESGCM_Handle handle, const uint8_t *mac, size_t macLength);
168 
169 #ifdef __cplusplus
170 }
171 #endif
172 
173 #endif /* ti_drivers_aesgcm_AESGCMXXF3HSM__include */
AESGCM_OperationType
Enum for the operation types supported by the driver.
Definition: AESGCM.h:944
AESCommonXXF3_Object common
Definition: AESGCMXXF3HSM.h:100
bool segmentedOperationInProgress
Definition: AESGCMXXF3HSM.h:141
int_fast16_t AESGCMXXF3HSM_setMac(AESGCM_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...
uint32_t keyLocation
Definition: AESGCMXXF3HSM.h:139
uint8_t ivLength
Definition: AESGCMXXF3HSM.h:121
AES Global configuration.
Definition: AESCommon.h:154
AESCommon driver implementation for the Low Power F3 family.
uint32_t keyAssetID
Definition: AESGCMXXF3HSM.h:132
AESGCM driver header.
uint8_t * output
Definition: AESGCMXXF3HSM.h:103
uint8_t bufferedAADLength
Definition: AESGCMXXF3HSM.h:114
#define AES_BLOCK_SIZE
Block size in number of bytes.
Definition: AESCommonXXF3.h:103
size_t totalAADLength
Definition: AESGCMXXF3HSM.h:115
const uint8_t * iv
Definition: AESGCMXXF3HSM.h:104
size_t aadLength
Definition: AESGCMXXF3HSM.h:113
const uint8_t * input
Definition: AESGCMXXF3HSM.h:102
uint32_t tempAssetID
Definition: AESGCMXXF3HSM.h:133
#define AESCommonXXF3_256_KEY_LENGTH_BYTES
Definition: AESCommonXXF3.h:96
void(* AESGCM_CallbackFxn)(AESGCM_Handle handle, int_fast16_t returnValue, AESGCM_OperationUnion *operation, AESGCM_OperationType operationType)
The definition of a callback function used by the AESGCM driver when used in AESGCM_RETURN_BEHAVIOR_C...
Definition: AESGCM.h:974
AESGCMXXF3HSM Object.
Definition: AESGCMXXF3HSM.h:97
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: AESGCMXXF3HSM.h:131
AESCommonXXF3_HWAttrs AESGCMXXF3HSM_HWAttrs
AESGCMXXF3 Hardware Attributes.
Definition: AESGCMXXF3HSM.h:90
uint8_t * mac
Definition: AESGCMXXF3HSM.h:105
#define AES_BLOCK_SIZE_WORDS
Definition: AESCommonXXF3.h:104
AESGCM_CallbackFxn callbackFxn
Definition: AESGCMXXF3HSM.h:110
volatile size_t totalDataLengthRemaining
Definition: AESGCMXXF3HSM.h:117
uint8_t macLength
Definition: AESGCMXXF3HSM.h:120
Union containing a reference to a one step, segmented AAD, segmented data, or segmented finalize oper...
Definition: AESGCM.h:932
AESCommonXXF3 Object.
Definition: AESCommonXXF3.h:143
AESGCM_OperationUnion * operation
Definition: AESGCMXXF3HSM.h:111
size_t totalDataLength
Definition: AESGCMXXF3HSM.h:116
const uint8_t * aad
Definition: AESGCMXXF3HSM.h:101
volatile size_t totalAADLengthRemaining
Definition: AESGCMXXF3HSM.h:118
AESGCM_OperationType operationType
Definition: AESGCMXXF3HSM.h:119
size_t inputLength
Definition: AESGCMXXF3HSM.h:112
AESCommonXXF3 Hardware Attributes.
Definition: AESCommonXXF3.h:121
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale