11 static State x917state;
14 X917(uchar *rand, int nrand)
19 /* 1. Compute intermediate value I = Ek(time). */
21 triple_block_cipher(x917state.des3.expanded, (uchar*)&I, 0); /* two-key EDE */
23 /* 2. x[i] = Ek(I^seed); seed = Ek(x[i]^I); */
26 x = I ^ x917state.seed;
27 triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0);
28 n8 = (nrand>8) ? 8 : nrand;
29 memcpy(rand, (uchar*)&x, n8);
33 triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0);
47 for(n = 0; n < sizeof(key3)/sizeof(ulong); n++)
49 setupDES3state(&x917state.des3, key3, nil);
50 X917(mix, sizeof mix);
55 genrandom(uchar *p, int n)
57 qlock(&x917state.lock);
58 if(x917state.seeded == 0)
61 qunlock(&x917state.lock);