We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static void MixColumns(state_t *state) { uint8_t i; uint8_t Tmp, Tm, t; for (i = 0; i < 4; ++i) { t = (*state)[i][0]; Tmp = (*state)[i][0] ^ (*state)[i][1] ^ (*state)[i][2] ^ (*state)[i][3]; Tm = (*state)[i][0] ^ (*state)[i][1]; Tm = xtime(Tm); (*state)[i][0] ^= Tm ^ Tmp; Tm = (*state)[i][1] ^ (*state)[i][2]; Tm = xtime(Tm); (*state)[i][1] ^= Tm ^ Tmp; Tm = (*state)[i][2] ^ (*state)[i][3]; Tm = xtime(Tm); (*state)[i][2] ^= Tm ^ Tmp; Tm = (*state)[i][3] ^ t; Tm = xtime(Tm); (*state)[i][3] ^= Tm ^ Tmp; } } Hello i wanted to ask how mix columns mask take place . I understand we need to precalculate last four mask with this function static void calcMixColmask(uint8_t mask[10]) { mask[6] = mul_02[mask[0]] ^ mul_03[mask[1]] ^ mask[2] ^ mask[3]; mask[7] = mask[0] ^ mul_02[mask[1]] ^ mul_03[mask[2]] ^ mask[3]; mask[8] = mask[0] ^ mask[1] ^ mul_02[mask[2]] ^ mul_03[mask[3]]; mask[9] = mul_03[mask[0]] ^ mask[1] ^ mask[2] ^ mul_02[mask[3]]; }
so in above MixColumns function with xtime ...how state masks are changed from M1 to M1', M2 to M2' etc..
The text was updated successfully, but these errors were encountered:
Also, i just noticed xtime function static uint8_t xtime(uint8_t x) { return ((x << 1) ^ (((x >> 7) & 1) * 0x1b)); } shouldnot * be & operator ?
Sorry, something went wrong.
No branches or pull requests
static void MixColumns(state_t *state)
{
uint8_t i;
uint8_t Tmp, Tm, t;
for (i = 0; i < 4; ++i)
{
t = (*state)[i][0];
Tmp = (*state)[i][0] ^ (*state)[i][1] ^ (*state)[i][2] ^ (*state)[i][3];
Tm = (*state)[i][0] ^ (*state)[i][1];
Tm = xtime(Tm);
(*state)[i][0] ^= Tm ^ Tmp;
Tm = (*state)[i][1] ^ (*state)[i][2];
Tm = xtime(Tm);
(*state)[i][1] ^= Tm ^ Tmp;
Tm = (*state)[i][2] ^ (*state)[i][3];
Tm = xtime(Tm);
(*state)[i][2] ^= Tm ^ Tmp;
Tm = (*state)[i][3] ^ t;
Tm = xtime(Tm);
(*state)[i][3] ^= Tm ^ Tmp;
}
}
Hello i wanted to ask how mix columns mask take place . I understand we need to precalculate last four mask with this function
static void calcMixColmask(uint8_t mask[10])
{
mask[6] = mul_02[mask[0]] ^ mul_03[mask[1]] ^ mask[2] ^ mask[3];
mask[7] = mask[0] ^ mul_02[mask[1]] ^ mul_03[mask[2]] ^ mask[3];
mask[8] = mask[0] ^ mask[1] ^ mul_02[mask[2]] ^ mul_03[mask[3]];
mask[9] = mul_03[mask[0]] ^ mask[1] ^ mask[2] ^ mul_02[mask[3]];
}
so in above MixColumns function with xtime ...how state masks are changed from M1 to M1', M2 to M2' etc..
The text was updated successfully, but these errors were encountered: