aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-10 22:06:52 -0500
committerJack Lloyd <[email protected]>2016-11-10 22:06:52 -0500
commit618f890fd7ede74c728612ca8bc590c72ee353f1 (patch)
tree3ac9016fe603525f04c194e8be9aa6152a049c40 /src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
parentb7ae8043e963467eb222a44f48d66a1df36d9371 (diff)
parent06b44d8ed339b3a467f10a326fd209b0b9496060 (diff)
Merge GH #552 Add Cipher_Mode::reset, better AEAD tests
Diffstat (limited to 'src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp')
-rw-r--r--src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
index d2f16c225..197d6f921 100644
--- a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
+++ b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
@@ -1,6 +1,7 @@
/*
* ChaCha20Poly1305 AEAD
* (C) 2014,2016 Jack Lloyd
+* (C) 2016 Daniel Neus, Rohde & Schwarz Cybersecurity
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -26,8 +27,14 @@ void ChaCha20Poly1305_Mode::clear()
{
m_chacha->clear();
m_poly1305->clear();
+ reset();
+ }
+
+void ChaCha20Poly1305_Mode::reset()
+ {
m_ad.clear();
m_ctext_len = 0;
+ m_nonce_len = 0;
}
void ChaCha20Poly1305_Mode::key_schedule(const byte key[], size_t length)