diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index 92c858d72..841c1e4ef 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -973,6 +973,8 @@ void AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock) word32 r = aes->rounds >> 1; const word32* rk = aes->key; + if (r > 7) + return; /* stop instead of segfaulting, set up your keys! */ /* * map byte array block to cipher state * and add initial round key: @@ -1107,6 +1109,8 @@ void AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock) word32 r = aes->rounds >> 1; const word32* rk = aes->key; + if (r > 7) + return; /* stop instead of segfaulting, set up your keys! */ /* * map byte array block to cipher state * and add initial round key: