AEADChaCha20Poly1305 (crypto/chacha20poly1305.h)

bitcoin · src/crypto/chacha20poly1305.h · c · MIT
security, tag:knn-classified

Provides AEAD ChaCha20-Poly1305 encryption and forward-secure wrapper for secure messaging.

// Source: https://github.com/bitcoin/bitcoin | License: MIT | Copyright 2009-2026 The Bitcoin Core developers
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright (c) 2023-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_CRYPTO_CHACHA20POLY1305_H
#define BITCOIN_CRYPTO_CHACHA20POLY1305_H

#include <cstddef>
#include <cstdint>
#include <span>

#include <crypto/chacha20.h>
#include <crypto/poly1305.h>

/** The AEAD_CHACHA20_POLY1305 authenticated encryption algorithm from RFC8439 section 2.8. */
class AEADChaCha20Poly1305
{
    /** Internal stream cipher. */
    ChaCha20 m_chacha20;

public:
    /** Expected size of key argum

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key