Bitcoin Core  25.99.0
P2P Digital Currency
Functions | Variables
chacha_poly_aead.cpp File Reference
#include <bench/bench.h>
#include <crypto/chacha_poly_aead.h>
#include <crypto/poly1305.h>
#include <hash.h>
#include <assert.h>
#include <limits>
Include dependency graph for chacha_poly_aead.cpp:

Go to the source code of this file.

Functions

static void CHACHA20_POLY1305_AEAD (benchmark::Bench &bench, size_t buffersize, bool include_decryption)
 
static void CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT (benchmark::Bench &bench)
 
static void CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT (benchmark::Bench &bench)
 
static void CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT (benchmark::Bench &bench)
 
static void CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT (benchmark::Bench &bench)
 
static void CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT (benchmark::Bench &bench)
 
static void CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT (benchmark::Bench &bench)
 
static void HASH (benchmark::Bench &bench, size_t buffersize)
 
static void HASH_64BYTES (benchmark::Bench &bench)
 
static void HASH_256BYTES (benchmark::Bench &bench)
 
static void HASH_1MB (benchmark::Bench &bench)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (HASH_64BYTES, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (HASH_256BYTES, benchmark::PriorityLevel::HIGH)
 
 BENCHMARK (HASH_1MB, benchmark::PriorityLevel::HIGH)
 

Variables

static constexpr uint64_t BUFFER_SIZE_TINY = 64
 
static constexpr uint64_t BUFFER_SIZE_SMALL = 256
 
static constexpr uint64_t BUFFER_SIZE_LARGE = 1024 * 1024
 
static const unsigned char k1 [32] = {0}
 
static const unsigned char k2 [32] = {0}
 
static ChaCha20Poly1305AEAD aead (k1, 32, k2, 32)
 

Function Documentation

◆ BENCHMARK() [1/9]

◆ BENCHMARK() [2/9]

◆ BENCHMARK() [3/9]

◆ BENCHMARK() [4/9]

◆ BENCHMARK() [5/9]

◆ BENCHMARK() [6/9]

◆ BENCHMARK() [7/9]

BENCHMARK ( HASH_1MB  ,
benchmark::PriorityLevel::HIGH   
)

◆ BENCHMARK() [8/9]

◆ BENCHMARK() [9/9]

◆ CHACHA20_POLY1305_AEAD()

static void CHACHA20_POLY1305_AEAD ( benchmark::Bench bench,
size_t  buffersize,
bool  include_decryption 
)
static

Definition at line 24 of file chacha_poly_aead.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT()

static void CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT ( benchmark::Bench bench)
static

Definition at line 87 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT()

static void CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT ( benchmark::Bench bench)
static

Definition at line 72 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT()

static void CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT ( benchmark::Bench bench)
static

Definition at line 82 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT()

static void CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT ( benchmark::Bench bench)
static

Definition at line 67 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT()

static void CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT ( benchmark::Bench bench)
static

Definition at line 77 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT()

static void CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT ( benchmark::Bench bench)
static

Definition at line 62 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ HASH()

static void HASH ( benchmark::Bench bench,
size_t  buffersize 
)
static

Definition at line 94 of file chacha_poly_aead.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HASH_1MB()

static void HASH_1MB ( benchmark::Bench bench)
static

Definition at line 113 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ HASH_256BYTES()

static void HASH_256BYTES ( benchmark::Bench bench)
static

Definition at line 108 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

◆ HASH_64BYTES()

static void HASH_64BYTES ( benchmark::Bench bench)
static

Definition at line 103 of file chacha_poly_aead.cpp.

Here is the call graph for this function:

Variable Documentation

◆ aead

ChaCha20Poly1305AEAD aead(k1, 32, k2, 32) ( k1  ,
32  ,
k2  ,
32   
)
static

◆ BUFFER_SIZE_LARGE

constexpr uint64_t BUFFER_SIZE_LARGE = 1024 * 1024
staticconstexpr

Definition at line 17 of file chacha_poly_aead.cpp.

◆ BUFFER_SIZE_SMALL

constexpr uint64_t BUFFER_SIZE_SMALL = 256
staticconstexpr

Definition at line 16 of file chacha_poly_aead.cpp.

◆ BUFFER_SIZE_TINY

constexpr uint64_t BUFFER_SIZE_TINY = 64
staticconstexpr

Definition at line 15 of file chacha_poly_aead.cpp.

◆ k1

const unsigned char k1[32] = {0}
static

Definition at line 19 of file chacha_poly_aead.cpp.

◆ k2

const unsigned char k2[32] = {0}
static

Definition at line 20 of file chacha_poly_aead.cpp.