The SubBytes Function Substitutes the values in the state matrix with values in an S-box.
| 475 | // The SubBytes Function Substitutes the values in the |
| 476 | // state matrix with values in an S-box. |
| 477 | static void InvSubBytes(state_t* state) |
| 478 | { |
| 479 | uint8_t i, j; |
| 480 | for (i = 0; i < 4; ++i) |
| 481 | { |
| 482 | for (j = 0; j < 4; ++j) |
| 483 | { |
| 484 | (*state)[j][i] = getSBoxInvert((*state)[j][i]); |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | static void InvShiftRows(state_t* state) |
| 490 | { |