Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::chacha20 Class Reference

Public Member Functions

 chacha20 (const uint8_t *key, const uint8_t *nonce, uint64_t counter)
 
 chacha20 (const uint8_t *ctx, uint32_t length)
 
virtual ~chacha20 ()=default
 Standard Deconstructor.
 
void ProcessData (const uint8_t *input, uint8_t *output, uint32_t length)
 
void context (uint8_t *context, uint32_t length=32)
 
 chacha20 (chacha20 &rhs)=delete
 
 chacha20 (const chacha20 &rhs)=delete
 

Constructor & Destructor Documentation

◆ chacha20() [1/2]

ProtocolPP::chacha20::chacha20 ( const uint8_t *  key,
const uint8_t *  nonce,
uint64_t  counter 
)

Constructor for CHACHA20 algorithm

Parameters
key- key for encryption
nonce- initial value for the NONCE
counter- initial counter value

◆ chacha20() [2/2]

ProtocolPP::chacha20::chacha20 ( const uint8_t *  ctx,
uint32_t  length 
)

Constructor for CHACHA20 algorithm with context

Parameters
ctx- Context to re-initialize the engine with
length- length of the context in bytes (must be 64)

Member Function Documentation

◆ context()

void ProtocolPP::chacha20::context ( uint8_t *  context,
uint32_t  length = 32 
)

Function to return CHACHA20 state

Parameters
context- state of the engine
length- length up to 64 bytes of state. Length of 32 is needed for AEAD_CHACHA20_POLY1305

◆ ProcessData()

void ProtocolPP::chacha20::ProcessData ( const uint8_t *  input,
uint8_t *  output,
uint32_t  length 
)

Function to encrypt data with CHACHA20

Parameters
input- plain/ciphertext
output- resulting cipher/plaintext
length- length of the data

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