implement a cache for the CSPRNG

This commit is contained in:
Daniel Micay 2018-08-23 16:30:44 -04:00
parent 70d61b6662
commit daa44905ee
2 changed files with 26 additions and 5 deletions

View file

@ -1,8 +1,13 @@
#ifndef RANDOM_H
#define RANDOM_H
#include <stdint.h>
#define RANDOM_CACHE_SIZE 4096
struct random_state {
char unused;
size_t index;
uint8_t cache[RANDOM_CACHE_SIZE];
};
void get_random_seed(void *buf, size_t size);