3
$\begingroup$

In Advanced Encryption Std, say after a ShiftRow operation, I want to perform MixColumns.

      State             MixColumn Matrix             Mixed
┏             ┓       ┏             ┓       ┏             ┓
┃ d4 e0 b8 1e ┃       ┃ 02 03 01 01 ┃       ┃ 04 e0 48 28 ┃ 
┃ bf b4 41 27 ┃       ┃ 01 02 03 01 ┃       ┃ 66 cb f8 06 ┃ 
┃ 5d 52 11 98 ┃       ┃ 01 01 02 03 ┃       ┃ 81 19 d3 26 ┃ 
┃ 30 ae f1 e5 ┃       ┃ 03 01 01 02 ┃       ┃ e5 9a 7a 4c ┃ 
┗             ┛       ┗             ┛       ┗             ┛

Example taken from this flash file. I'm puzzled by the description at Wikipedia.

The flash told that after MixColumns, the 1st column of State is turned into the 1st column of the Mixed matrix. How is this so?

First of all, how to multiply a column by a matrix? The shapes don't match, or is there anything special in cryptography? Well, if we transpose the column, I still don't understand: ($\cdot$ means dot product, and here are my Attempts)

# 1: [d4 bf 5d 30]$\cdot$[02 01 01 03] = d4+d4+bf+5d+30+30+30 = 54 != 04

# 2: [d4 bf 5d 30]$\cdot$[02 01 01 03] = d4+d4+bf+5d+((30<<1) ^ 30) = 14 != 04

# 3: [d4 bf 5d 30]$\cdot$[02 03 01 01] = d4+d4+bf+bf+bf+5d+30 = 72 != 04

# 4: [d4 bf 5d 30]$\cdot$[02 03 01 01] = d4+d4+((bf<<1)^30)^11b+5d+30 = 0F != 04

What's happening?

$\endgroup$
4
$\begingroup$

All the matrix entries are elements of the Galois field $GF(2^8)$, using field poynomial $x^8 + x^4 + x^3 + x + 1$. There is an excellent Wikipedia article Rijndael mix columns which explains this very clearly.

$\endgroup$
  • 1
    $\begingroup$ Thank you, it worked! But what is a Galois field, and what's the magic about $+$ being $\oplus$ and that polynomial? $\endgroup$ – Frenzy Li Dec 1 '12 at 8:34
  • 1
    $\begingroup$ A Galois field is just another name for a finite field. There is another Wikipedia article, Finite field arithmetic, which uses Rijndael's field as an example. $\endgroup$ – TonyK Dec 1 '12 at 9:55

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.