mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-04-17 21:58:27 +00:00
Fix bug of not refilling after random bytes are requested.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
c2733e8977
commit
f7553a0a75
1 changed files with 2 additions and 0 deletions
2
random.c
2
random.c
|
|
@ -49,11 +49,13 @@ void random_fini (void)
|
|||
/*
|
||||
* Return pointer to random 32-byte
|
||||
*/
|
||||
void random_bytes_free (const uint8_t *p);
|
||||
const uint8_t * random_bytes_get (void)
|
||||
{
|
||||
static uint32_t return_word[RANDOM_BYTES_LENGTH/sizeof (uint32_t)];
|
||||
neug_wait_full ();
|
||||
memcpy(return_word, random_word, sizeof(return_word));
|
||||
random_bytes_free((const uint8_t *)random_word);
|
||||
return (const uint8_t *)return_word;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue