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