File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,13 @@ ChaCha20::~ChaCha20()
335335 memory_cleanse (m_buffer.data (), m_buffer.size ());
336336}
337337
338+ void ChaCha20::SetKey (Span<const std::byte> key) noexcept
339+ {
340+ m_aligned.SetKey (key);
341+ m_bufleft = 0 ;
342+ memory_cleanse (m_buffer.data (), m_buffer.size ());
343+ }
344+
338345FSChaCha20::FSChaCha20 (Span<const std::byte> key, uint32_t rekey_interval) noexcept :
339346 m_chacha20(key), m_rekey_interval(rekey_interval)
340347{
Original file line number Diff line number Diff line change @@ -95,11 +95,7 @@ class ChaCha20
9595 ~ChaCha20 ();
9696
9797 /* * Set 32-byte key, and seek to nonce 0 and block position 0. */
98- void SetKey (Span<const std::byte> key) noexcept
99- {
100- m_aligned.SetKey (key);
101- m_bufleft = 0 ;
102- }
98+ void SetKey (Span<const std::byte> key) noexcept ;
10399
104100 /* * 96-bit nonce type. */
105101 using Nonce96 = ChaCha20Aligned::Nonce96;
You can’t perform that action at this time.
0 commit comments