From ea7b6b89deb26a9d04242ce19b20f8e2d3628202 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 14 Nov 2023 08:53:30 +0100 Subject: [PATCH] Implement `addRoundKey` --- aes/aes.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aes/aes.cpp b/aes/aes.cpp index e1379bb..ff69abf 100644 --- a/aes/aes.cpp +++ b/aes/aes.cpp @@ -162,7 +162,10 @@ void expandKey(uint8_t k[16], uint32_t ek[44]) { /* Adding expanded round key (prepared before) */ void addRoundKey(t_state s, uint32_t ek[], short round) { - /* ??? */ + s[0] ^= ek[round]; + s[1] ^= ek[round + 1]; + s[2] ^= ek[round + 2]; + s[3] ^= ek[round + 3]; } void aes(uint8_t *in, uint8_t *out, uint8_t *skey)