Abstract crypter.
More...
#include <StormByte/crypto/crypter/generic.hxx>
|
| enum Type | Type () const noexcept |
| | Cipher of this crypter.
|
| | Generic (const Generic &other)=default |
| | Copy constructor.
|
| | Generic (Generic &&other) noexcept=default |
| | Move constructor.
|
| virtual | ~Generic () noexcept |
| | Destructor.
|
| Generic & | operator= (const Generic &other)=default |
| | Copy assignment.
|
| Generic & | operator= (Generic &&other) noexcept=default |
| | Move assignment.
|
| bool | Encrypt (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept |
| | Encrypt a byte span.
|
| template<StormByte::Type::ByteInputRange Range> |
| bool | Encrypt (const Range &input, Buffer::WriteOnly &output) const |
| | Encrypt an input range of byte-convertible values.
|
| bool | Encrypt (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept |
| | Encrypt a read-only buffer (copy).
|
| bool | Encrypt (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept |
| | Encrypt a buffer, consuming it.
|
| Buffer::Consumer | Encrypt (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept |
| | Encrypt a Consumer into another Consumer.
|
| bool | Decrypt (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept |
| | Decrypt a byte span.
|
| template<StormByte::Type::ByteInputRange Range> |
| bool | Decrypt (const Range &input, Buffer::WriteOnly &output) const |
| | Decrypt an input range of byte-convertible values.
|
| bool | Decrypt (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept |
| | Decrypt a read-only buffer (copy).
|
| bool | Decrypt (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept |
| | Decrypt a buffer, consuming it.
|
| Buffer::Consumer | Decrypt (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept |
| | Decrypt a Consumer into another Consumer.
|
| constexpr | Clonable ()=default |
| constexpr Clonable & | operator= (const Clonable &)=default |
| virtual constexpr | ~Clonable () noexcept=default |
| virtual PointerType | Clone () const =0 |
| virtual PointerType | Move ()=0 |
Abstract crypter.
Concrete ciphers derive from this.
- Note
- MaybeSafe requires ABI-compatible toolchains and all provider modules to remain loaded while objects, virtual functions or ownership callbacks can be used. The stored cipher enum is Safe; inline special members own no local heap storage. Destruction is exported, and owning Clone/Move implementations must allocate and bind creator/deleter callbacks in their provider module through Safe ownership operations. Derived providers must keep every field Safe or satisfy its MaybeSafe requirements, and preserve provider-owned allocation, copying, assignment, movement and destruction.
◆ Generic() [1/3]
| StormByte::Crypto::Crypter::Generic::Generic |
( |
const Generic & | other | ) |
|
|
default |
Copy constructor.
- Parameters
-
◆ Generic() [2/3]
| StormByte::Crypto::Crypter::Generic::Generic |
( |
Generic && | other | ) |
|
|
defaultnoexcept |
Move constructor.
- Parameters
-
◆ ~Generic()
| virtual StormByte::Crypto::Crypter::Generic::~Generic |
( |
| ) |
|
|
virtualnoexcept |
◆ Generic() [3/3]
| StormByte::Crypto::Crypter::Generic::Generic |
( |
enum Type | type | ) |
|
|
inlineprotected |
Construct with a cipher.
- Parameters
-
◆ Decrypt() [1/5]
Decrypt a Consumer into another Consumer.
- Parameters
-
| consumer | Input consumer. |
| mode | Copy or move. |
- Returns
- Consumer with plaintext.
◆ Decrypt() [2/5]
Decrypt a buffer, consuming it.
- Parameters
-
| input | Input buffer. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Decrypt() [3/5]
Decrypt a read-only buffer (copy).
- Parameters
-
| input | Input buffer. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Decrypt() [4/5]
| bool StormByte::Crypto::Crypter::Generic::Decrypt |
( |
const Range & | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
inline |
Decrypt an input range of byte-convertible values.
- Template Parameters
-
- Parameters
-
| input | Input values. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Decrypt() [5/5]
| bool StormByte::Crypto::Crypter::Generic::Decrypt |
( |
std::span< const std::byte > | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
inlinenoexcept |
Decrypt a byte span.
- Parameters
-
| input | Input bytes. |
| output | Destination buffer. |
- Returns
- true on success.
◆ DoDecrypt() [1/2]
|
|
protectedpure virtualnoexcept |
Decrypt a Consumer.
- Parameters
-
| consumer | Input consumer. |
| mode | Copy or move. |
- Returns
- Consumer with plaintext.
◆ DoDecrypt() [2/2]
| virtual bool StormByte::Crypto::Crypter::Generic::DoDecrypt |
( |
std::span< const std::byte > | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
protectedpure virtualnoexcept |
Decrypt a byte span.
- Parameters
-
| input | Input bytes. |
| output | Destination buffer. |
- Returns
- true on success.
◆ DoEncrypt() [1/2]
|
|
protectedpure virtualnoexcept |
Encrypt a Consumer.
- Parameters
-
| consumer | Input consumer. |
| mode | Copy or move. |
- Returns
- Consumer with ciphertext.
◆ DoEncrypt() [2/2]
| virtual bool StormByte::Crypto::Crypter::Generic::DoEncrypt |
( |
std::span< const std::byte > | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
protectedpure virtualnoexcept |
Encrypt a byte span.
- Parameters
-
| input | Input bytes. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Encrypt() [1/5]
Encrypt a Consumer into another Consumer.
- Parameters
-
| consumer | Input consumer. |
| mode | Copy or move. |
- Returns
- Consumer with ciphertext.
◆ Encrypt() [2/5]
Encrypt a buffer, consuming it.
- Parameters
-
| input | Input buffer. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Encrypt() [3/5]
Encrypt a read-only buffer (copy).
- Parameters
-
| input | Input buffer. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Encrypt() [4/5]
| bool StormByte::Crypto::Crypter::Generic::Encrypt |
( |
const Range & | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
inline |
Encrypt an input range of byte-convertible values.
- Template Parameters
-
- Parameters
-
| input | Input values. |
| output | Destination buffer. |
- Returns
- true on success.
◆ Encrypt() [5/5]
| bool StormByte::Crypto::Crypter::Generic::Encrypt |
( |
std::span< const std::byte > | input, |
|
|
Buffer::WriteOnly & | output ) const |
|
inlinenoexcept |
Encrypt a byte span.
- Parameters
-
| input | Input bytes. |
| output | Destination buffer. |
- Returns
- true on success.
◆ operator=() [1/2]
| Generic & StormByte::Crypto::Crypter::Generic::operator= |
( |
const Generic & | other | ) |
|
|
default |
Copy assignment.
- Parameters
-
- Returns
- Reference to this crypter.
◆ operator=() [2/2]
| Generic & StormByte::Crypto::Crypter::Generic::operator= |
( |
Generic && | other | ) |
|
|
defaultnoexcept |
Move assignment.
- Parameters
-
- Returns
- Reference to this crypter.
◆ Type()
| enum Type StormByte::Crypto::Crypter::Generic::Type |
( |
| ) |
const |
|
inlinenoexcept |
Cipher of this crypter.
- Returns
- Crypter type.
◆ m_type
| enum Type StormByte::Crypto::Crypter::Generic::m_type |
|
protected |
The documentation for this class was generated from the following file: