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 | List of all members
StormByte::Crypto::Crypter::ChaChaPoly Class Referencefinal

A symmetric crypter class. More...

#include <chachapoly.hxx>

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

Public Member Functions

 ChaChaPoly (const std::string &password)
 Constructor.
 
 ChaChaPoly (const ChaChaPoly &other)=default
 Copy constructor.
 
 ChaChaPoly (ChaChaPoly &&other) noexcept=default
 Move constructor.
 
virtual ~ChaChaPoly () noexcept=default
 Virtual destructor.
 
ChaChaPolyoperator= (const ChaChaPoly &other)=default
 Copy assignment operator.
 
ChaChaPolyoperator= (ChaChaPoly &&other) noexcept=default
 Move assignment operator.
 
PointerType Clone () const noexcept override
 Clone the ChaChaPoly crypter.
 
PointerType Move () noexcept override
 Move the ChaChaPoly crypter.
 
- Public Member Functions inherited from StormByte::Crypto::Crypter::Symmetric
 Symmetric (const Symmetric &other)=default
 Copy constructor.
 
 Symmetric (Symmetric &&other) noexcept=default
 Move constructor.
 
virtual ~Symmetric () noexcept=default
 Virtual destructor.
 
Symmetricoperator= (const Symmetric &other)=default
 Copy assignment operator.
 
Symmetricoperator= (Symmetric &&other) noexcept=default
 Move assignment operator.
 
const std::string & Password () const noexcept
 Gets the password used for symmetric encryption.
 
- Public Member Functions inherited from StormByte::Crypto::Crypter::Generic
 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from StormByte::Crypto::Crypter::Symmetric
static std::string RandomPassword (size_t length=32) noexcept
 Generates a random password for symmetric encryption.
 
- Protected Member Functions inherited from StormByte::Crypto::Crypter::Symmetric
 Symmetric (enum Type type, const std::string &password)
 Constructor.
 
- Protected Member Functions inherited from StormByte::Crypto::Crypter::Generic
 Generic (enum Type type)
 Constructor.
 
- Protected Attributes inherited from StormByte::Crypto::Crypter::Symmetric
std::string m_password
 The password used for symmetric encryption.
 
- Protected Attributes inherited from StormByte::Crypto::Crypter::Generic
enum Type m_type
 The type of crypter.
 

Detailed Description

A symmetric crypter class.

Constructor & Destructor Documentation

◆ ChaChaPoly() [1/3]

StormByte::Crypto::Crypter::ChaChaPoly::ChaChaPoly ( const std::string &  password)
inline

Constructor.

Parameters
typeThe type of crypter.

◆ ChaChaPoly() [2/3]

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

Copy constructor.

Parameters
otherThe other ChaChaPoly crypter to copy from.

◆ ChaChaPoly() [3/3]

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

Move constructor.

Parameters
otherThe other ChaChaPoly crypter to move from.

Member Function Documentation

◆ Clone()

PointerType StormByte::Crypto::Crypter::ChaChaPoly::Clone ( ) const
inlineoverridenoexcept

Clone the ChaChaPoly crypter.

Returns
A pointer to the cloned ChaChaPoly crypter.

◆ Move()

PointerType StormByte::Crypto::Crypter::ChaChaPoly::Move ( )
inlineoverridenoexcept

Move the ChaChaPoly crypter.

Returns
A pointer to the moved ChaChaPoly crypter.

◆ operator=() [1/2]

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

Move assignment operator.

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

◆ operator=() [2/2]

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

Copy assignment operator.

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

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