aboutsummaryrefslogtreecommitdiff
path: root/aes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aes.cpp')
-rw-r--r--aes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/aes.cpp b/aes.cpp
index 29fc7fc..7430717 100644
--- a/aes.cpp
+++ b/aes.cpp
@@ -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);
}