random + rdrand
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <zinnia/initgraph.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct random_source {
|
||||
const char* name;
|
||||
uint8_t quality;
|
||||
|
||||
bool (*get_u64)(struct random_source* source, uint64_t* out);
|
||||
};
|
||||
|
||||
// Registers a source of randomness. Returns true if it is now the active source.
|
||||
bool random_register(struct random_source* source);
|
||||
|
||||
void random_fill(void* buf, size_t len);
|
||||
|
||||
INIT_EXTERN(random_stage);
|
||||
Reference in New Issue
Block a user