INNER CODE UNIT · C++
res
ph4r05/Whitebox-crypto-AES · BGEAttack.cpp:625
mat_GF2 res = AtildMatInv * xMat;
GF2X resGF = colVector_GF2X(res, 0);
AtildInvLoT[x] = getLong(resGF);
}
//
// Construct those mappings y_row. This can be similar to prop1, but
// here we are iterating over 2 variables and CHECKING if resulting mapping is affine.
//
int PiOK=0;
for(int p=0; p<4; p++){
GF256_func_t y_row; // pre-computed functions
W128b state;
for(int x=0; x<=0xff; x++){
memset(&state, 0, sizeof(state)); // put 0 everywhere
state.B[col + 4*p] = x; // In each iteration P_i, we set X to different position, namely x0,x1,x2,x3
this->Rbox(state, true, r, true); // perform R box computation on input & output values