# How many Affine function can be made from $4 \times 4$ and $8 \times 8$ S-boxes?

The nonlinearity of an S-Box is defined as the non-linearity of its vectorial Boolean Function.

Let $F$ be the hamming distance between the set of all non-constant linear combinations of component functions and the set of all $n$-variable affine Boolean functions $A(n)$.

If we take two S-Box of $4 \times 4$ and $8 \times 8$ then
how many Affine function can be made from $4 \times 4$ and $8 \times 8$ S-boxes ?

• Non-linearity is minimum of all hamming distances between all output functions and all possible affine functions of input. so in case of 8x8 sbox, there will be 2^8=256 affine functions and 8 output functions, now each of the 8 output function will be xored with all 256 affine functions to caculate hamming distance, in the end u will get a list of 8x256 hamming distances, minimum of these will be non-lineraity – crypt Jun 15 '17 at 7:15
• how u r going to construct affine function from two different sizes Sboxes? – crypt Jun 15 '17 at 9:20