Bitcoin ABC  0.29.2
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
ChaCha20 Class Reference

A class for ChaCha20 256-bit stream cipher developed by Daniel J. More...

#include <chacha20.h>

Public Member Functions

 ChaCha20 ()
 
 ChaCha20 (const uint8_t *key, size_t keylen)
 
void SetKey (const uint8_t *key, size_t keylen)
 set key with flexible keylength; 256bit recommended More...
 
void SetIV (uint64_t iv)
 
void Seek (uint64_t pos)
 
void Keystream (uint8_t *c, size_t bytes)
 outputs the keystream of size <bytes> into More...
 
void Crypt (const uint8_t *input, uint8_t *output, size_t bytes)
 enciphers the message <input> of length <bytes> and write the enciphered representation into <output> Used for encryption and decryption (XOR) More...
 

Private Attributes

uint32_t input [16]
 

Detailed Description

A class for ChaCha20 256-bit stream cipher developed by Daniel J.

Bernstein https://cr.yp.to/chacha/chacha-20080128.pdf

Definition at line 15 of file chacha20.h.

Constructor & Destructor Documentation

◆ ChaCha20() [1/2]

ChaCha20::ChaCha20 ( )

Definition at line 61 of file chacha20.cpp.

◆ ChaCha20() [2/2]

ChaCha20::ChaCha20 ( const uint8_t *  key,
size_t  keylen 
)

Definition at line 65 of file chacha20.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Crypt()

void ChaCha20::Crypt ( const uint8_t *  input,
uint8_t *  output,
size_t  bytes 
)

enciphers the message <input> of length <bytes> and write the enciphered representation into <output> Used for encryption and decryption (XOR)

Definition at line 194 of file chacha20.cpp.

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

◆ Keystream()

void ChaCha20::Keystream ( uint8_t *  c,
size_t  bytes 
)

outputs the keystream of size <bytes> into

Definition at line 79 of file chacha20.cpp.

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

◆ Seek()

void ChaCha20::Seek ( uint64_t  pos)

Definition at line 74 of file chacha20.cpp.

Here is the caller graph for this function:

◆ SetIV()

void ChaCha20::SetIV ( uint64_t  iv)

Definition at line 69 of file chacha20.cpp.

Here is the caller graph for this function:

◆ SetKey()

void ChaCha20::SetKey ( const uint8_t *  key,
size_t  keylen 
)

set key with flexible keylength; 256bit recommended

Definition at line 32 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 ChaCha20::input[16]
private

Definition at line 17 of file chacha20.h.


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