diff options
author | lloyd <[email protected]> | 2013-03-28 14:00:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-03-28 14:00:27 +0000 |
commit | d00231f885256cbd471ce47c2cf1a2b6fbeb06cd (patch) | |
tree | 7abb5475f004999623e32b3577583c0684d9c605 /src/aead/gcm | |
parent | dbe450ca8a105213fe6d94512d6ad872046697ca (diff) |
Add nonce length checks to EAX and GCM
Diffstat (limited to 'src/aead/gcm')
-rw-r--r-- | src/aead/gcm/gcm.cpp | 3 |
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) |