<< NL_S_AESMixColumns NL_S: Security NL_S_AESPolynomialMult >>

NARVAL >> NL_S: Security > NL_S_AESMixColumnsR

NL_S_AESMixColumnsR

Mix columns of a matrix (reverse).

Calling Sequence

[O] = NL_S_AESMixColumnsR(I,S)

Arguments

I :

4x4 state matrix.

S :

AES structure.

O :

Output matrix.

Description

NL_S_AESMixColumnsR operates on each column of the matrix S by treating it as a polynom a(x) of degree 3 in F256 (WIKIPEDIA). The polynom is d(x)=c^(-1)(x). (03x^3+x^2+x+02)xd(x)=01 mod (x^4 +1). d(x)=0Bx^3+0Dx^2+09x+0E. [b0 b1 b2 b3]'= |OE OB 0D 09| |09 0E 0B 0D| |0D 09 0E 0B| |0B 0D 09 0E| x[a0 a1 a2 a3]'

Examples

//128 bits
key128h={'2b','7e','15','16','28','ae','d2','a6','ab','f7','15','88','09','cf','4f','3c'};//16 bytes
key128=hex2dec(key128h);
[s128]=NL_S_AESInitialization(key128);//initialization of the structure
inh={'32','43','f6','a8','88','5a','30','8d','31','31','98','a2','e0','37','07','34'};//plain text
in=hex2dec(inh);//decimal
state = matrix(in, 4, 4);//reshape
// Initial round : AddRoundKey keyexp(1:4)
state = bitxor(state, (s128.keyexp(1:4, :))')
[Rstate]=NL_S_AESMixColumnsR(state,s128)//application of NL_S_AESMixColumnsR

Report an issue
<< NL_S_AESMixColumns NL_S: Security NL_S_AESPolynomialMult >>