Implement AES algorithm

This commit is contained in:
Manuel Thalmann 2023-11-14 11:06:11 +01:00
parent afe36cebe6
commit 4720e95cf2

View file

@ -191,10 +191,25 @@ void aes(uint8_t *in, uint8_t *out, uint8_t *skey)
addRoundKey(state, expKey, 0); addRoundKey(state, expKey, 0);
printf("ARK: "); printstate(state); printf("ARK: "); printstate(state);
/* ??? */ for (int i = 1; i <= 10; i++) {
/* ??? */ subBytes(state);
/* ??? */ printf("SB: ");
printstate(state);
shiftRows(state);
printf("SR: ");
printstate(state);
if (i < 10) {
mixColumns(state);
printf("MC: ");
printstate(state);
}
addRoundKey(state, expKey, 4*i);
printf("ARK: ");
printstate(state);
}
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
if (i < 4) out[i] = wbyte(state[0], i % 4); if (i < 4) out[i] = wbyte(state[0], i % 4);