![]() |
Bitcoin Core
25.99.0
P2P Digital Currency
|
ChaCha20 cipher that only operates on multiples of 64 bytes. More...
#include <chacha20.h>
Public Member Functions | |
ChaCha20Aligned () | |
ChaCha20Aligned (const unsigned char *key32) | |
Initialize a cipher with specified 32-byte key. More... | |
void | SetKey32 (const unsigned char *key32) |
set 32-byte key. More... | |
void | SetIV (uint64_t iv) |
set the 64-bit nonce. More... | |
void | Seek64 (uint64_t pos) |
set the 64bit block counter (pos seeks to byte position 64*pos). More... | |
void | Keystream64 (unsigned char *c, size_t blocks) |
outputs the keystream of size <64*blocks> into More... | |
void | Crypt64 (const unsigned char *input, unsigned char *output, size_t blocks) |
enciphers the message <input> of length <64*blocks> and write the enciphered representation into <output> Used for encryption and decryption (XOR) More... | |
Private Attributes | |
uint32_t | input [12] |
ChaCha20 cipher that only operates on multiples of 64 bytes.
Definition at line 15 of file chacha20.h.
ChaCha20Aligned::ChaCha20Aligned | ( | ) |
Definition at line 40 of file chacha20.cpp.
ChaCha20Aligned::ChaCha20Aligned | ( | const unsigned char * | key32 | ) |
Initialize a cipher with specified 32-byte key.
Definition at line 45 of file chacha20.cpp.
|
inline |
enciphers the message <input> of length <64*blocks> and write the enciphered representation into <output> Used for encryption and decryption (XOR)
Definition at line 159 of file chacha20.cpp.
|
inline |
outputs the keystream of size <64*blocks> into
Definition at line 62 of file chacha20.cpp.
void ChaCha20Aligned::Seek64 | ( | uint64_t | pos | ) |
set the 64bit block counter (pos seeks to byte position 64*pos).
Definition at line 56 of file chacha20.cpp.
void ChaCha20Aligned::SetIV | ( | uint64_t | iv | ) |
set the 64-bit nonce.
Definition at line 50 of file chacha20.cpp.
void ChaCha20Aligned::SetKey32 | ( | const unsigned char * | key32 | ) |
set 32-byte key.
Definition at line 24 of file chacha20.cpp.
|
private |
Definition at line 18 of file chacha20.h.