10 static State x917state;
13 X917(uchar *rand, int nrand)
18 /* 1. Compute intermediate value I = Ek(time). */
20 triple_block_cipher(x917state.des3.expanded, (uchar*)&I, 0); /* two-key EDE */
22 /* 2. x[i] = Ek(I^seed); seed = Ek(x[i]^I); */
25 x = I ^ x917state.seed;
26 triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0);
27 n8 = (nrand>8) ? 8 : nrand;
28 memcpy(rand, (uchar*)&x, n8);
32 triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0);
46 for(n = 0; n < sizeof(key3)/sizeof(ulong); n++)
48 setupDES3state(&x917state.des3, key3, nil);
49 X917(mix, sizeof mix);
54 genrandom(uchar *p, int n)
56 qlock(&x917state.lock);
57 if(x917state.seeded == 0)
60 qunlock(&x917state.lock);