| X917(uchar *rand, int nrand) |
| /* 1. Compute intermediate value I = Ek(time). */ |
| triple_block_cipher(x917state.des3.expanded, (uchar*)&I, 0); /* two-key EDE */ |
| /* 2. x[i] = Ek(I^seed); seed = Ek(x[i]^I); */ |
| triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0); |
| n8 = (nrand>8) ? 8 : nrand; |
| memcpy(rand, (uchar*)&x, n8); |
| triple_block_cipher(x917state.des3.expanded, (uchar*)&x, 0); |
| for(n = 0; n < sizeof(key3)/sizeof(ulong); n++) |
| setupDES3state(&x917state.des3, key3, nil); |
| genrandom(uchar *p, int n) |
| if(x917state.seeded == 0) |
| qunlock(&x917state.lock); |