1 2#ifndef __RNG_H__ 3#define __RNG_H__ 4 5struct rng_ctx { 6 int32_t iy; 7 int32_t iv[32]; /* shuffle array */ 8 int32_t seed; 9}; 10 11 12void 13rng_init(struct rng_ctx *ctx); 14 15int32_t 16rng_rand(struct rng_ctx *ctx); 17 18int32_t 19rng_rand_range(struct rng_ctx *ctx, int32_t min, int32_t max); 20 21void 22shuffle_ptr(struct rng_ctx *ctx, void **values, int len); 23 24#endif /* !__RNG_H__ */ 25 26