Generating S-box
Properties:
- differential characteristics
- linear characteristics
- nonlinear order
Generated from DES S-box in a deterministic manner.
sbox[32][16] contain 8 DES S-box; serpent[16] is random 4-bit array
currentsbox:= index mod 32;
j:= sbox[(currentsbox+1) mod 32][serpent[i]];
swapentries (sbox[currentsbox][i], sbox[currentsbox][j]);
if sbox[currentsbox][.] has the desired properties, save it;
until 8 S-box have been generated