mirror of https://github.com/ARMmbed/mbed-os.git
Enable HW AES
parent
31f1d03959
commit
a6151cf4c4
|
@ -31,12 +31,16 @@
|
||||||
* Get Random number generator.
|
* Get Random number generator.
|
||||||
*/
|
*/
|
||||||
static volatile int g_PRNG_done;
|
static volatile int g_PRNG_done;
|
||||||
|
volatile int g_AES_done;
|
||||||
|
|
||||||
void CRYPTO_IRQHandler()
|
void CRYPTO_IRQHandler()
|
||||||
{
|
{
|
||||||
if (PRNG_GET_INT_FLAG()) {
|
if (PRNG_GET_INT_FLAG()) {
|
||||||
g_PRNG_done = 1;
|
g_PRNG_done = 1;
|
||||||
PRNG_CLR_INT_FLAG();
|
PRNG_CLR_INT_FLAG();
|
||||||
|
} else if (AES_GET_INT_FLAG()) {
|
||||||
|
g_AES_done = 1;
|
||||||
|
AES_CLR_INT_FLAG();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +90,7 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
|
||||||
memcpy(output, &tmpBuff, length);
|
memcpy(output, &tmpBuff, length);
|
||||||
*output_length = length;
|
*output_length = length;
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < (length/32); i++) {
|
for (int i = 0; i < (length/32); i++) {
|
||||||
trng_get(output);
|
trng_get(output);
|
||||||
*output_length += 32;
|
*output_length += 32;
|
||||||
output += 32;
|
output += 32;
|
||||||
|
|
Loading…
Reference in New Issue