nisse@lysator.liu.se (Niels Möller) writes:
I think the simplest way would be to arrange the internal aes functions to take number of rounds and the subkey as separate arguments. And then define separate context structs and functions for each key size, like
struct aes128_ctx { uint32_t keys[44]; };
struct aes192_ctx { uint32_t keys[52]; };
struct aes256_ctx { uint32_t keys[60]; };
There should be no problem to also keep the current AES interface (with variable key size) for backwards compatibility.
I've pushed a branch "aes-reorg" to the public repo, implementing this change.
Regards, /Niels