AESECBLPF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2023, 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  */
57 #ifndef ti_drivers_aesecb_AESECBLPF3__include
58 #define ti_drivers_aesecb_AESECBLPF3__include
59 
60 #include <stdbool.h>
61 #include <stdint.h>
62 
63 #include <ti/drivers/AESECB.h>
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
78 #define AESECBLPF3_DMA_SIZE_THRESHOLD (1U * AES_BLOCK_SIZE)
79 
80 /*
81  * AES ECB auto config for a single block encryption:
82  * ECB SRC as BUF
83  * Trigger points for auto ECB as WRBUF3S (encryption starts by writing BUF3)
84  */
85 #define AESEBCLPF3_SINGLE_BLOCK_AUTOCFG \
86  ((uint32_t)AES_AUTOCFG_ECBSRC_BUF | (uint32_t)AES_AUTOCFG_TRGECB_WRBUF3S | (uint32_t)AES_AUTOCFG_BUSHALT_EN)
87 
95 
101 typedef struct
102 {
103  /* Common member first to allow struct to be cast to the common type */
110 
126 void AESECBLPF3_processData(AESCommonLPF3_Object *object, const uint8_t *input, uint8_t *output, size_t inputLength);
143 __STATIC_INLINE bool AESECB_acquireLock(AESECB_Handle handle, uint32_t timeout)
144 {
145  return CryptoResourceLPF3_acquireLock(timeout);
146 }
157 __STATIC_INLINE void AESECB_releaseLock(AESECB_Handle handle)
158 {
160 }
171 __STATIC_INLINE void AESECB_enableThreadSafety(AESECB_Handle handle)
172 {
173  AESECBLPF3_Object *object = handle->object;
174  object->threadSafe = true;
175 }
189 __STATIC_INLINE void AESECB_disableThreadSafety(AESECB_Handle handle)
190 {
191  AESECBLPF3_Object *object = handle->object;
192  object->threadSafe = false;
193 }
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* ti_drivers_aesecb_AESECBLPF3__include */
bool threadSafe
Definition: AESECBLPF3.h:108
AESECB_CallbackFxn callbackFxn
Definition: AESECBLPF3.h:106
bool CryptoResourceLPF3_acquireLock(uint32_t timeout)
AESCommonLPF3_Object common
Definition: AESECBLPF3.h:104
AES Global configuration.
Definition: AESCommon.h:154
Struct containing the parameters required for encrypting/decrypting and a message.
Definition: AESECB.h:581
AESECB driver header.
AESCommonLPF3 Hardware Attributes.
Definition: AESCommonLPF3.h:80
void CryptoResourceLPF3_releaseLock(void)
AESCommon driver implementation for the Low Power F3 family.
void(* AESECB_CallbackFxn)(AESECB_Handle handle, int_fast16_t returnValue, AESECB_Operation *operation, AESECB_OperationType operationType)
The definition of a callback function used by the AESECB driver when used in AESECB_RETURN_BEHAVIOR_C...
Definition: AESECB.h:652
AESECB_Operation * operation
Definition: AESECBLPF3.h:105
Shared resources to arbitrate access to the AES engine.
AESECBLPF3 Object.
Definition: AESECBLPF3.h:101
void * object
Definition: AESCommon.h:157
AESECB_OperationType
Enum for the operation types supported by the driver.
Definition: AESECB.h:627
AESCommonLPF3_HWAttrs AESECBLPF3_HWAttrs
AESECBLPF3 Hardware Attributes.
Definition: AESECBLPF3.h:94
AESECB_OperationType operationType
Definition: AESECBLPF3.h:107
AESCommonLPF3 Object.
Definition: AESCommonLPF3.h:102
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale