![]() |
Bitcoin ABC 0.32.4
P2P Digital Currency
|
Unrestricted ChaCha20 cipher. More...
#include <chacha20.h>
Public Types | |
| using | Nonce96 = ChaCha20Aligned::Nonce96 |
| 96-bit nonce type. More... | |
Public Member Functions | |
| ChaCha20 () noexcept=delete | |
| For safety, disallow initialization without key. More... | |
| ChaCha20 (Span< const std::byte > key) noexcept | |
| Initialize a cipher with specified KEYLEN-byte key. More... | |
| ~ChaCha20 () | |
| Destructor to clean up private memory. More... | |
| void | SetKey (Span< const std::byte > key) noexcept |
| Set KEYLEN-byte key, and seek to nonce 0 and block position 0. More... | |
| void | Seek (Nonce96 nonce, uint32_t block_counter) noexcept |
| Set the 96-bit nonce and 32-bit block counter. More... | |
| void | Crypt (Span< const std::byte > in_bytes, Span< std::byte > out_bytes) noexcept |
| en/deciphers the message <in_bytes> and write the result into <out_bytes> More... | |
| void | Keystream (Span< std::byte > out) noexcept |
| outputs the keystream to out. More... | |
Static Public Attributes | |
| static constexpr unsigned | KEYLEN = ChaCha20Aligned::KEYLEN |
| Expected key length in constructor and SetKey. More... | |
Private Attributes | |
| ChaCha20Aligned | m_aligned |
| std::array< std::byte, ChaCha20Aligned::BLOCKLEN > | m_buffer |
| unsigned | m_bufleft {0} |
Unrestricted ChaCha20 cipher.
Definition at line 89 of file chacha20.h.
96-bit nonce type.
Definition at line 112 of file chacha20.h.
|
deletenoexcept |
For safety, disallow initialization without key.
|
inlinenoexcept |
Initialize a cipher with specified KEYLEN-byte key.
Definition at line 103 of file chacha20.h.
| ChaCha20::~ChaCha20 | ( | ) |
Destructor to clean up private memory.
Definition at line 353 of file chacha20.cpp.
en/deciphers the message <in_bytes> and write the result into <out_bytes>
The size of in_bytes and out_bytes must be equal.
Definition at line 321 of file chacha20.cpp.
|
noexcept |
outputs the keystream to out.
Definition at line 298 of file chacha20.cpp.
|
inlinenoexcept |
Set the 96-bit nonce and 32-bit block counter.
Definition at line 118 of file chacha20.h.
|
noexcept |
Set KEYLEN-byte key, and seek to nonce 0 and block position 0.
Definition at line 357 of file chacha20.cpp.
|
staticconstexpr |
Expected key length in constructor and SetKey.
Definition at line 97 of file chacha20.h.
|
private |
Definition at line 91 of file chacha20.h.
|
private |
Definition at line 92 of file chacha20.h.
|
private |
Definition at line 93 of file chacha20.h.