AESECB.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021, 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, it is not recommended
47  * that ECB be used unless interfacing with legacy systems that can't 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 datastructures 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/cryptouils/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  * ### Single call 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  * operation.key = &cryptoKey;
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  * operation.input = plaintext + AES_BLOCK_SIZE;
306  * operation.output = ciphertext + AES_BLOCK_SIZE;
307  * // Input length must either be a non-zero multiple of block-size (16 bytes)
308  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
309  * // any more data. The user or application should take care of necessary padding
310  * // for the last block of data.
311  * operation.inputLength = AES_BLOCK_SIZE;
312  *
313  * finalizeEncryptionResult = AESECB_finalize(handle, &operation);
314  * if (finalizeEncryptionResult != AESECB_STATUS_SUCCESS) {
315  * // handle error
316  * }
317  *
318  * // The resultant ciphertext should be:
319  * // 0x3a, 0xd7, 0x7b, 0xb4, 0x0d, 0x7a, 0x36, 0x60,
320  * // 0xa8, 0x9e, 0xca, 0xf3, 0x24, 0x66, 0xef, 0x97,
321  * // 0xf5, 0xd3, 0xd5, 0x85, 0x03, 0xb9, 0x69, 0x9d,
322  * // 0xe7, 0x85, 0x89, 0x5a, 0x96, 0xfd, 0xba, 0xaf
323  *
324  *
325  * AESECB_close(handle);
326  *
327  * }
328  *
329  * @endcode
330  *
331  * ### Multi-step ECB decryption in callback mode #
332  * @code
333  *
334  * #include <ti/drivers/AESECB.h>
335  * #include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
336  *
337  * #define AES_BLOCK_SIZE 16 // bytes
338  *
339  * ...
340  * uint8_t ciphertext[] = {0xf3, 0xee, 0xd1, 0xbd, 0xb5, 0xd2, 0xa0, 0x3c,
341  * 0x06, 0x4b, 0x5a, 0x7e, 0x3d, 0xb1, 0x81, 0xf8};
342  * uint8_t keyingMaterial[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe,
343  * 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,
344  * 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7,
345  * 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4};
346  * uint8_t plaintext[sizeof(ciphertext)];
347  *
348  * // The plaintext should be the following after the decryption operation:
349  * // 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
350  * // 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
351  *
352  *
353  * void ecbCallback(AESECB_Handle handle,
354  * int_fast16_t returnValue,
355  * AESECB_Operation *operation,
356  * AESECB_OperationType operationType) {
357  *
358  * if (returnValue != AESECB_STATUS_SUCCESS) {
359  * // handle error
360  * }
361  * }
362  *
363  * AESECB_Operation operation;
364  *
365  * void ecbStartFunction(void) {
366  * AESECB_Handle handle;
367  * AESECB_Params params;
368  * CryptoKey cryptoKey;
369  * int_fast16_t decryptionResult;
370  * int_fast16_t setupDecryptionResult;
371  * int_fast16_t finalizeDecryptionResult;
372  *
373  * AESECB_Params_init(&params);
374  * params.returnBehavior = AESECB_RETURN_BEHAVIOR_CALLBACK;
375  * params.callbackFxn = ecbCallback;
376  *
377  * handle = AESECB_open(0, &params);
378  *
379  * if (handle == NULL) {
380  * // handle error
381  * }
382  *
383  * CryptoKeyPlaintext_initKey(&cryptoKey, keyingMaterial, sizeof(keyingMaterial));
384  *
385  * setupDecryptionResult = AESECB_setupDecrypt(handle, &cryptoKey);
386  * if (setupDecryptionResult != AESECB_STATUS_SUCCESS) {
387  * // handle error
388  * }
389  *
390  * AESECB_Operation_init(&operation);
391  *
392  * operation.key = &cryptoKey;
393  * operation.input = plaintext;
394  * operation.output = ciphertext;
395  * // Input length must be a non-zero multiple of block-size (16 bytes) for calling
396  * // #AESECB_addData(). The user or application should take care of necessary padding
397  * // if the final block of data is being added for the entire segmented operation.
398  * operation.inputLength = AES_BLOCK_SIZE;
399  *
400  * decryptionResult = AESECB_addData(handle, &operation);
401  * if (decryptionResult != AESECB_STATUS_SUCCESS) {
402  * // handle error
403  * }
404  *
405  * // do other things while ECB operation completes in the background
406  *
407  * // Input length must either be a non-zero multiple of block-size (16 bytes)
408  * // for calling #AESECB_finalize(), or it could be zero in case of finalizing without
409  * // any more data as shown in this example. There's no more data involved and padding
410  * // is not applicable for this finalization operation.
411  * operation.inputLength = 0;
412  *
413  * finalizeDecryptionResult = AESECB_finalize(handle, &operation);
414  * if (finalizeDecryptionResult != AESECB_STATUS_SUCCESS) {
415  * // handle error
416  * }
417  *
418  * }
419  *
420  * @endcode
421  */
422 
423 #ifndef ti_drivers_AESECB__include
424 #define ti_drivers_AESECB__include
425 
426 #include <stdbool.h>
427 #include <stddef.h>
428 #include <stdint.h>
429 
431 
432 #ifdef __cplusplus
433 extern "C" {
434 #endif
435 
448 #define AESECB_STATUS_RESERVED (-32)
449 
456 #define AESECB_STATUS_SUCCESS (0)
457 
464 #define AESECB_STATUS_ERROR (-1)
465 
474 #define AESECB_STATUS_RESOURCE_UNAVAILABLE (-2)
475 
479 #define AESECB_STATUS_CANCELED (-3)
480 
492 typedef struct {
494  void *object;
495 
497  void const *hwAttrs;
498 } AESECB_Config;
499 
504 
526 typedef enum {
542 
546 typedef enum {
549 } AESECB_Mode;
550 
555 typedef struct {
557  uint8_t *input;
564  uint8_t *output;
573  size_t inputLength;
590 
594 typedef enum {
602 
618 typedef void (*AESECB_CallbackFxn) (AESECB_Handle handle,
619  int_fast16_t returnValue,
620  AESECB_Operation *operation,
621  AESECB_OperationType operationType);
622 
631 typedef struct {
634  uint32_t timeout;
637  void *custom;
640 } AESECB_Params;
641 
648 
657 void AESECB_init(void);
658 
672 
690 AESECB_Handle AESECB_open(uint_least8_t index, const AESECB_Params *params);
691 
701 void AESECB_close(AESECB_Handle handle);
702 
711 void AESECB_Operation_init(AESECB_Operation *operationStruct);
712 
731 int_fast16_t AESECB_oneStepEncrypt(AESECB_Handle handle, AESECB_Operation *operation);
732 
751 int_fast16_t AESECB_oneStepDecrypt(AESECB_Handle handle, AESECB_Operation *operation);
752 
770 int_fast16_t AESECB_setupEncrypt(AESECB_Handle handle, const CryptoKey *key);
771 
789 int_fast16_t AESECB_setupDecrypt(AESECB_Handle handle, const CryptoKey *key);
790 
811 int_fast16_t AESECB_addData(AESECB_Handle handle,
812  AESECB_Operation * operation);
813 
831 int_fast16_t AESECB_finalize(AESECB_Handle handle,
832  AESECB_Operation * operation);
833 
846 int_fast16_t AESECB_cancelOperation(AESECB_Handle handle);
847 
871 AESECB_Handle AESECB_construct(AESECB_Config *config, const AESECB_Params *params);
872 
873 #ifdef __cplusplus
874 }
875 #endif
876 
877 #endif /* ti_drivers_AESECB__include */
void * object
Definition: AESECB.h:494
ADC_Params params
Definition: Driver_Init.h:11
AESECB_ReturnBehavior returnBehavior
Definition: AESECB.h:632
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:573
Definition: AESECB.h:547
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:192
Definition: AESECB.h:596
Definition: AESECB.h:537
ECB Parameters.
Definition: AESECB.h:631
void AESECB_init(void)
This function initializes the ECB module.
uint8_t * output
Definition: AESECB.h:564
void AESECB_Params_init(AESECB_Params *params)
Function to initialize the AESECB_Params struct to its defaults.
AESECB_ReturnBehavior
The way in which ECB function calls return after performing an encryption + authentication or decrypt...
Definition: AESECB.h:526
CryptoKey * key
Definition: AESECB.h:556
Struct containing the parameters required for encrypting/decrypting and a message.
Definition: AESECB.h:555
uint8_t * input
Definition: AESECB.h:557
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:634
void AESECB_Operation_init(AESECB_Operation *operationStruct)
Function to initialize an AESECB_Operation struct to its defaults.
Definition: AESECB.h:595
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:618
Definition: AESECB.h:527
AESECB_Mode
Enum for the direction of the ECB operation.
Definition: AESECB.h:546
const AESECB_Params AESECB_defaultParams
Default AESECB_Params structure.
void * custom
Definition: AESECB.h:637
Definition: AESECB.h:533
int_fast16_t AESECB_setupDecrypt(AESECB_Handle handle, const CryptoKey *key)
Function to prepare a segmented AESECB decryption operation.
AESECB_OperationType
Enum for the operation types supported by the driver.
Definition: AESECB.h:594
AESECB_Config * AESECB_Handle
A handle that is returned from an AESECB_open() call.
Definition: AESECB.h:503
Definition: AESECB.h:548
AESECB_CallbackFxn callbackFxn
Definition: AESECB.h:633
void const * hwAttrs
Definition: AESECB.h:497
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...
AESECB Global configuration.
Definition: AESECB.h:492
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale