aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/chacha_rng/chacha_rng.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/rng/chacha_rng/chacha_rng.cpp')
-rw-r--r--src/lib/rng/chacha_rng/chacha_rng.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/rng/chacha_rng/chacha_rng.cpp b/src/lib/rng/chacha_rng/chacha_rng.cpp
index ad8ee9ba8..065a19060 100644
--- a/src/lib/rng/chacha_rng/chacha_rng.cpp
+++ b/src/lib/rng/chacha_rng/chacha_rng.cpp
@@ -75,8 +75,7 @@ void ChaCha_RNG::randomize_with_input(uint8_t output[], size_t output_len,
update(input, input_len);
}
- clear_mem(output, output_len);
- m_chacha->cipher1(output, output_len);
+ m_chacha->write_keystream(output, output_len);
}
void ChaCha_RNG::update(const uint8_t input[], size_t input_len)
@@ -85,7 +84,7 @@ void ChaCha_RNG::update(const uint8_t input[], size_t input_len)
m_chacha->set_key(m_hmac->final());
secure_vector<uint8_t> mac_key(m_hmac->output_length());
- m_chacha->cipher1(mac_key.data(), mac_key.size());
+ m_chacha->write_keystream(mac_key.data(), mac_key.size());
m_hmac->set_key(mac_key);
}