MCPcopy Create free account
hub / github.com/S3N4T0R-0X0/PixelCode-Attack / AddRoundKey

Function AddRoundKey

payload.cpp:343–353  ·  view source on GitHub ↗

This function adds the round key to state. The round key is added to the state by an XOR function.

Source from the content-addressed store, hash-verified

341// This function adds the round key to state.
342// The round key is added to the state by an XOR function.
343static void AddRoundKey(uint8_t round, state_t* state, const uint8_t* RoundKey)
344{
345 uint8_t i,j;
346 for (i = 0; i < 4; ++i)
347 {
348 for (j = 0; j < 4; ++j)
349 {
350 (*state)[i][j] ^= RoundKey[(round * Nb * 4) + (i * Nb) + j];
351 }
352 }
353}
354
355// The SubBytes Function Substitutes the values in the
356// state matrix with values in an S-box.

Callers 2

CipherFunction · 0.85
InvCipherFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected