Lines Matching refs:state

52 u32 prandom_u32_state(struct rnd_state *state)  in prandom_u32_state()  argument
55 state->s1 = TAUSWORTHE(state->s1, 6U, 13U, 4294967294U, 18U); in prandom_u32_state()
56 state->s2 = TAUSWORTHE(state->s2, 2U, 27U, 4294967288U, 2U); in prandom_u32_state()
57 state->s3 = TAUSWORTHE(state->s3, 13U, 21U, 4294967280U, 7U); in prandom_u32_state()
58 state->s4 = TAUSWORTHE(state->s4, 3U, 12U, 4294967168U, 13U); in prandom_u32_state()
60 return (state->s1 ^ state->s2 ^ state->s3 ^ state->s4); in prandom_u32_state()
74 void prandom_bytes_state(struct rnd_state *state, void *buf, size_t bytes) in prandom_bytes_state() argument
79 put_unaligned(prandom_u32_state(state), (u32 *) ptr); in prandom_bytes_state()
85 u32 rem = prandom_u32_state(state); in prandom_bytes_state()
95 static void prandom_warmup(struct rnd_state *state) in prandom_warmup() argument
98 prandom_u32_state(state); in prandom_warmup()
99 prandom_u32_state(state); in prandom_warmup()
100 prandom_u32_state(state); in prandom_warmup()
101 prandom_u32_state(state); in prandom_warmup()
102 prandom_u32_state(state); in prandom_warmup()
103 prandom_u32_state(state); in prandom_warmup()
104 prandom_u32_state(state); in prandom_warmup()
105 prandom_u32_state(state); in prandom_warmup()
106 prandom_u32_state(state); in prandom_warmup()
107 prandom_u32_state(state); in prandom_warmup()
115 struct rnd_state *state = per_cpu_ptr(pcpu_state, i); in prandom_seed_full_state() local
119 state->s1 = __seed(seeds[0], 2U); in prandom_seed_full_state()
120 state->s2 = __seed(seeds[1], 8U); in prandom_seed_full_state()
121 state->s3 = __seed(seeds[2], 16U); in prandom_seed_full_state()
122 state->s4 = __seed(seeds[3], 128U); in prandom_seed_full_state()
124 prandom_warmup(state); in prandom_seed_full_state()
248 static void prandom_state_selftest_seed(struct rnd_state *state, u32 seed) in prandom_state_selftest_seed() argument
251 state->s1 = __seed(LCG(seed), 2U); in prandom_state_selftest_seed()
252 state->s2 = __seed(LCG(state->s1), 8U); in prandom_state_selftest_seed()
253 state->s3 = __seed(LCG(state->s2), 16U); in prandom_state_selftest_seed()
254 state->s4 = __seed(LCG(state->s3), 128U); in prandom_state_selftest_seed()
263 struct rnd_state state; in prandom_state_selftest() local
265 prandom_state_selftest_seed(&state, test1[i].seed); in prandom_state_selftest()
266 prandom_warmup(&state); in prandom_state_selftest()
268 if (test1[i].result != prandom_u32_state(&state)) in prandom_state_selftest()
278 struct rnd_state state; in prandom_state_selftest() local
280 prandom_state_selftest_seed(&state, test2[i].seed); in prandom_state_selftest()
281 prandom_warmup(&state); in prandom_state_selftest()
284 prandom_u32_state(&state); in prandom_state_selftest()
286 if (test2[i].result != prandom_u32_state(&state)) in prandom_state_selftest()