diff options
Diffstat (limited to 'aes.cpp')
-rw-r--r-- | aes.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -248,7 +248,9 @@ namespace AES{ case AES_256_CBC: increment=2; break; default: assert(false); } - assert((int)key.size()==4*(4+2*increment)); + if((int)key.size()!=4*(4+2*increment)){ + throw invalid_argument("Invalid AES key length"); + } return decryptCBC(data,key,10+2*increment); } |