1
$\begingroup$

The Affine Transformation for AES Sbox is given by (1)

enter image description here

The straight forward reverse to this transformation is (2)

enter image description here

Where as the inverse of Affine Transformation is given as (3)

enter image description here

where (4)

enter image description here

why did the designers preferred the (3) instead of straight forward reverse (2)?

$\endgroup$
2
$\begingroup$

Those are, of course, two equivalent ways of writing the same function, so it really doesn't matter which one you use. If you're implementing AES, you can use whichever form of the S-box you find more convenient — or even something else entirely, as long as it gives the same results.*

That said, it's often desirable to share as much code and/or circuitry between the encryption and decryption implementations as possible. Thus, it can be convenient to implement the forward and reverse S-boxes so that they have the same mathematical form. Thus, if you're going to implement the forward S-box using formula (1), it can make sense to implement the reverse S-box using formula (3), since the only difference between them is the choice of constants.

*) Of course, however you choose to implement the S-box, you'd typically want to make sure that it runs in constant time and doesn't leak any sensitive data via any other potentially exploitable side channels.

| improve this answer | |
$\endgroup$
  • $\begingroup$ thats what i was looking for. The reason behind such way of writing reverse affine function. as you mentioned, "the only difference between them is the choice of constants". Thanks a lot $\endgroup$ – abraza Dec 24 '17 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.