<< NL_S_AESKeyExpansion NL_S: Security NL_S_AESMixColumnsR >>

NARVAL >> NL_S: Security > NL_S_AESMixColumns

NL_S_AESMixColumns

Mix columns of a matrix.

Calling Sequence

[O] = NL_S_AESMixColumns(I,S)

Arguments

I :

4x4 state matrix.

S :

AES structure.

O :

Output matrix.

Description

NL_S_AESMixColumns operates on each column of the matrix S by treating it as a polynom a(x) of degree 3 in F256. The step MixColumns of AES (WIKIPEDIA) consists of (03x^3+x^2+x+02)xa(x) mod (x^4+1). b(x)=c(x)xa(x) mod (x^4+1) [b0 b1 b2 b3]'= |02 03 01 01| |01 02 03 01| |01 01 02 03| |03 01 01 02| x[a0 a1 a2 a3]' |02 03 01 01| |01 02 03 01| |01 01 02 03| |03 01 01 02| x[a01 a11 a21 a31]'=[b01 b11 b21 b31]'

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_AESMixColumns(state,s128)//application of NL_S_AESMixColumns

Report an issue
<< NL_S_AESKeyExpansion NL_S: Security NL_S_AESMixColumnsR >>