core: add random number generator

This commit is contained in:
2024-10-24 21:33:05 +01:00
parent d0dcee9c6f
commit 44fb8593a5
8 changed files with 505 additions and 3 deletions

17
core/random.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef _BLUELIB_RANDOM_H_
#define _BLUELIB_RANDOM_H_
#include <stdint.h>
struct b_random_ctx;
struct b_random_algorithm {
const char *gen_name;
void(*gen_init)(struct b_random_ctx *, unsigned long long seed);
uint64_t(*gen_getrand)(struct b_random_ctx *);
};
extern uint64_t z__b_platform_random_seed();
extern uint64_t z__b_platform_random_seed_secure();
#endif