diff options
-rw-r--r-- | src/lib/modes/aead/gcm/gcm.cpp | 3 | ||||
-rw-r--r-- | src/tests/data/aead/gcm.vec | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/modes/aead/gcm/gcm.cpp b/src/lib/modes/aead/gcm/gcm.cpp index 828cc2c42..becd3484b 100644 --- a/src/lib/modes/aead/gcm/gcm.cpp +++ b/src/lib/modes/aead/gcm/gcm.cpp @@ -183,7 +183,8 @@ GCM_Mode::GCM_Mode(BlockCipher* cipher, size_t tag_size) : m_ctr.reset(new CTR_BE(cipher, 4)); // CTR_BE takes ownership of cipher /* We allow any of the values 128, 120, 112, 104, or 96 bits as a tag size */ - if(m_tag_size < 12 || m_tag_size > 16) + /* 64 bit tag is still supported but deprecated and will be removed in the future */ + if(m_tag_size != 8 && (m_tag_size < 12 || m_tag_size > 16)) throw Invalid_Argument(name() + ": Bad tag size " + std::to_string(m_tag_size)); } diff --git a/src/tests/data/aead/gcm.vec b/src/tests/data/aead/gcm.vec index 4ea297422..2a5a7b128 100644 --- a/src/tests/data/aead/gcm.vec +++ b/src/tests/data/aead/gcm.vec @@ -236,6 +236,15 @@ In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c9 AD = feedfacedeadbeeffeedfacedeadbeefabaddad2 Out = c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f3a337dbf46a792c45e454913fe2ea8 + +[AES-128/GCM(8)] +Key = 5b9604fe14eadba931b0ccf34843dab9 +Nonce = 921d2507fa8007b7bd067d34 +AD = 00112233445566778899aabbccddeeff +In = 001d0c231287c1182784554ca3a21908 +Out = 49d8b9783e911913d87094d1f63cc7651e348ba07cca2cf0 + + # Wycheproof GCM tests [AES-128/GCM] In = 001d0c231287c1182784554ca3a21908 |