<< NL_S_AESSubBytes NL_S: Security NL_S_Bin2Dec >>

NARVAL >> NL_S: Security > NL_S_AESSubBytesR

NL_S_AESSubBytesR

Substitution of a matrix state in respect with a table InvSbox.

Calling Sequence

[T] = NL_S_AESSubBytesR(I,S)

Arguments

I :

InvS-box.

S :

4x4 state matrix.

T :

4x4 state matrix.

Description

NL_S_AESSubBytesR is the only non-linear transformation of the AES algorithm (WIKIPEDIA). In this step, each element of the matrix S is switched in respect with the substitution table s^-1. .

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
[SState]=NL_S_AESSubBytesR(s128.inv_s_box,state)//application of NL_S_AESSubBytesR
s128.inv_s_box(state+1)

Report an issue
<< NL_S_AESSubBytes NL_S: Security NL_S_Bin2Dec >>