32 #ifndef VSMC_RNGC_PHILOX_H 33 #define VSMC_RNGC_PHILOX_H 101 if (++ctr->
v[2] != 0)
103 if (++ctr->
v[3] != 0)
110 par->
v[0] = key->
v[0];
116 par->
v[0] = key->
v[0];
117 par->
v[1] = key->
v[1];
144 state->
v[0] = hi ^ (state->
v[1]);
168 state->
v[0] = hi0 ^ (state->
v[1]);
170 state->
v[2] = hi2 ^ (state->
v[3]);
241 rng->
key.
v[0] = seed;
254 rng->
key.
v[0] = seed;
263 if (rng->
index == 2) {
276 if (rng->
index == 4) {
285 #endif // VSMC_RNGC_PHILOX_H
static void vsmc_philox2x32_round(vsmc_philox2x32_ctr_t *state, const vsmc_philox2x32_par_t *par)
vsmc_philox2x32_ctr_t ctr
vsmc_philox4x32_ctr_t ctr
Philox4x32 RNG state structure.
static void vsmc_philox2x32_initpar(const vsmc_philox2x32_key_t *key, vsmc_philox2x32_par_t *par)
Philox2x32 RNG state structure.
static void vsmc_philox4x32_initpar(const vsmc_philox4x32_key_t *key, vsmc_philox4x32_par_t *par)
static void vsmc_philox4x32_bumpkey(vsmc_philox4x32_par_t *par)
static void vsmc_philox4x32_gen(const vsmc_philox4x32_ctr_t *ctr, const vsmc_philox4x32_key_t *key, vsmc_philox4x32_ctr_t *state)
Generate Philox4x32 RNG state.
vsmc_philox2x32_ctr_t state
static void vsmc_philox2x32_init(vsmc_philox2x32 *rng, uint32_t seed)
Initialize Philox2x32 RNG state.
static uint32_t vsmc_philox2x32_rand(vsmc_philox2x32 *rng)
Generate random 32-bits integers from Philox2x32 RNG.
static void vsmc_philox2x32_gen(const vsmc_philox2x32_ctr_t *ctr, const vsmc_philox2x32_key_t *key, vsmc_philox2x32_ctr_t *state)
Generate Philox2x32 RNG state.
static void vsmc_philox2x32_bumpkey(vsmc_philox2x32_par_t *par)
vsmc_philox4x32_ctr_t state
#define VSMC_STATIC_INLINE
static uint32_t vsmc_philox4x32_rand(vsmc_philox4x32 *rng)
Generate random 32-bits integers from Philox4x32 RNG.
vsmc_philox2x32_key_t key
static void vsmc_philox4x32_init(vsmc_philox4x32 *rng, uint32_t seed)
Initialize Philox4x32 RNG state.
static void vsmc_philox4x32_round(vsmc_philox4x32_ctr_t *state, const vsmc_philox4x32_par_t *par)
vsmc_philox4x32_key_t key
static void vsmc_philox4x32_inc(vsmc_philox4x32_ctr_t *ctr)
static void vsmc_philox2x32_inc(vsmc_philox2x32_ctr_t *ctr)