Lines Matching defs:random_state

59 static struct random_state {
77 } random_state;
96 random_state.counter.qword[0] = 0UL;
97 random_state.counter.qword[1] = 0UL;
106 random_state.counter.qword[0]++;
107 if (!random_state.counter.qword[0])
108 random_state.counter.qword[1]++;
134 pl = random_state.which;
135 source = &random_state.pool[pl].source[event->source];
136 randomdev_hash_iterate(&random_state.pool[pl].hash, event,
144 if (random_state.pool[pl].source[src].bits
145 > random_state.pool[pl].thresh)
155 if (overthreshhold[SLOW] >= random_state.slowoverthresh)
159 random_state.which = !random_state.which;
179 &random_state.gengateinterval, 10,
186 &random_state.bins, 10,
193 &random_state.pool[0].thresh, (3*(BLOCKSIZE*8))/4,
200 &random_state.pool[1].thresh, (BLOCKSIZE*8),
207 &random_state.slowoverthresh, 2,
211 random_state.gengateinterval = 10;
212 random_state.bins = 10;
213 random_state.pool[0].thresh = (3*(BLOCKSIZE*8))/4;
214 random_state.pool[1].thresh = (BLOCKSIZE*8);
215 random_state.slowoverthresh = 2;
216 random_state.which = FAST;
220 randomdev_hash_init(&random_state.pool[i].hash);
261 &random_state.pool[SLOW].hash,
264 &random_state.pool[FAST].hash, sizeof(struct randomdev_hash));
271 if (random_state.bins > TIMEBIN)
272 random_state.bins = TIMEBIN;
273 for (i = 1; i < random_state.bins; i++) {
290 randomdev_hash_iterate(&context, &random_state.key, KEYSIZE);
291 for (i = 1; i < random_state.bins; i++)
294 randomdev_encrypt_init(&random_state.key, temp);
299 randomdev_encrypt(&random_state.key, random_state.counter.byte, temp, BLOCKSIZE);
300 memcpy(random_state.counter.byte, temp, BLOCKSIZE);
306 random_state.pool[i].source[j].bits = 0;
344 random_state.outputblocks = 0;
351 randomdev_encrypt(&random_state.key, random_state.counter.byte, genval, BLOCKSIZE);
354 if (++random_state.outputblocks >= random_state.gengateinterval) {
356 random_state.outputblocks = 0;
365 randomdev_encrypt(&random_state.key, random_state.counter.byte, genval, BLOCKSIZE);
368 if (++random_state.outputblocks >= random_state.gengateinterval) {
370 random_state.outputblocks = 0;
392 randomdev_encrypt(&random_state.key, random_state.counter.byte, temp + i, BLOCKSIZE);
395 randomdev_encrypt_init(&random_state.key, temp);
408 printf(" %d", random_state.pool[FAST].source[i].bits);
412 printf(" %d", random_state.pool[SLOW].source[i].bits);