mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-30 03:31:11 -04:00
consume fewer random bytes for slab randomization
This commit is contained in:
parent
c5d76179a5
commit
2b7c9362bb
3 changed files with 37 additions and 14 deletions
7
random.h
7
random.h
|
@ -10,10 +10,11 @@ struct random_state {
|
|||
uint8_t cache[RANDOM_CACHE_SIZE];
|
||||
};
|
||||
|
||||
void get_random_seed(void *buf, size_t size);
|
||||
void random_state_init(struct random_state *state);
|
||||
void get_random_bytes(struct random_state *state, void *buf, size_t size);
|
||||
size_t get_random_size(struct random_state *state);
|
||||
size_t get_random_size_uniform(struct random_state *state, size_t bound);
|
||||
uint16_t get_random_u16(struct random_state *state);
|
||||
uint16_t get_random_u16_uniform(struct random_state *state, uint16_t bound);
|
||||
uint64_t get_random_u64(struct random_state *state);
|
||||
uint64_t get_random_u64_uniform(struct random_state *state, uint64_t bound);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue