AESECB.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2022, 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  * ## After the ECB operation completes #
85  *
86  * After the ECB operation completes, the application should either start another operation
87  * or close the driver by calling AESECB_close()
88  *
89  * @anchor ti_drivers_AESECB_Synopsis
90  * ## Synopsis
91  * @anchor ti_drivers_AESECB_Synopsis_Code
92  * @code
93  * // Import AESECB Driver definitions
94  * #include <ti/drivers/AESECB.h>
95  *
96  * AESECB_init();
97  *
98  * // Define name for AESECB channel index
99  * #define AESECB_INSTANCE 0
100  *
101  * handle = AESECB_open(AESECB_INSTANCE, NULL);
102  *
103  * // Initialize symmetric key
104  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
105  *
106  * // Set up AESECB_Operation
107  * AESECB_Operation_init(&operation);
108  * operation.key = &cryptoKey;
109  * operation.input = plaintext;
110  * operation.output = ciphertext;
111  * // Input length must be a non-zero multiple of block-size (16 bytes)
112  * // for one-step operations. The user or application should take care of
113  * // necessary padding.
114  * operation.inputLength = sizeof(plaintext);
115  *
116  * encryptionResult = AESECB_oneStepEncrypt(handle, &operation);
117  *
118  * AESECB_close(handle);
119  * @endcode
120  *
121  * @anchor ti_drivers_AESECB_Examples
122  *
123  * ## Examples
124  *
125  * ### Encryption of multiple plaintext blocks in blocking mode #
126  * @code
127  *
128  * #include <ti/drivers/AESECB.h>
129  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
130  *
131  * ...
132  *
133  * AESECB_Handle handle;
134  * CryptoKey cryptoKey;
135  * int_fast16_t encryptionResult;
136  * uint8_t plaintext[] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
137  * 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
138  * 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
139  * 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51};
140  * uint8_t ciphertext[sizeof(plaintext)];
141  * uint8_t keyingMaterial[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
142  * 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}
143  *
144  * handle = AESECB_open(0, NULL);
145  *
146  * if (handle == NULL) {
147  * // handle error
148  * }
149  *
150  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
151  *
152  * AESECB_Operation operation;
153  * AESECB_Operation_init(&operation);
154  *
155  * operation.key = &cryptoKey;
156  * operation.input = plaintext;
157  * operation.output = ciphertext;
158  * // Input length must be a non-zero multiple of block-size (16 bytes)
159  * // for one-step operations. The user or application should take care of
160  * // necessary padding.
161  * operation.inputLength = sizeof(plaintext);
162  *
163  * encryptionResult = AESECB_oneStepEncrypt(handle, &operation);
164  *
165  * if (encryptionResult != AESECB_STATUS_SUCCESS) {
166  * // handle error
167  * }
168  *
169  * // The resultant ciphertext should be:
170  * // 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60,
171  * // 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97,
172  * // 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d,
173  * // 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf
174  *
175  *
176  * AESECB_close(handle);
177  *
178  * @endcode
179  *
180  * ### One step ECB decryption in callback mode #
181  * @code
182  *
183  * #include <ti/drivers/AESECB.h>
184  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
185  *
186  * ...
187  *
188  * uint8_t ciphertext[] = {0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c,
189  * 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8};
190  * uint8_t keyingMaterial[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
191  * 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
192  * 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
193  * 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4};
194  * uint8_t plaintext[sizeof(ciphertext)];
195  *
196  * // The plaintext should be the following after the decryption operation:
197  * // 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
198  * // 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
199  *
200  *
201  * void ecbCallback(AESECB_Handle handle,
202  * int_fast16_t returnValue,
203  * AESECB_Operation *operation,
204  * AESECB_OperationType operationType) {
205  *
206  * if (returnValue != AESECB_STATUS_SUCCESS) {
207  * // handle error
208  * }
209  * }
210  *
211  * AESECB_Operation operation;
212  *
213  * void ecbStartFunction(void) {
214  * AESECB_Handle handle;
215  * AESECB_Params params;
216  * CryptoKey cryptoKey;
217  * int_fast16_t decryptionResult;
218  *
219  * AESECB_Params_init(&params);
220  * params.returnBehavior = AESECB_RETURN_BEHAVIOR_CALLBACK;
221  * params.callbackFxn = ecbCallback;
222  *
223  * handle = AESECB_open(0, &params);
224  *
225  * if (handle == NULL) {
226  * // handle error
227  * }
228  *
229  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
230  *
231  * AESECB_Operation_init(&operation);
232  *
233  * operation.key = &cryptoKey;
234  * operation.input = plaintext;
235  * operation.output = ciphertext;
236  * // Input length must be a non-zero multiple of block-size (16 bytes)
237  * // for one-step operations. The user or application should take care of
238  * // necessary padding.
239  * operation.inputLength = sizeof(plaintext);
240  *
241  * decryptionResult = AESECB_oneStepDecrypt(handle, &operation);
242  *
243  * if (decryptionResult != AESECB_STATUS_SUCCESS) {
244  * // handle error
245  * }
246  *
247  * // do other things while ECB operation completes in the background
248  *
249  * }
250  *
251  * @endcode
252  *
253  * ### Multi-step ECB encryption in blocking mode #
254  * @code
255  *
256  * #include <ti/drivers/AESECB.h>
257  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
258  *
259  * #define AES_BLOCK_SIZE 16 // bytes
260  *
261  * ...
262  *
263  * AESECB_Handle handle;
264  * CryptoKey cryptoKey;
265  * int_fast16_t encryptionResult;
266  * int_fast16_t setupEncryptionResult;
267  * int_fast16_t finalizeEncryptionResult;
268  * uint8_t plaintext[] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
269  * 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
270  * 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
271  * 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51};
272  * uint8_t ciphertext[sizeof(plaintext)];
273  * uint8_t keyingMaterial[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
274  * 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}
275  *
276  * handle = AESECB_open(0, NULL);
277  *
278  * if (handle == NULL) {
279  * // handle error
280  * }
281  *
282  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
283  *
284  * setupEncryptionResult = AESECB_setupEncrypt(handle, &cryptoKey);
285  * if (setupEncryptionResult != AESECB_STATUS_SUCCESS) {
286  * // handle error
287  * }
288  *
289  * AESECB_Operation operation;
290  * AESECB_Operation_init(&operation);
291  *
292  * // No need to set operation.key for multi-step operations.
293  * operation.input = plaintext;
294  * operation.output = ciphertext;
295  * // Input length must be a non-zero multiple of block-size (16 bytes) for calling
296  * // #AESECB_addData(). The user or application should take care of necessary padding
297  * // if the final block of data is being added for the entire segmented operation.
298  * operation.inputLength = AES_BLOCK_SIZE;
299  *
300  * encryptionResult = AESECB_addData(handle, &operation);
301  * if (encryptionResult != AESECB_STATUS_SUCCESS) {
302  * // handle error
303  * }
304  *
305  * // No need to set operation.key for multi-step operations.
306  * operation.input = plaintext + AES_BLOCK_SIZE;
307  * operation.output = ciphertext + AES_BLOCK_SIZE;
308  * // Input length must either be a non-zero multiple of block-size (16 bytes)
309  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
310  * // any more data. The user or application should take care of necessary padding
311  * // for the last block of data.
312  * operation.inputLength = AES_BLOCK_SIZE;
313  *
314  * finalizeEncryptionResult = AESECB_finalize(handle, &operation);
315  * if (finalizeEncryptionResult != AESECB_STATUS_SUCCESS) {
316  * // handle error
317  * }
318  *
319  * // The resultant ciphertext should be:
320  * // 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60,
321  * // 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97,
322  * // 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d,
323  * // 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf
324  *
325  *
326  * AESECB_close(handle);
327  *
328  * }
329  *
330  * @endcode
331  *
332  * ### Multi-step ECB decryption in callback mode #
333  * @code
334  *
335  * #include <ti/drivers/AESECB.h>
336  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
337  *
338  * #define AES_BLOCK_SIZE 16 // bytes
339  *
340  * ...
341  * uint8_t ciphertext[] = {0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c,
342  * 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8};
343  * uint8_t keyingMaterial[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
344  * 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
345  * 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
346  * 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4};
347  * uint8_t plaintext[sizeof(ciphertext)];
348  *
349  * // The plaintext should be the following after the decryption operation:
350  * // 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
351  * // 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
352  *
353  *
354  * void ecbCallback(AESECB_Handle handle,
355  * int_fast16_t returnValue,
356  * AESECB_Operation *operation,
357  * AESECB_OperationType operationType) {
358  *
359  * if (returnValue != AESECB_STATUS_SUCCESS) {
360  * // handle error
361  * }
362  * }
363  *
364  * AESECB_Operation operation;
365  *
366  * void ecbStartFunction(void) {
367  * AESECB_Handle handle;
368  * AESECB_Params params;
369  * CryptoKey cryptoKey;
370  * int_fast16_t decryptionResult;
371  * int_fast16_t setupDecryptionResult;
372  * int_fast16_t finalizeDecryptionResult;
373  *
374  * AESECB_Params_init(&params);
375  * params.returnBehavior = AESECB_RETURN_BEHAVIOR_CALLBACK;
376  * params.callbackFxn = ecbCallback;
377  *
378  * handle = AESECB_open(0, &params);
379  *
380  * if (handle == NULL) {
381  * // handle error
382  * }
383  *
384  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
385  *
386  * setupDecryptionResult = AESECB_setupDecrypt(handle, &cryptoKey);
387  * if (setupDecryptionResult != AESECB_STATUS_SUCCESS) {
388  * // handle error
389  * }
390  *
391  * AESECB_Operation_init(&operation);
392  *
393  * // No need to set operation.key for multi-step operations.
394  * operation.input = plaintext;
395  * operation.output = ciphertext;
396  * // Input length must be a non-zero multiple of block-size (16 bytes) for calling
397  * // #AESECB_addData(). The user or application should take care of necessary padding
398  * // if the final block of data is being added for the entire segmented operation.
399  * operation.inputLength = AES_BLOCK_SIZE;
400  *
401  * decryptionResult = AESECB_addData(handle, &operation);
402  * if (decryptionResult != AESECB_STATUS_SUCCESS) {
403  * // handle error
404  * }
405  *
406  * // do other things while ECB operation completes in the background
407  *
408  * // Input length must either be a non-zero multiple of block-size (16 bytes)
409  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
410  * // any more data as shown in this example. There's no more data involved and padding
411  * // is not applicable for this finalization operation.
412  * operation.inputLength = 0;
413  *
414  * finalizeDecryptionResult = AESECB_finalize(handle, &operation);
415  * if (finalizeDecryptionResult != AESECB_STATUS_SUCCESS) {
416  * // handle error
417  * }
418  *
419  * }
420  *
421  * @endcode
422  */
423 
424 #ifndef ti_drivers_AESECB__include
425 #define ti_drivers_AESECB__include
426 
427 #include <stdbool.h>
428 #include <stddef.h>
429 #include <stdint.h>
430 
431 #include <ti/drivers/AESCommon.h>
433 
434 #ifdef __cplusplus
435 extern "C" {
436 #endif
437 
450 #define AESECB_STATUS_RESERVED AES_STATUS_RESERVED
451 
458 #define AESECB_STATUS_SUCCESS AES_STATUS_SUCCESS
459 
466 #define AESECB_STATUS_ERROR AES_STATUS_ERROR
467 
476 #define AESECB_STATUS_RESOURCE_UNAVAILABLE AES_STATUS_RESOURCE_UNAVAILABLE
477 
481 #define AESECB_STATUS_CANCELED AES_STATUS_CANCELED
482 
487 #define AESECB_STATUS_FEATURE_NOT_SUPPORTED AES_STATUS_FEATURE_NOT_SUPPORTED
488 
492 #define AESECB_STATUS_KEYSTORE_INVALID_ID AES_STATUS_KEYSTORE_INVALID_ID
493 
498 #define AESECB_STATUS_KEYSTORE_GENERIC_ERROR AES_STATUS_KEYSTORE_GENERIC_ERROR
499 
506 #define AESECB_STATUS_UNALIGNED_IO_NOT_SUPPORTED AES_STATUS_UNALIGNED_IO_NOT_SUPPORTED
507 
520 
524 typedef AESECB_Config *AESECB_Handle;
525 
547 typedef enum
548 {
567 
571 typedef enum
572 {
575 } AESECB_Mode;
576 
581 typedef struct
582 {
588  uint8_t *input;
595  uint8_t *output;
604  size_t inputLength;
623 
627 typedef enum
628 {
636 
652 typedef void (*AESECB_CallbackFxn)(AESECB_Handle handle,
653  int_fast16_t returnValue,
654  AESECB_Operation *operation,
655  AESECB_OperationType operationType);
656 
665 typedef struct
666 {
667  AESECB_ReturnBehavior returnBehavior;
669  uint32_t timeout;
672  void *custom;
675 } AESECB_Params;
676 
683 
692 void AESECB_init(void);
693 
707 
725 AESECB_Handle AESECB_open(uint_least8_t index, const AESECB_Params *params);
726 
736 void AESECB_close(AESECB_Handle handle);
737 
746 void AESECB_Operation_init(AESECB_Operation *operationStruct);
747 
768 int_fast16_t AESECB_oneStepEncrypt(AESECB_Handle handle, AESECB_Operation *operation);
769 
790 int_fast16_t AESECB_oneStepDecrypt(AESECB_Handle handle, AESECB_Operation *operation);
791 
809 int_fast16_t AESECB_setupEncrypt(AESECB_Handle handle, const CryptoKey *key);
810 
828 int_fast16_t AESECB_setupDecrypt(AESECB_Handle handle, const CryptoKey *key);
829 
852 int_fast16_t AESECB_addData(AESECB_Handle handle, AESECB_Operation *operation);
853 
873 int_fast16_t AESECB_finalize(AESECB_Handle handle, AESECB_Operation *operation);
874 
888 int_fast16_t AESECB_cancelOperation(AESECB_Handle handle);
889 
913 AESECB_Handle AESECB_construct(AESECB_Config *config, const AESECB_Params *params);
914 
915 #ifdef __cplusplus
916 }
917 #endif
918 
919 #endif /* ti_drivers_AESECB__include */
ADC_Params params
Definition: Driver_Init.h:11
AESECB_ReturnBehavior returnBehavior
Definition: AESECB.h:667
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:604
Definition: AESECB.h:573
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:198
Definition: AESECB.h:630
Definition: AESECB.h:561
Definition: AESCommon.h:186
Definition: AESCommon.h:196
ECB Parameters.
Definition: AESECB.h:665
void AESECB_init(void)
This function initializes the ECB module.
uint8_t * output
Definition: AESECB.h:595
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:519
Definition: AESCommon.h:192
AESECB_ReturnBehavior
The way in which ECB function calls return after performing an encryption + authentication or decrypt...
Definition: AESECB.h:547
CryptoKey * key
Definition: AESECB.h:583
Struct containing the parameters required for encrypting/decrypting and a message.
Definition: AESECB.h:581
uint8_t * input
Definition: AESECB.h:588
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:669
void AESECB_Operation_init(AESECB_Operation *operationStruct)
Function to initialize an AESECB_Operation struct to its defaults.
Definition: AESECB.h:629
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
Definition: AESECB.h:549
AESECB_Mode
Enum for the direction of the ECB operation.
Definition: AESECB.h:571
const AESECB_Params AESECB_defaultParams
Default AESECB_Params structure.
void * custom
Definition: AESECB.h:672
Definition: AESECB.h:556
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:627
AESECB_Config * AESECB_Handle
A handle that is returned from an AESECB_open() call.
Definition: AESECB.h:524
Definition: AESECB.h:574
AESECB_CallbackFxn callbackFxn
Definition: AESECB.h:668
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-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale