diff options
author | Daniel Neus <[email protected]> | 2016-07-20 22:26:26 +0200 |
---|---|---|
committer | Daniel Neus <[email protected]> | 2016-11-08 22:16:09 +0100 |
commit | 06b44d8ed339b3a467f10a326fd209b0b9496060 (patch) | |
tree | 24c3bf3f20ba697a658d6d009d0cdb7be8a3e41f /src/lib/modes/cipher_mode.h | |
parent | 523b2a4ca48fa5cf04ea371aabe7167ce2e5cd13 (diff) |
Cipher_Mode and AEAD_Mode improvements
See PR #552
- Add Cipher_Mode::reset() which resets just the message specific state and allows encrypting again under the existing key
- In Cipher_Mode::clear() (at some planes) use cipher->clear() instead of resetting the pointer which would make the cipher object unusable
- EAX_Decryption::output_length() bugfix?! Now its possible to decrypt an empty ciphertext (just a tag)
- Bugfix for GCM_Decryption::finish()
- set tag length in GCM_Mode::name()
- Cipher_Mode tests: add tests for reset()and process()
- AEAD_Mode tests: add tests for reset(), clear(), update() and process()
Diffstat (limited to 'src/lib/modes/cipher_mode.h')
-rw-r--r-- | src/lib/modes/cipher_mode.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/modes/cipher_mode.h b/src/lib/modes/cipher_mode.h index 7c0f8fc57..8bf58f10a 100644 --- a/src/lib/modes/cipher_mode.h +++ b/src/lib/modes/cipher_mode.h @@ -65,7 +65,7 @@ class BOTAN_DLL Cipher_Mode * * Processes msg in place and returns bytes written. Normally * this will be either msg_len (indicating the entire message was - * processes) or for certain AEAD modes zero (indicating that the + * processed) or for certain AEAD modes zero (indicating that the * mode requires the entire message be processed in one pass). * * @param msg the message to be processed @@ -127,9 +127,18 @@ class BOTAN_DLL Cipher_Mode virtual std::string name() const = 0; + /** + * Zeroise all state + * See also reset_msg() + */ virtual void clear() = 0; /** + * Resets just the message specific state and allows encrypting again under the existing key + */ + virtual void reset() = 0; + + /** * @return true iff this mode provides authentication as well as * confidentiality. */ |