C++ Essence Library 0.1.0
A Utility Library for Modern C++ Programming
Loading...
Searching...
No Matches
essence::crypto::abstract::chunk_processor Class Reference

Provides a uniform interface for processing crypto chunks. More...

#include <chunk_processor.hpp>

Public Member Functions

template<typename T >
requires (!std::same_as<std::decay_t<T>, chunk_processor>)
 chunk_processor (T &&value)
 
bool transformer () const
 Indicates whether this is a forward transformer.
 
abi::string cipher_name () const
 Gets the name of the cipher.
 
std::size_t buffer_size () const
 Gets the size of the input buffer.
 
std::size_t extra_size () const
 Gets the extra size of the output buffer.
 
rational size_factor () const
 Gets the factor to be multiplied to the input buffer size and the result is the size of the output buffer.
 
void init () const
 Initializes the processor.
 
void update (std::span< const std::byte > input, std::span< std::byte > &output) const
 Processes a memory chunk.
 
void finalize (std::span< std::byte > &output) const
 Gets the final chunk.
 

Detailed Description

Provides a uniform interface for processing crypto chunks.

Remarks
This interface always keeps uniquely referenced.

Member Function Documentation

◆ buffer_size()

std::size_t essence::crypto::abstract::chunk_processor::buffer_size ( ) const
inlinenodiscard

Gets the size of the input buffer.

Returns
The size of the input buffer.

◆ cipher_name()

abi::string essence::crypto::abstract::chunk_processor::cipher_name ( ) const
inlinenodiscard

Gets the name of the cipher.

Returns
The name of the cipher.

◆ extra_size()

std::size_t essence::crypto::abstract::chunk_processor::extra_size ( ) const
inlinenodiscard

Gets the extra size of the output buffer.

Returns
The extra size of the output buffer.

◆ finalize()

void essence::crypto::abstract::chunk_processor::finalize ( std::span< std::byte > & output) const
inline

Gets the final chunk.

Parameters
outputThe output chunk, which may be replaced with a subspan of the given span.

◆ size_factor()

rational essence::crypto::abstract::chunk_processor::size_factor ( ) const
inlinenodiscard

Gets the factor to be multiplied to the input buffer size and the result is the size of the output buffer.

Returns
The factor described as a rational number.

◆ transformer()

bool essence::crypto::abstract::chunk_processor::transformer ( ) const
inlinenodiscard

Indicates whether this is a forward transformer.

Returns
True if this is a forward transformer; false if an inverse transformer.

◆ update()

void essence::crypto::abstract::chunk_processor::update ( std::span< const std::byte > input,
std::span< std::byte > & output ) const
inline

Processes a memory chunk.

Parameters
inputThe input chunk.
outputThe output chunk, which may be replaced with a subspan of the given span.

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