43#include <StormByte/buffer/consumer.hxx>
46#include <StormByte/safe/binary.hxx>
47#include <StormByte/safe/clonable.hxx>
48#include <StormByte/type_traits.hxx>
49#include <StormByte/type_traits/safe.hxx>
153 template<StormByte::Type::ByteInputRange Range>
156 for (
const auto value: input) {
159 return Encrypt(std::span<const std::byte>(data.
span()), output);
214 template<StormByte::Type::ByteInputRange Range>
217 for (
const auto value: input) {
220 return Decrypt(std::span<const std::byte>(data.
span()), output);
AES-GCM crypter.
Definition aes_gcm.hxx:66
AES-CBC crypter.
Definition aes.hxx:66
Camellia-CBC crypter.
Definition camellia.hxx:66
ChaCha20-Poly1305 crypter.
Definition chachapoly.hxx:66
Elliptic-curve crypter.
Definition ecc.hxx:67
Abstract crypter.
Definition generic.hxx:94
bool Decrypt(std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
Decrypt a byte span.
Definition generic.hxx:203
virtual Buffer::Consumer DoEncrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept=0
Encrypt a Consumer.
bool Encrypt(const Range &input, Buffer::WriteOnly &output) const
Encrypt an input range of byte-convertible values.
Definition generic.hxx:154
Buffer::Consumer Encrypt(Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
Encrypt a Consumer into another Consumer.
Definition generic.hxx:188
bool Encrypt(const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
Encrypt a read-only buffer (copy).
Definition generic.hxx:168
virtual bool DoDecrypt(std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept=0
Decrypt a byte span.
bool Decrypt(Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
Decrypt a buffer, consuming it.
Definition generic.hxx:239
bool Decrypt(const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
Decrypt a read-only buffer (copy).
Definition generic.hxx:229
bool Encrypt(Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
Encrypt a buffer, consuming it.
Definition generic.hxx:178
Generic(const Generic &other)=default
Copy constructor.
enum Type m_type
Cipher.
Definition generic.hxx:263
Generic(Generic &&other) noexcept=default
Move constructor.
enum Type Type() const noexcept
Cipher of this crypter.
Definition generic.hxx:258
Generic(enum Type type)
Construct with a cipher.
Definition generic.hxx:269
Buffer::Consumer Decrypt(Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
Decrypt a Consumer into another Consumer.
Definition generic.hxx:249
virtual Buffer::Consumer DoDecrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept=0
Decrypt a Consumer.
bool Decrypt(const Range &input, Buffer::WriteOnly &output) const
Decrypt an input range of byte-convertible values.
Definition generic.hxx:215
bool Encrypt(std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
Encrypt a byte span.
Definition generic.hxx:142
virtual bool DoEncrypt(std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept=0
Encrypt a byte span.
virtual ~Generic() noexcept
Destructor.
RSA crypter.
Definition rsa.hxx:67
Serpent-CBC crypter.
Definition serpent.hxx:66
Twofish-CBC crypter.
Definition twofish.hxx:66
reference emplace_back(T &&value)
STORMBYTE_FORCE_INLINE std::span< std::byte > span() noexcept
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
Ciphers of the Crypto module.
Crypto module of the StormByte suite.
Definition aead.hxx:53
ReadMode
How a source buffer is consumed.
Definition typedefs.hxx:57
@ Copy
Copy the input.
Definition typedefs.hxx:58
@ Move
Consume the input.
Definition typedefs.hxx:59
Root namespace of the StormByte suite.
#define STORMBYTE_CRYPTO_PUBLIC
Definition visibility.h:53