5#ifndef BITCOIN_CRYPTO_CHACHA_POLY_AEAD_H
6#define BITCOIN_CRYPTO_CHACHA_POLY_AEAD_H
149 bool Crypt(uint64_t seqnr_payload, uint64_t seqnr_aad,
int aad_pos,
150 uint8_t *dest,
size_t dest_len,
const uint8_t *src,
151 size_t src_len,
bool is_encrypt);
154 bool GetLength(uint32_t *len24_out, uint64_t seqnr_aad,
int aad_pos,
155 const uint8_t *ciphertext);
static constexpr int CHACHA20_POLY1305_AEAD_KEY_LEN
static constexpr int AAD_PACKAGES_PER_ROUND
static constexpr int CHACHA20_POLY1305_AEAD_AAD_LEN
static constexpr int CHACHA20_ROUND_OUTPUT
A class for ChaCha20 256-bit stream cipher developed by Daniel J.
bool Crypt(uint64_t seqnr_payload, uint64_t seqnr_aad, int aad_pos, uint8_t *dest, size_t dest_len, const uint8_t *src, size_t src_len, bool is_encrypt)
Encrypts/decrypts a packet.
uint64_t m_cached_aad_seqnr
bool GetLength(uint32_t *len24_out, uint64_t seqnr_aad, int aad_pos, const uint8_t *ciphertext)
decrypts the 3 bytes AAD data and decodes it into a uint32_t field
uint8_t m_aad_keystream_buffer[CHACHA20_ROUND_OUTPUT]
ChaCha20Poly1305AEAD(const uint8_t *K_1, size_t K_1_len, const uint8_t *K_2, size_t K_2_len)
ChaCha20Poly1305AEAD(const ChaCha20Poly1305AEAD &)=delete