tests: use appropriate sys_randX_get()

use the appropriate sys_randX_get() instead
of always sys_rand32_get().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
Fin Maaß 2024-04-03 16:06:05 +02:00 committed by Mahesh Mahadevan
commit e354927895
37 changed files with 58 additions and 83 deletions

View file

@ -616,14 +616,7 @@ int default_CSPRNG(uint8_t *dest, unsigned int size)
/* This is not a CSPRNG, but it's the only thing available in the
* system at this point in time. */
while (size) {
uint32_t len = size >= sizeof(uint32_t) ? sizeof(uint32_t) : size;
uint32_t rv = sys_rand32_get();
memcpy(dest, &rv, len);
dest += len;
size -= len;
}
sys_rand_get(dest, size);
return 1;
}