AESECB.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-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  */
32 /*!****************************************************************************
33  * @file AESECB.h
34  *
35  * @brief AESECB driver header
36  *
37  * @anchor ti_drivers_AESECB_Overview
38  * # Overview #
39  * The Electronic Code Book (ECB) mode of operation is a generic
40  * encryption block cipher mode. It can be used with any block cipher.
41  * AESECB encrypts or decrypts one or multiple blocks of plaintext or ciphertext
42  * using the Advanced Encryption Standard (AES) block cipher.
43  * Each input block is individually encrypted or decrypted. This means that
44  * blocks of ciphertext can be decrypted individually and out of order.
45  * Encrypting the same plaintext using the same key yields identical ciphertext.
46  * This raises several security issues. For this reason, ECB is not recommended
47  * unless interfacing with legacy systems which cannot be updated
48  * or where a standard specifies its use. Better alternatives would be an
49  * authenticated encryption with associated data (AEAD) mode such as
50  * CCM or GCM.
51  *
52  * The AES key is a shared secret between the two parties and has a length
53  * of 128, 192, or 256 bits.
54  *
55  * @anchor ti_drivers_AESECB_Usage
56  * # Usage #
57  *
58  * ## Before starting an ECB operation #
59  *
60  * Before starting an ECB operation, the application must do the following:
61  * - Call AESECB_init() to initialize the driver
62  * - Call AESECB_Params_init() to initialize the AESECB_Params to default values.
63  * - Modify the AESECB_Params as desired
64  * - Call AESECB_open() to open an instance of the driver
65  * - Initialize a CryptoKey. These opaque data structures are representations
66  * of keying material and its storage. Depending on how the keying material
67  * is stored (RAM or flash, key store), the CryptoKey must be
68  * initialized differently. The AESECB API can handle all types of CryptoKey.
69  * However, not all device-specific implementations support all types of CryptoKey.
70  * Devices without a key store will not support CryptoKeys with keying material
71  * stored in a key store for example.
72  * All devices support plaintext CryptoKeys.
73  * - Initialize the AESECB_Operation using AESECB_Operation_init() and set all
74  * length, key, and buffer fields.
75  *
76  * ## Starting an ECB operation #
77  *
78  * The AESECB_oneStepEncrypt and AESECB_oneStepDecrypt functions do an ECB operation in a single call.
79  * They will always be the most highly optimized routines with the least overhead and the fastest
80  * runtime. Since ECB plaintext blocks are simply encrypted with the block cipher block by block,
81  * there is no difference in the ciphertext between encrypting two blocks in one go or encrypting
82  * each block individually.
83  *
84  * ## Device-Specific Requirements #
85  *
86  * For CC27XX devices, ECB operations leveraging the HSM engine
87  * (key encoding suffixed with _HSM) have the following requirements:
88  * - Output buffer address must be 32-bit aligned.
89  *
90  * ## After the ECB operation completes #
91  *
92  * After the ECB operation completes, the application should either start another operation
93  * or close the driver by calling AESECB_close()
94  *
95  * @anchor ti_drivers_AESECB_Synopsis
96  * ## Synopsis
97  * @anchor ti_drivers_AESECB_Synopsis_Code
98  * @code
99  * // Import AESECB Driver definitions
100  * #include <ti/drivers/AESECB.h>
101  *
102  * AESECB_init();
103  *
104  * // Define name for AESECB channel index
105  * #define AESECB_INSTANCE 0
106  *
107  * handle = AESECB_open(AESECB_INSTANCE, NULL);
108  *
109  * // Initialize symmetric key
110  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
111  *
112  * // Set up AESECB_Operation
113  * AESECB_Operation_init(&operation);
114  * operation.key = &cryptoKey;
115  * operation.input = plaintext;
116  * operation.output = ciphertext;
117  * // Input length must be a non-zero multiple of block-size (16 bytes)
118  * // for one-step operations. The user or application should take care of
119  * // necessary padding.
120  * operation.inputLength = sizeof(plaintext);
121  *
122  * encryptionResult = AESECB_oneStepEncrypt(handle, &operation);
123  *
124  * AESECB_close(handle);
125  * @endcode
126  *
127  * @anchor ti_drivers_AESECB_Examples
128  *
129  * ## Examples
130  *
131  * ### Encryption of multiple plaintext blocks in blocking mode #
132  * @code
133  *
134  * #include <ti/drivers/AESECB.h>
135  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
136  *
137  * ...
138  *
139  * AESECB_Handle handle;
140  * CryptoKey cryptoKey;
141  * int_fast16_t encryptionResult;
142  * uint8_t plaintext[] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
143  * 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
144  * 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
145  * 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51};
146  * uint8_t ciphertext[sizeof(plaintext)];
147  * uint8_t keyingMaterial[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
148  * 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}
149  *
150  * handle = AESECB_open(0, NULL);
151  *
152  * if (handle == NULL) {
153  * // handle error
154  * }
155  *
156  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
157  *
158  * AESECB_Operation operation;
159  * AESECB_Operation_init(&operation);
160  *
161  * operation.key = &cryptoKey;
162  * operation.input = plaintext;
163  * operation.output = ciphertext;
164  * // Input length must be a non-zero multiple of block-size (16 bytes)
165  * // for one-step operations. The user or application should take care of
166  * // necessary padding.
167  * operation.inputLength = sizeof(plaintext);
168  *
169  * encryptionResult = AESECB_oneStepEncrypt(handle, &operation);
170  *
171  * if (encryptionResult != AESECB_STATUS_SUCCESS) {
172  * // handle error
173  * }
174  *
175  * // The resultant ciphertext should be:
176  * // 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60,
177  * // 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97,
178  * // 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d,
179  * // 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf
180  *
181  *
182  * AESECB_close(handle);
183  *
184  * @endcode
185  *
186  * ### One step ECB decryption in callback mode #
187  * @code
188  *
189  * #include <ti/drivers/AESECB.h>
190  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
191  *
192  * ...
193  *
194  * uint8_t ciphertext[] = {0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c,
195  * 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8};
196  * uint8_t keyingMaterial[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
197  * 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
198  * 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
199  * 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4};
200  * uint8_t plaintext[sizeof(ciphertext)];
201  *
202  * // The plaintext should be the following after the decryption operation:
203  * // 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
204  * // 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
205  *
206  *
207  * void ecbCallback(AESECB_Handle handle,
208  * int_fast16_t returnValue,
209  * AESECB_Operation *operation,
210  * AESECB_OperationType operationType) {
211  *
212  * if (returnValue != AESECB_STATUS_SUCCESS) {
213  * // handle error
214  * }
215  * }
216  *
217  * AESECB_Operation operation;
218  *
219  * void ecbStartFunction(void) {
220  * AESECB_Handle handle;
221  * AESECB_Params params;
222  * CryptoKey cryptoKey;
223  * int_fast16_t decryptionResult;
224  *
225  * AESECB_Params_init(&params);
226  * params.returnBehavior = AESECB_RETURN_BEHAVIOR_CALLBACK;
227  * params.callbackFxn = ecbCallback;
228  *
229  * handle = AESECB_open(0, &params);
230  *
231  * if (handle == NULL) {
232  * // handle error
233  * }
234  *
235  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
236  *
237  * AESECB_Operation_init(&operation);
238  *
239  * operation.key = &cryptoKey;
240  * operation.input = plaintext;
241  * operation.output = ciphertext;
242  * // Input length must be a non-zero multiple of block-size (16 bytes)
243  * // for one-step operations. The user or application should take care of
244  * // necessary padding.
245  * operation.inputLength = sizeof(plaintext);
246  *
247  * decryptionResult = AESECB_oneStepDecrypt(handle, &operation);
248  *
249  * if (decryptionResult != AESECB_STATUS_SUCCESS) {
250  * // handle error
251  * }
252  *
253  * // do other things while ECB operation completes in the background
254  *
255  * }
256  *
257  * @endcode
258  *
259  * ### Multi-step ECB encryption in blocking mode #
260  * @code
261  *
262  * #include <ti/drivers/AESECB.h>
263  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
264  *
265  * #define AES_BLOCK_SIZE 16 // bytes
266  *
267  * ...
268  *
269  * AESECB_Handle handle;
270  * CryptoKey cryptoKey;
271  * int_fast16_t encryptionResult;
272  * int_fast16_t setupEncryptionResult;
273  * int_fast16_t finalizeEncryptionResult;
274  * uint8_t plaintext[] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
275  * 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
276  * 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
277  * 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51};
278  * uint8_t ciphertext[sizeof(plaintext)];
279  * uint8_t keyingMaterial[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
280  * 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}
281  *
282  * handle = AESECB_open(0, NULL);
283  *
284  * if (handle == NULL) {
285  * // handle error
286  * }
287  *
288  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
289  *
290  * setupEncryptionResult = AESECB_setupEncrypt(handle, &cryptoKey);
291  * if (setupEncryptionResult != AESECB_STATUS_SUCCESS) {
292  * // handle error
293  * }
294  *
295  * AESECB_Operation operation;
296  * AESECB_Operation_init(&operation);
297  *
298  * // No need to set operation.key for multi-step operations.
299  * operation.input = plaintext;
300  * operation.output = ciphertext;
301  * // Input length must be a non-zero multiple of block-size (16 bytes) for calling
302  * // #AESECB_addData(). The user or application should take care of necessary padding
303  * // if the final block of data is being added for the entire segmented operation.
304  * operation.inputLength = AES_BLOCK_SIZE;
305  *
306  * encryptionResult = AESECB_addData(handle, &operation);
307  * if (encryptionResult != AESECB_STATUS_SUCCESS) {
308  * // handle error
309  * }
310  *
311  * // No need to set operation.key for multi-step operations.
312  * operation.input = plaintext + AES_BLOCK_SIZE;
313  * operation.output = ciphertext + AES_BLOCK_SIZE;
314  * // Input length must either be a non-zero multiple of block-size (16 bytes)
315  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
316  * // any more data. The user or application should take care of necessary padding
317  * // for the last block of data.
318  * operation.inputLength = AES_BLOCK_SIZE;
319  *
320  * finalizeEncryptionResult = AESECB_finalize(handle, &operation);
321  * if (finalizeEncryptionResult != AESECB_STATUS_SUCCESS) {
322  * // handle error
323  * }
324  *
325  * // The resultant ciphertext should be:
326  * // 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60,
327  * // 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97,
328  * // 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d,
329  * // 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf
330  *
331  *
332  * AESECB_close(handle);
333  *
334  * }
335  *
336  * @endcode
337  *
338  * ### Multi-step ECB decryption in callback mode #
339  * @code
340  *
341  * #include <ti/drivers/AESECB.h>
342  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
343  *
344  * #define AES_BLOCK_SIZE 16 // bytes
345  *
346  * ...
347  * uint8_t ciphertext[] = {0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c,
348  * 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8};
349  * uint8_t keyingMaterial[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
350  * 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
351  * 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
352  * 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4};
353  * uint8_t plaintext[sizeof(ciphertext)];
354  *
355  * // The plaintext should be the following after the decryption operation:
356  * // 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
357  * // 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
358  *
359  *
360  * void ecbCallback(AESECB_Handle handle,
361  * int_fast16_t returnValue,
362  * AESECB_Operation *operation,
363  * AESECB_OperationType operationType) {
364  *
365  * if (returnValue != AESECB_STATUS_SUCCESS) {
366  * // handle error
367  * }
368  * }
369  *
370  * AESECB_Operation operation;
371  *
372  * void ecbStartFunction(void) {
373  * AESECB_Handle handle;
374  * AESECB_Params params;
375  * CryptoKey cryptoKey;
376  * int_fast16_t decryptionResult;
377  * int_fast16_t setupDecryptionResult;
378  * int_fast16_t finalizeDecryptionResult;
379  *
380  * AESECB_Params_init(&params);
381  * params.returnBehavior = AESECB_RETURN_BEHAVIOR_CALLBACK;
382  * params.callbackFxn = ecbCallback;
383  *
384  * handle = AESECB_open(0, &params);
385  *
386  * if (handle == NULL) {
387  * // handle error
388  * }
389  *
390  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
391  *
392  * setupDecryptionResult = AESECB_setupDecrypt(handle, &cryptoKey);
393  * if (setupDecryptionResult != AESECB_STATUS_SUCCESS) {
394  * // handle error
395  * }
396  *
397  * AESECB_Operation_init(&operation);
398  *
399  * // No need to set operation.key for multi-step operations.
400  * operation.input = plaintext;
401  * operation.output = ciphertext;
402  * // Input length must be a non-zero multiple of block-size (16 bytes) for calling
403  * // #AESECB_addData(). The user or application should take care of necessary padding
404  * // if the final block of data is being added for the entire segmented operation.
405  * operation.inputLength = AES_BLOCK_SIZE;
406  *
407  * decryptionResult = AESECB_addData(handle, &operation);
408  * if (decryptionResult != AESECB_STATUS_SUCCESS) {
409  * // handle error
410  * }
411  *
412  * // do other things while ECB operation completes in the background
413  *
414  * // Input length must either be a non-zero multiple of block-size (16 bytes)
415  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
416  * // any more data as shown in this example. There's no more data involved and padding
417  * // is not applicable for this finalization operation.
418  * operation.inputLength = 0;
419  *
420  * finalizeDecryptionResult = AESECB_finalize(handle, &operation);
421  * if (finalizeDecryptionResult != AESECB_STATUS_SUCCESS) {
422  * // handle error
423  * }
424  *
425  * }
426  *
427  * @endcode
428  */
429 
430 #ifndef ti_drivers_AESECB__include
431 #define ti_drivers_AESECB__include
432 
433 #include <stdbool.h>
434 #include <stddef.h>
435 #include <stdint.h>
436 
437 #include <ti/drivers/AESCommon.h>
439 
440 #ifdef __cplusplus
441 extern "C" {
442 #endif
443 
456 #define AESECB_STATUS_RESERVED AES_STATUS_RESERVED
457 
464 #define AESECB_STATUS_SUCCESS AES_STATUS_SUCCESS
465 
472 #define AESECB_STATUS_ERROR AES_STATUS_ERROR
473 
482 #define AESECB_STATUS_RESOURCE_UNAVAILABLE AES_STATUS_RESOURCE_UNAVAILABLE
483 
487 #define AESECB_STATUS_CANCELED AES_STATUS_CANCELED
488 
493 #define AESECB_STATUS_FEATURE_NOT_SUPPORTED AES_STATUS_FEATURE_NOT_SUPPORTED
494 
498 #define AESECB_STATUS_KEYSTORE_INVALID_ID AES_STATUS_KEYSTORE_INVALID_ID
499 
504 #define AESECB_STATUS_KEYSTORE_GENERIC_ERROR AES_STATUS_KEYSTORE_GENERIC_ERROR
505 
512 #define AESECB_STATUS_UNALIGNED_IO_NOT_SUPPORTED AES_STATUS_UNALIGNED_IO_NOT_SUPPORTED
513 
526 
530 typedef AESECB_Config *AESECB_Handle;
531 
553 typedef enum
554 {
573 
577 typedef enum
578 {
581 } AESECB_Mode;
582 
587 typedef struct
588 {
594  uint8_t *input;
601  uint8_t *output;
613  size_t inputLength;
632 
636 typedef enum
637 {
645 
661 typedef void (*AESECB_CallbackFxn)(AESECB_Handle handle,
662  int_fast16_t returnValue,
663  AESECB_Operation *operation,
664  AESECB_OperationType operationType);
665 
674 typedef struct
675 {
676  AESECB_ReturnBehavior returnBehavior;
678  uint32_t timeout;
681  void *custom;
684 } AESECB_Params;
685 
692 
701 void AESECB_init(void);
702 
715 void AESECB_Params_init(AESECB_Params *params);
716 
734 AESECB_Handle AESECB_open(uint_least8_t index, const AESECB_Params *params);
735 
745 void AESECB_close(AESECB_Handle handle);
746 
755 void AESECB_Operation_init(AESECB_Operation *operationStruct);
756 
777 int_fast16_t AESECB_oneStepEncrypt(AESECB_Handle handle, AESECB_Operation *operation);
778 
799 int_fast16_t AESECB_oneStepDecrypt(AESECB_Handle handle, AESECB_Operation *operation);
800 
818 int_fast16_t AESECB_setupEncrypt(AESECB_Handle handle, const CryptoKey *key);
819 
837 int_fast16_t AESECB_setupDecrypt(AESECB_Handle handle, const CryptoKey *key);
838 
861 int_fast16_t AESECB_addData(AESECB_Handle handle, AESECB_Operation *operation);
862 
882 int_fast16_t AESECB_finalize(AESECB_Handle handle, AESECB_Operation *operation);
883 
897 int_fast16_t AESECB_cancelOperation(AESECB_Handle handle);
898 
922 AESECB_Handle AESECB_construct(AESECB_Config *config, const AESECB_Params *params);
923 
924 #ifdef __cplusplus
925 }
926 #endif
927 
928 #endif /* ti_drivers_AESECB__include */
AESECB_ReturnBehavior returnBehavior
Definition: AESECB.h:676
The CryptoKey type is an opaque representation of a cryptographic key.
int_fast16_t AESECB_addData(AESECB_Handle handle, AESECB_Operation *operation)
Encrypts or decrypts segment of data with a length.
void AESECB_close(AESECB_Handle handle)
Function to close an ECB peripheral specified by the ECB handle.
int_fast16_t AESECB_cancelOperation(AESECB_Handle handle)
Cancels an ongoing AESECB operation.
AESECB_Handle AESECB_open(uint_least8_t index, const AESECB_Params *params)
This function opens a given ECB peripheral.
size_t inputLength
Definition: AESECB.h:613
Definition: AESECB.h:579
AES Global configuration.
Definition: AESCommon.h:154
int_fast16_t AESECB_oneStepEncrypt(AESECB_Handle handle, AESECB_Operation *operation)
Function to perform an AESECB encryption operation in one call.
CryptoKey datastructure.
Definition: CryptoKey.h:211
Definition: AESECB.h:639
Definition: AESECB.h:567
Definition: AESCommon.h:186
Definition: AESCommon.h:196
ECB Parameters.
Definition: AESECB.h:674
void AESECB_init(void)
This function initializes the ECB module.
uint8_t * output
Definition: AESECB.h:601
void AESECB_Params_init(AESECB_Params *params)
Function to initialize the AESECB_Params struct to its defaults.
AESCommon_Config AESECB_Config
AESECB Global configuration.
Definition: AESECB.h:525
Definition: AESCommon.h:192
AESECB_ReturnBehavior
The way in which ECB function calls return after performing an encryption + authentication or decrypt...
Definition: AESECB.h:553
CryptoKey * key
Definition: AESECB.h:589
Struct containing the parameters required for encrypting/decrypting and a message.
Definition: AESECB.h:587
uint8_t * input
Definition: AESECB.h:594
int_fast16_t AESECB_oneStepDecrypt(AESECB_Handle handle, AESECB_Operation *operation)
Function to perform an AESECB decryption in one call.
int_fast16_t AESECB_setupEncrypt(AESECB_Handle handle, const CryptoKey *key)
Function to prepare a segmented AESECB encryption operation.
uint32_t timeout
Definition: AESECB.h:678
void AESECB_Operation_init(AESECB_Operation *operationStruct)
Function to initialize an AESECB_Operation struct to its defaults.
Definition: AESECB.h:638
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:661
Definition: AESECB.h:555
AESECB_Mode
Enum for the direction of the ECB operation.
Definition: AESECB.h:577
const AESECB_Params AESECB_defaultParams
Default AESECB_Params structure.
void * custom
Definition: AESECB.h:681
Definition: AESECB.h:562
int_fast16_t AESECB_setupDecrypt(AESECB_Handle handle, const CryptoKey *key)
Function to prepare a segmented AESECB decryption operation.
AES common module header for all devices.
AESECB_OperationType
Enum for the operation types supported by the driver.
Definition: AESECB.h:636
AESECB_Config * AESECB_Handle
A handle that is returned from an AESECB_open() call.
Definition: AESECB.h:530
Definition: AESECB.h:580
AESECB_CallbackFxn callbackFxn
Definition: AESECB.h:677
AESECB_Handle AESECB_construct(AESECB_Config *config, const AESECB_Params *params)
Constructs a new AESECB object.
int_fast16_t AESECB_finalize(AESECB_Handle handle, AESECB_Operation *operation)
Finalize the AES transaction. If new data needs to be added, inputLength will be used to govern how m...
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale