aboutsummaryrefslogtreecommitdiffstats
path: root/src/aead/gcm/gcm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aead/gcm/gcm.cpp')
-rw-r--r--src/aead/gcm/gcm.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/aead/gcm/gcm.cpp b/src/aead/gcm/gcm.cpp
index a067d162e..a5ccee927 100644
--- a/src/aead/gcm/gcm.cpp
+++ b/src/aead/gcm/gcm.cpp
@@ -155,6 +155,9 @@ void GCM_Mode::set_associated_data(const byte ad[], size_t ad_len)
secure_vector<byte> GCM_Mode::start(const byte nonce[], size_t nonce_len)
{
+ if(!valid_nonce_length(nonce_len))
+ throw Invalid_IV_Length(name(), nonce_len);
+
secure_vector<byte> y0(BS);
if(nonce_len == 12)