AESCCMLPF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2024, 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  */
70 #ifndef ti_drivers_aesccm_AESCCMLPF3__include
71 #define ti_drivers_aesccm_AESCCMLPF3__include
72 
73 #include <stdbool.h>
74 #include <stdint.h>
75 
76 #include <ti/drivers/AESCCM.h>
78 
79 #include <ti/devices/DeviceFamily.h>
80 #include DeviceFamily_constructPath(driverlib/aes.h)
81 
82 #ifdef __cplusplus
83 extern "C" {
84 #endif
85 
86 #define AESCCMLPF3_AAD_BUFFER_SIZE 2U
87 
95 
101 typedef struct
102 {
103  /* Common member first to allow struct to be cast to the common type */
105  const uint8_t *aad;
106  const uint8_t *input;
107  uint8_t *output;
108  const uint8_t *nonce;
109  uint8_t *mac;
110  volatile uint32_t intermediateCounter[AES_IV_LENGTH_BYTES / 4];
111  volatile uint32_t intermediateTag[AES_TAG_LENGTH_BYTES / 4];
114  size_t inputLength;
115  volatile size_t inputCBCMACLengthRemaining;
116  volatile size_t inputCTRLengthRemaining;
120  volatile size_t totalCBCMACLengthRemaining;
121  volatile size_t totalCTRLengthRemaining;
123  uint8_t bufferedAAD[AESCCMLPF3_AAD_BUFFER_SIZE];
125  uint8_t macLength;
126  uint8_t nonceLength;
127 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX)
128  size_t aadLength;
129  volatile size_t totalDataLengthRemaining;
130  volatile size_t totalAADLengthRemaining;
136  int_fast16_t hsmStatus;
137  uint32_t tempAssetID;
138  /* To indicate whether a segmented operation is in progress
139  */
141 #endif
143 
144 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX)
145 
168 int_fast16_t AESCCMLPF3HSM_setMac(AESCCM_Handle handle, const uint8_t *mac, size_t macLength);
169 #endif
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif /* ti_drivers_aesccm_AESCCMLPF3__include */
AESCommonLPF3_HWAttrs AESCCMLPF3_HWAttrs
AESCCMLPF3 Hardware Attributes.
Definition: AESCCMLPF3.h:94
const uint8_t * input
Definition: AESCCMLPF3.h:106
AESCommonLPF3_Object common
Definition: AESCCMLPF3.h:104
#define AESCCMLPF3_AAD_BUFFER_SIZE
Definition: AESCCMLPF3.h:86
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...
volatile size_t totalCTRLengthRemaining
Definition: AESCCMLPF3.h:121
AESCCM_CallbackFxn callbackFxn
Definition: AESCCMLPF3.h:112
AES Global configuration.
Definition: AESCommon.h:154
AESCCM_OperationUnion * operation
Definition: AESCCMLPF3.h:113
size_t totalDataLength
Definition: AESCCMLPF3.h:118
volatile size_t totalAADLengthRemaining
Definition: AESCCMLPF3.h:130
const uint8_t * nonce
Definition: AESCCMLPF3.h:108
size_t aadLength
Definition: AESCCMLPF3.h:128
AESCCMLPF3 Object.
Definition: AESCCMLPF3.h:101
size_t totalAADLength
Definition: AESCCMLPF3.h:117
size_t inputLength
Definition: AESCCMLPF3.h:114
uint8_t * output
Definition: AESCCMLPF3.h:107
AESCCM_OperationType operationType
Definition: AESCCMLPF3.h:122
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:1132
AESCommonLPF3 Hardware Attributes.
Definition: AESCommonLPF3.h:80
const uint8_t * aad
Definition: AESCCMLPF3.h:105
bool segmentedOperationInProgress
Definition: AESCCMLPF3.h:140
volatile size_t totalDataLengthRemaining
Definition: AESCCMLPF3.h:129
Union containing a reference to a one step, segmented AAD, segmented data, or segmented finalize oper...
Definition: AESCCM.h:1090
AESCommon driver implementation for the Low Power F3 family.
volatile size_t inputCBCMACLengthRemaining
Definition: AESCCMLPF3.h:115
uint32_t tempAssetID
Definition: AESCCMLPF3.h:137
uint8_t macLength
Definition: AESCCMLPF3.h:125
volatile size_t totalCBCMACLengthRemaining
Definition: AESCCMLPF3.h:120
volatile size_t inputCTRLengthRemaining
Definition: AESCCMLPF3.h:116
size_t aadBytesProcessed
Definition: AESCCMLPF3.h:119
AESCCM_OperationType
Enum for the operation types supported by the driver.
Definition: AESCCM.h:1102
uint8_t * mac
Definition: AESCCMLPF3.h:109
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:136
uint8_t nonceLength
Definition: AESCCMLPF3.h:126
AESCommonLPF3 Object.
Definition: AESCommonLPF3.h:102
uint8_t bufferedAADLength
Definition: AESCCMLPF3.h:124
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale