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

Public Types

enum  dir_t { ENC , DEC }
 Direction of processing for dual mode. More...
 

Public Member Functions

 aead_chacha_poly1305 (dir_t direction, const unsigned char *key, uint32_t keylen, const unsigned char *nonce, uint32_t noncelen, uint32_t icvlen=0)
 
 ~aead_chacha_poly1305 ()
 Standard Deconstructor for AEAD CHACHA20-POLY1305 algorithm.
 
void ProcessData (const unsigned char *input, unsigned char *output, uint32_t length, const unsigned char *aad, uint32_t aadlen)
 
void result (unsigned char *icv, uint32_t length=16)
 
 aead_chacha_poly1305 (aead_chacha_poly1305 &rhs)=delete
 
 aead_chacha_poly1305 (const aead_chacha_poly1305 &rhs)=delete
 

Member Enumeration Documentation

◆ dir_t

Direction of processing for dual mode.

Enumerator
ENC 

Encryption.

DEC 

Decryption.

Constructor & Destructor Documentation

◆ aead_chacha_poly1305()

ProtocolPP::aead_chacha_poly1305::aead_chacha_poly1305 ( dir_t  direction,
const unsigned char *  key,
uint32_t  keylen,
const unsigned char *  nonce,
uint32_t  noncelen,
uint32_t  icvlen = 0 
)

Constructor for AEAD CHACHA20-POLY1305 algorithm

Parameters
direction- direction of processing
key- initialization key
keylen- length of the key in bytes
nonce- nonce for computation
noncelen- length of the nonce in bytes
icvlen- for decryption, length of the ICV tag

Member Function Documentation

◆ ProcessData()

void ProtocolPP::aead_chacha_poly1305::ProcessData ( const unsigned char *  input,
unsigned char *  output,
uint32_t  length,
const unsigned char *  aad,
uint32_t  aadlen 
)

Calculates the ciphertext and MAC for AEAD CHACHA20-POLY1305 algorithm

Parameters
input- data to process
output- result of the computation
length- length of the data
aad- authentication only data
aadlen- length of the AAD data

◆ result()

void ProtocolPP::aead_chacha_poly1305::result ( unsigned char *  icv,
uint32_t  length = 16 
)

Returns the MAC using for AEAD CHACHA20-POLY1305 algorithm

Parameters
icv- ICV tag to retrieve
length- length of ICV to retrieve

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