diff options
Diffstat (limited to 'src/aead/gcm/gcm.h')
-rw-r--r-- | src/aead/gcm/gcm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/aead/gcm/gcm.h b/src/aead/gcm/gcm.h index bc7eaae20..f36aafc5f 100644 --- a/src/aead/gcm/gcm.h +++ b/src/aead/gcm/gcm.h @@ -68,6 +68,9 @@ class BOTAN_DLL GCM_Encryption : public GCM_Mode GCM_Encryption(BlockCipher* cipher, size_t tag_size = 16) : GCM_Mode(cipher, tag_size) {} + size_t output_length(size_t input_length) const override + { return input_length + tag_size(); } + size_t minimum_final_size() const override { return 0; } void update(secure_vector<byte>& blocks, size_t offset) override; @@ -88,6 +91,12 @@ class BOTAN_DLL GCM_Decryption : public GCM_Mode GCM_Decryption(BlockCipher* cipher, size_t tag_size = 16) : GCM_Mode(cipher, tag_size) {} + size_t output_length(size_t input_length) const override + { + BOTAN_ASSERT(input_length > tag_size(), "Sufficient input"); + return input_length - tag_size(); + } + size_t minimum_final_size() const override { return tag_size(); } void update(secure_vector<byte>& blocks, size_t offset) override; |