# Re: Bruce Shneier's DES

From: mrz (mrz03_at_streamyx-dot-com.no-spam.invalid)
Date: 11/12/04

```Date: 12 Nov 2004 01:55:10 -0600

```

> Each iteration of the main loop performs two rounds of DES. Each
> round consumes two of the precomputed key values. The first value
> keys the "odd" numbered S-boxes (1, 3, 5, 7) and the second value
> keys the "even" numbered boxes. Thus the key bits are
out-of-order;
> rather than {1, 2, 3, 4}, {5, 6, 7, 8} they are precomputed in the
> form {1, 3, 5, 7}, {2, 4, 6, 8}. And rotated one bit. This is
> what the cookey() (cook key, get it?) function does. The active
> bits in each long are thus: 00111111001111110011111100111111
>

now I understand what the cookey() function actually does. Thank you
very much mr outer.. I can see the actual bits of the keys.. is there
a signifcance as to why the keys are to be assembled in that
particular way ( {1, 3, 5, 7}, {2, 4, 6, 8} ). ? My guess is that
the keys can be arranged in a normal order ( {1, 2, 3, 4}, {5, 6, 7,
8} ) and inserted into the S-Boxes in the order of 1,2,3...7,8.

another thing that concerns me is the expansion function where the
right side of the plaintext is to be expanded from 32 bits to 64
bits.. in the code, it does the following:

work ^= *keys++;
...
work = right ^ *keys++;

are those 2 XOR functions above that performed the expansion
implicitly? would you care to explain on this??

you have been very helpful mr outer, I really appreciate your help..
now by work has made some progress..

thank you again..

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*