aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/chacha
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stream/chacha')
-rw-r--r--src/lib/stream/chacha/chacha.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/stream/chacha/chacha.cpp b/src/lib/stream/chacha/chacha.cpp
index acf79cbd9..f34959377 100644
--- a/src/lib/stream/chacha/chacha.cpp
+++ b/src/lib/stream/chacha/chacha.cpp
@@ -181,6 +181,8 @@ bool ChaCha::valid_iv_length(size_t iv_len) const
void ChaCha::set_iv(const uint8_t iv[], size_t length)
{
+ verify_key_set(m_state.empty() == false);
+
if(!valid_iv_length(length))
throw Invalid_IV_Length(name(), length);