StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StormByte::Crypto::Crypter::Generic Class Referenceabstract

A generic crypter class. More...

#include <generic.hxx>

Inheritance diagram for StormByte::Crypto::Crypter::Generic:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Crypto::Crypter::Generic:
Collaboration graph
[legend]

Public Member Functions

 Generic (const Generic &other)=default
 Copy constructor.
 
 Generic (Generic &&other) noexcept=default
 Move constructor.
 
virtual ~Generic () noexcept=default
 Virtual destructor.
 
Genericoperator= (const Generic &other)=default
 Copy assignment operator.
 
Genericoperator= (Generic &&other) noexcept=default
 Move assignment operator.
 
bool Encrypt (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Encrypt data from input buffer to output buffer.
 
bool Encrypt (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Encrypt data from input buffer to output buffer.
 
bool Encrypt (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Encrypt data from input buffer to output buffer, moving the input data.
 
Buffer::Consumer Encrypt (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Encrypt data from a Consumer buffer.
 
bool Decrypt (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Decrypt data from input buffer to output buffer.
 
bool Decrypt (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Decrypt data from input buffer to output buffer.
 
bool Decrypt (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Decrypt data from input buffer to output buffer, moving the input data.
 
Buffer::Consumer Decrypt (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Decrypt data from a Consumer buffer.
 
enum Type Type () const noexcept
 Gets the type of crypter.
 

Protected Member Functions

 Generic (enum Type type)
 Constructor.
 

Protected Attributes

enum Type m_type
 The type of crypter.
 

Detailed Description

A generic crypter class.

Constructor & Destructor Documentation

◆ Generic() [1/3]

StormByte::Crypto::Crypter::Generic::Generic ( const Generic other)
default

Copy constructor.

Parameters
otherThe other Generic crypter to copy from.

◆ Generic() [2/3]

StormByte::Crypto::Crypter::Generic::Generic ( Generic &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other Generic crypter to move from.

◆ Generic() [3/3]

StormByte::Crypto::Crypter::Generic::Generic ( enum Type  type)
inlineprotected

Constructor.

Parameters
typeThe type of crypter.

Member Function Documentation

◆ Decrypt() [1/4]

Buffer::Consumer StormByte::Crypto::Crypter::Generic::Decrypt ( Buffer::Consumer  consumer,
ReadMode  mode = ReadMode::Move 
) const
inlinenoexcept

Decrypt data from a Consumer buffer.

Parameters
consumerThe Consumer buffer to decrypt.
modeThe read mode indicating copy or move.
Returns
A Consumer buffer containing the decrypted data.

◆ Decrypt() [2/4]

bool StormByte::Crypto::Crypter::Generic::Decrypt ( Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Decrypt data from input buffer to output buffer, moving the input data.

Parameters
inputThe input buffer to decrypt.
outputThe output buffer to write the decrypted data to.
Returns
true if decryption was successful, false otherwise.

◆ Decrypt() [3/4]

bool StormByte::Crypto::Crypter::Generic::Decrypt ( const Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Decrypt data from input buffer to output buffer.

Parameters
inputThe input buffer to decrypt.
outputThe output buffer to write the decrypted data to.
Returns
true if decryption was successful, false otherwise.

◆ Decrypt() [4/4]

bool StormByte::Crypto::Crypter::Generic::Decrypt ( std::span< const std::byte >  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Decrypt data from input buffer to output buffer.

Parameters
inputThe input buffer to decrypt.
outputThe output buffer to write the decrypted data to.
Returns
true if decryption was successful, false otherwise.

◆ Encrypt() [1/4]

Buffer::Consumer StormByte::Crypto::Crypter::Generic::Encrypt ( Buffer::Consumer  consumer,
ReadMode  mode = ReadMode::Move 
) const
inlinenoexcept

Encrypt data from a Consumer buffer.

Parameters
consumerThe Consumer buffer to encrypt.
modeThe read mode indicating copy or move.
Returns
A Consumer buffer containing the encrypted data.

◆ Encrypt() [2/4]

bool StormByte::Crypto::Crypter::Generic::Encrypt ( Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Encrypt data from input buffer to output buffer, moving the input data.

Parameters
inputThe input buffer to encrypt.
outputThe output buffer to write the encrypted data to.
Returns
true if encryption was successful, false otherwise.

◆ Encrypt() [3/4]

bool StormByte::Crypto::Crypter::Generic::Encrypt ( const Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Encrypt data from input buffer to output buffer.

Parameters
inputThe input buffer to encrypt.
outputThe output buffer to write the encrypted data to.
Returns
true if encryption was successful, false otherwise.

◆ Encrypt() [4/4]

bool StormByte::Crypto::Crypter::Generic::Encrypt ( std::span< const std::byte >  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Encrypt data from input buffer to output buffer.

Parameters
inputThe input buffer to encrypt.
outputThe output buffer to write the encrypted data to.
Returns
true if encryption was successful, false otherwise.

◆ operator=() [1/2]

Generic & StormByte::Crypto::Crypter::Generic::operator= ( const Generic other)
default

Copy assignment operator.

Parameters
otherThe other Generic crypter to copy from.
Returns
Reference to this Generic crypter.

◆ operator=() [2/2]

Generic & StormByte::Crypto::Crypter::Generic::operator= ( Generic &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe other Generic crypter to move from.
Returns
Reference to this Generic crypter.

◆ Type()

enum Type StormByte::Crypto::Crypter::Generic::Type ( ) const
inlinenoexcept

Gets the type of crypter.

Returns
The type of crypter.

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