Bitcoin Core  25.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
ChaCha20Aligned Class Reference

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]
 

Detailed Description

ChaCha20 cipher that only operates on multiples of 64 bytes.

Definition at line 15 of file chacha20.h.

Constructor & Destructor Documentation

◆ ChaCha20Aligned() [1/2]

ChaCha20Aligned::ChaCha20Aligned ( )

Definition at line 40 of file chacha20.cpp.

◆ ChaCha20Aligned() [2/2]

ChaCha20Aligned::ChaCha20Aligned ( const unsigned char *  key32)

Initialize a cipher with specified 32-byte key.

Definition at line 45 of file chacha20.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Crypt64()

void ChaCha20Aligned::Crypt64 ( const unsigned char *  input,
unsigned char *  output,
size_t  blocks 
)
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.

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

◆ Keystream64()

void ChaCha20Aligned::Keystream64 ( unsigned char *  c,
size_t  blocks 
)
inline

outputs the keystream of size <64*blocks> into

Definition at line 62 of file chacha20.cpp.

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

◆ Seek64()

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.

Here is the caller graph for this function:

◆ SetIV()

void ChaCha20Aligned::SetIV ( uint64_t  iv)

set the 64-bit nonce.

Definition at line 50 of file chacha20.cpp.

Here is the caller graph for this function:

◆ SetKey32()

void ChaCha20Aligned::SetKey32 ( const unsigned char *  key32)

set 32-byte key.

Definition at line 24 of file chacha20.cpp.

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

Member Data Documentation

◆ input

uint32_t ChaCha20Aligned::input[12]
private

Definition at line 18 of file chacha20.h.


The documentation for this class was generated from the following files: