diff options
author | Jack Lloyd <[email protected]> | 2017-08-03 10:53:31 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-08-03 10:53:31 -0400 |
commit | 71d8bfac34acbab87a2319a8581b0aefbe762672 (patch) | |
tree | 56f9a6a7c81589253ec5b2e6bb623ef3e0d0a98c | |
parent | 479a475ba460cdc9f99a62de0a794e20491e0d7b (diff) |
Reset the ChaCha key in clear
This is not necessary for setup, but we want to zero the key out
in the event someone calls clear explicitly.
-rw-r--r-- | src/lib/rng/chacha_rng/chacha_rng.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/rng/chacha_rng/chacha_rng.cpp b/src/lib/rng/chacha_rng/chacha_rng.cpp index ade92aa14..ad8ee9ba8 100644 --- a/src/lib/rng/chacha_rng/chacha_rng.cpp +++ b/src/lib/rng/chacha_rng/chacha_rng.cpp @@ -57,6 +57,7 @@ void ChaCha_RNG::clear() Stateful_RNG::clear(); m_hmac->set_key(std::vector<uint8_t>(m_hmac->output_length(), 0x00)); + m_chacha->set_key(m_hmac->final()); } void ChaCha_RNG::randomize(uint8_t output[], size_t output_len) |