Skip to content

Commit c1b8509

Browse files
committed
[NUC472] Enable HW AES
1 parent a894f2e commit c1b8509

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

targets/TARGET_NUVOTON/TARGET_NUC472/trng_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@
3131
* Get Random number generator.
3232
*/
3333
static volatile int g_PRNG_done;
34+
volatile int g_AES_done;
3435

3536
void CRYPTO_IRQHandler()
3637
{
3738
if (PRNG_GET_INT_FLAG()) {
3839
g_PRNG_done = 1;
3940
PRNG_CLR_INT_FLAG();
41+
} else if (AES_GET_INT_FLAG()) {
42+
g_AES_done = 1;
43+
AES_CLR_INT_FLAG();
4044
}
4145
}
4246

@@ -86,7 +90,7 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
8690
memcpy(output, &tmpBuff, length);
8791
*output_length = length;
8892
} else {
89-
for (size_t i = 0; i < (length/32); i++) {
93+
for (int i = 0; i < (length/32); i++) {
9094
trng_get(output);
9195
*output_length += 32;
9296
output += 32;

0 commit comments

Comments
 (0)