2 ******************************************************************************
\r
3 * @file stm32l1xx_aes_util.c
\r
4 * @author MCD Application Team
\r
6 * @date 05-March-2012
\r
7 * @brief This file provides high level functions to encrypt and decrypt an
\r
8 * input message using AES in ECB/CBC/CTR modes.
\r
12 ================================================================================
\r
13 ##### How to use this driver #####
\r
14 ================================================================================
\r
16 (#) Enable The AES controller clock using
\r
17 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_AES, ENABLE); function.
\r
19 (#) Use AES_ECB_Encrypt() function to encrypt an input message in ECB mode.
\r
20 (#) Use AES_ECB_Decrypt() function to decrypt an input message in ECB mode.
\r
22 (#) Use AES_CBC_Encrypt() function to encrypt an input message in CBC mode.
\r
23 (#) Use AES_CBC_Decrypt() function to decrypt an input message in CBC mode.
\r
25 (#) Use AES_CTR_Encrypt() function to encrypt an input message in CTR mode.
\r
26 (#) Use AES_CTR_Decrypt() function to decrypt an input message in CTR mode.
\r
30 ******************************************************************************
\r
33 * <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
\r
35 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
\r
36 * You may not use this file except in compliance with the License.
\r
37 * You may obtain a copy of the License at:
\r
39 * http://www.st.com/software_license_agreement_liberty_v2
\r
41 * Unless required by applicable law or agreed to in writing, software
\r
42 * distributed under the License is distributed on an "AS IS" BASIS,
\r
43 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
44 * See the License for the specific language governing permissions and
\r
45 * limitations under the License.
\r
47 ******************************************************************************
\r
50 /* Includes ------------------------------------------------------------------*/
\r
51 #include "stm32l1xx_aes.h"
\r
53 /** @addtogroup STM32L1xx_StdPeriph_Driver
\r
57 /** @addtogroup AES
\r
58 * @brief AES driver modules
\r
62 /* Private typedef -----------------------------------------------------------*/
\r
63 /* Private define ------------------------------------------------------------*/
\r
64 #define AES_CC_TIMEOUT ((uint32_t) 0x00010000)
\r
66 /* Private macro -------------------------------------------------------------*/
\r
67 /* Private variables ---------------------------------------------------------*/
\r
68 /* Private function prototypes -----------------------------------------------*/
\r
69 /* Private functions ---------------------------------------------------------*/
\r
71 /** @defgroup AES_Private_Functions
\r
75 /** @defgroup AES_Group6 High Level AES functions
\r
76 * @brief High Level AES functions
\r
79 ================================================================================
\r
80 ##### High Level AES functions #####
\r
81 ================================================================================
\r
88 * @brief Encrypt using AES in ECB Mode
\r
89 * @param Key: Key used for AES algorithm.
\r
90 * @param Input: pointer to the Input buffer.
\r
91 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
92 * @param Output: pointer to the returned buffer.
\r
93 * @retval An ErrorStatus enumeration value:
\r
94 * - SUCCESS: Operation done
\r
95 * - ERROR: Operation failed
\r
97 ErrorStatus AES_ECB_Encrypt(uint8_t* Key, uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
99 AES_InitTypeDef AES_InitStructure;
\r
100 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
101 ErrorStatus status = SUCCESS;
\r
102 uint32_t keyaddr = (uint32_t)Key;
\r
103 uint32_t inputaddr = (uint32_t)Input;
\r
104 uint32_t outputaddr = (uint32_t)Output;
\r
105 __IO uint32_t counter = 0;
\r
106 uint32_t ccstatus = 0;
\r
109 /* AES Key initialisation */
\r
110 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
112 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
114 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
116 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
117 AES_KeyInit(&AES_KeyInitStructure);
\r
119 /* AES configuration */
\r
120 AES_InitStructure.AES_Operation = AES_Operation_Encryp;
\r
121 AES_InitStructure.AES_Chaining = AES_Chaining_ECB;
\r
122 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
123 AES_Init(&AES_InitStructure);
\r
128 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
130 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
132 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
134 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
136 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
139 /* Wait for CCF flag to be set */
\r
143 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
145 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
147 if (ccstatus == RESET)
\r
153 /* Clear CCF flag */
\r
154 AES_ClearFlag(AES_FLAG_CCF);
\r
155 /* Read cipher text */
\r
156 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
158 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
160 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
162 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
167 /* Disable AES before starting new processing */
\r
174 * @brief Decrypt using AES in ECB Mode
\r
175 * @param Key: Key used for AES algorithm.
\r
176 * @param Input: pointer to the Input buffer.
\r
177 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
178 * @param Output: pointer to the returned buffer.
\r
179 * @retval An ErrorStatus enumeration value:
\r
180 * - SUCCESS: Operation done
\r
181 * - ERROR: Operation failed
\r
183 ErrorStatus AES_ECB_Decrypt(uint8_t* Key, uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
185 AES_InitTypeDef AES_InitStructure;
\r
186 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
187 ErrorStatus status = SUCCESS;
\r
188 uint32_t keyaddr = (uint32_t)Key;
\r
189 uint32_t inputaddr = (uint32_t)Input;
\r
190 uint32_t outputaddr = (uint32_t)Output;
\r
191 __IO uint32_t counter = 0;
\r
192 uint32_t ccstatus = 0;
\r
195 /* AES Key initialisation */
\r
196 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
198 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
200 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
202 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
203 AES_KeyInit(&AES_KeyInitStructure);
\r
205 /* AES configuration */
\r
206 AES_InitStructure.AES_Operation = AES_Operation_KeyDerivAndDecryp;
\r
207 AES_InitStructure.AES_Chaining = AES_Chaining_ECB;
\r
208 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
209 AES_Init(&AES_InitStructure);
\r
214 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
216 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
218 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
220 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
222 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
225 /* Wait for CCF flag to be set */
\r
229 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
231 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
233 if (ccstatus == RESET)
\r
239 /* Clear CCF flag */
\r
240 AES_ClearFlag(AES_FLAG_CCF);
\r
242 /* Read cipher text */
\r
243 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
245 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
247 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
249 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
254 /* Disable AES before starting new processing */
\r
261 * @brief Encrypt using AES in CBC Mode
\r
262 * @param InitVectors: Initialisation Vectors used for AES algorithm.
\r
263 * @param Key: Key used for AES algorithm.
\r
264 * @param Input: pointer to the Input buffer.
\r
265 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
266 * @param Output: pointer to the returned buffer.
\r
267 * @retval An ErrorStatus enumeration value:
\r
268 * - SUCCESS: Operation done
\r
269 * - ERROR: Operation failed
\r
271 ErrorStatus AES_CBC_Encrypt(uint8_t* Key, uint8_t InitVectors[16], uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
273 AES_InitTypeDef AES_InitStructure;
\r
274 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
275 AES_IVInitTypeDef AES_IVInitStructure;
\r
276 ErrorStatus status = SUCCESS;
\r
277 uint32_t keyaddr = (uint32_t)Key;
\r
278 uint32_t inputaddr = (uint32_t)Input;
\r
279 uint32_t outputaddr = (uint32_t)Output;
\r
280 uint32_t ivaddr = (uint32_t)InitVectors;
\r
281 __IO uint32_t counter = 0;
\r
282 uint32_t ccstatus = 0;
\r
285 /* AES Key initialisation*/
\r
286 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
288 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
290 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
292 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
293 AES_KeyInit(&AES_KeyInitStructure);
\r
295 /* AES Initialization Vectors */
\r
296 AES_IVInitStructure.AES_IV3 = __REV(*(uint32_t*)(ivaddr));
\r
298 AES_IVInitStructure.AES_IV2 = __REV(*(uint32_t*)(ivaddr));
\r
300 AES_IVInitStructure.AES_IV1 = __REV(*(uint32_t*)(ivaddr));
\r
302 AES_IVInitStructure.AES_IV0 = __REV(*(uint32_t*)(ivaddr));
\r
303 AES_IVInit(&AES_IVInitStructure);
\r
305 /* AES configuration */
\r
306 AES_InitStructure.AES_Operation = AES_Operation_Encryp;
\r
307 AES_InitStructure.AES_Chaining = AES_Chaining_CBC;
\r
308 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
309 AES_Init(&AES_InitStructure);
\r
314 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
316 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
318 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
320 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
322 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
325 /* Wait for CCF flag to be set */
\r
329 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
331 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
333 if (ccstatus == RESET)
\r
339 /* Clear CCF flag */
\r
340 AES_ClearFlag(AES_FLAG_CCF);
\r
342 /* Read cipher text */
\r
343 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
345 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
347 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
349 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
354 /* Disable AES before starting new processing */
\r
361 * @brief Decrypt using AES in CBC Mode
\r
362 * @param InitVectors: Initialisation Vectors used for AES algorithm.
\r
363 * @param Key: Key used for AES algorithm.
\r
364 * @param Input: pointer to the Input buffer.
\r
365 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
366 * @param Output: pointer to the returned buffer.
\r
367 * @retval An ErrorStatus enumeration value:
\r
368 * - SUCCESS: Operation done
\r
369 * - ERROR: Operation failed
\r
371 ErrorStatus AES_CBC_Decrypt(uint8_t* Key, uint8_t InitVectors[16], uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
373 AES_InitTypeDef AES_InitStructure;
\r
374 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
375 AES_IVInitTypeDef AES_IVInitStructure;
\r
376 ErrorStatus status = SUCCESS;
\r
377 uint32_t keyaddr = (uint32_t)Key;
\r
378 uint32_t inputaddr = (uint32_t)Input;
\r
379 uint32_t outputaddr = (uint32_t)Output;
\r
380 uint32_t ivaddr = (uint32_t)InitVectors;
\r
381 __IO uint32_t counter = 0;
\r
382 uint32_t ccstatus = 0;
\r
385 /* AES Key initialisation*/
\r
386 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
388 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
390 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
392 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
393 AES_KeyInit(&AES_KeyInitStructure);
\r
395 /* AES Initialization Vectors */
\r
396 AES_IVInitStructure.AES_IV3 = __REV(*(uint32_t*)(ivaddr));
\r
398 AES_IVInitStructure.AES_IV2 = __REV(*(uint32_t*)(ivaddr));
\r
400 AES_IVInitStructure.AES_IV1 = __REV(*(uint32_t*)(ivaddr));
\r
402 AES_IVInitStructure.AES_IV0 = __REV(*(uint32_t*)(ivaddr));
\r
403 AES_IVInit(&AES_IVInitStructure);
\r
405 /* AES configuration */
\r
406 AES_InitStructure.AES_Operation = AES_Operation_KeyDerivAndDecryp;
\r
407 AES_InitStructure.AES_Chaining = AES_Chaining_CBC;
\r
408 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
409 AES_Init(&AES_InitStructure);
\r
414 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
416 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
418 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
420 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
422 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
425 /* Wait for CCF flag to be set */
\r
429 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
431 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
433 if (ccstatus == RESET)
\r
439 /* Clear CCF flag */
\r
440 AES_ClearFlag(AES_FLAG_CCF);
\r
442 /* Read cipher text */
\r
443 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
445 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
447 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
449 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
454 /* Disable AES before starting new processing */
\r
461 * @brief Encrypt using AES in CTR Mode
\r
462 * @param InitVectors: Initialisation Vectors used for AES algorithm.
\r
463 * @param Key: Key used for AES algorithm.
\r
464 * @param Input: pointer to the Input buffer.
\r
465 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
466 * @param Output: pointer to the returned buffer.
\r
467 * @retval An ErrorStatus enumeration value:
\r
468 * - SUCCESS: Operation done
\r
469 * - ERROR: Operation failed
\r
471 ErrorStatus AES_CTR_Encrypt(uint8_t* Key, uint8_t InitVectors[16], uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
473 AES_InitTypeDef AES_InitStructure;
\r
474 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
475 AES_IVInitTypeDef AES_IVInitStructure;
\r
477 ErrorStatus status = SUCCESS;
\r
478 uint32_t keyaddr = (uint32_t)Key;
\r
479 uint32_t inputaddr = (uint32_t)Input;
\r
480 uint32_t outputaddr = (uint32_t)Output;
\r
481 uint32_t ivaddr = (uint32_t)InitVectors;
\r
482 __IO uint32_t counter = 0;
\r
483 uint32_t ccstatus = 0;
\r
486 /* AES key initialisation*/
\r
487 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
489 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
491 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
493 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
494 AES_KeyInit(&AES_KeyInitStructure);
\r
496 /* AES Initialization Vectors */
\r
497 AES_IVInitStructure.AES_IV3 = __REV(*(uint32_t*)(ivaddr));
\r
499 AES_IVInitStructure.AES_IV2= __REV(*(uint32_t*)(ivaddr));
\r
501 AES_IVInitStructure.AES_IV1 = __REV(*(uint32_t*)(ivaddr));
\r
503 AES_IVInitStructure.AES_IV0= __REV(*(uint32_t*)(ivaddr));
\r
504 AES_IVInit(&AES_IVInitStructure);
\r
506 /* AES configuration */
\r
507 AES_InitStructure.AES_Operation = AES_Operation_Encryp;
\r
508 AES_InitStructure.AES_Chaining = AES_Chaining_CTR;
\r
509 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
510 AES_Init(&AES_InitStructure);
\r
515 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
517 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
519 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
521 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
523 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
526 /* Wait for CCF flag to be set */
\r
530 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
532 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
534 if (ccstatus == RESET)
\r
540 /* Clear CCF flag */
\r
541 AES_ClearFlag(AES_FLAG_CCF);
\r
543 /* Read cipher text */
\r
544 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
546 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
548 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
550 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
555 /* Disable AES before starting new processing */
\r
562 * @brief Decrypt using AES in CTR Mode
\r
563 * @param InitVectors: Initialisation Vectors used for AES algorithm.
\r
564 * @param Key: Key used for AES algorithm.
\r
565 * @param Input: pointer to the Input buffer.
\r
566 * @param Ilength: length of the Input buffer, must be a multiple of 16 bytes.
\r
567 * @param Output: pointer to the returned buffer.
\r
568 * @retval An ErrorStatus enumeration value:
\r
569 * - SUCCESS: Operation done
\r
570 * - ERROR: Operation failed
\r
572 ErrorStatus AES_CTR_Decrypt(uint8_t* Key, uint8_t InitVectors[16], uint8_t* Input, uint32_t Ilength, uint8_t* Output)
\r
574 AES_InitTypeDef AES_InitStructure;
\r
575 AES_KeyInitTypeDef AES_KeyInitStructure;
\r
576 AES_IVInitTypeDef AES_IVInitStructure;
\r
578 ErrorStatus status = SUCCESS;
\r
579 uint32_t keyaddr = (uint32_t)Key;
\r
580 uint32_t inputaddr = (uint32_t)Input;
\r
581 uint32_t outputaddr = (uint32_t)Output;
\r
582 uint32_t ivaddr = (uint32_t)InitVectors;
\r
583 __IO uint32_t counter = 0;
\r
584 uint32_t ccstatus = 0;
\r
587 /* AES Key initialisation*/
\r
588 AES_KeyInitStructure.AES_Key3 = __REV(*(uint32_t*)(keyaddr));
\r
590 AES_KeyInitStructure.AES_Key2 = __REV(*(uint32_t*)(keyaddr));
\r
592 AES_KeyInitStructure.AES_Key1 = __REV(*(uint32_t*)(keyaddr));
\r
594 AES_KeyInitStructure.AES_Key0 = __REV(*(uint32_t*)(keyaddr));
\r
595 AES_KeyInit(&AES_KeyInitStructure);
\r
597 /* AES Initialization Vectors */
\r
598 AES_IVInitStructure.AES_IV3 = __REV(*(uint32_t*)(ivaddr));
\r
600 AES_IVInitStructure.AES_IV2 = __REV(*(uint32_t*)(ivaddr));
\r
602 AES_IVInitStructure.AES_IV1 = __REV(*(uint32_t*)(ivaddr));
\r
604 AES_IVInitStructure.AES_IV0 = __REV(*(uint32_t*)(ivaddr));
\r
605 AES_IVInit(&AES_IVInitStructure);
\r
607 /* AES configuration */
\r
608 AES_InitStructure.AES_Operation = AES_Operation_KeyDerivAndDecryp;
\r
609 AES_InitStructure.AES_Chaining = AES_Chaining_CTR;
\r
610 AES_InitStructure.AES_DataType = AES_DataType_8b;
\r
611 AES_Init(&AES_InitStructure);
\r
616 for(i = 0; ((i < Ilength) && (status != ERROR)); i += 16)
\r
618 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
620 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
622 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
624 AES_WriteSubData(*(uint32_t*)(inputaddr));
\r
627 /* Wait for CCF flag to be set */
\r
631 ccstatus = AES_GetFlagStatus(AES_FLAG_CCF);
\r
633 }while((counter != AES_CC_TIMEOUT) && (ccstatus == RESET));
\r
635 if (ccstatus == RESET)
\r
641 /* Clear CCF flag */
\r
642 AES_ClearFlag(AES_FLAG_CCF);
\r
644 /* Read cipher text */
\r
645 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
647 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
649 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
651 *(uint32_t*)(outputaddr) = AES_ReadSubData();
\r
656 /* Disable AES before starting new processing */
\r
678 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r