StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
aes.hxx
1#pragma once
2
3#include <StormByte/crypto/crypter/symmetric/generic.hxx>
4
9namespace StormByte::Crypto::Crypter {
14 class STORMBYTE_CRYPTO_PUBLIC AES final: public Symmetric {
15 public:
20 inline AES(const std::string& password):
21 Symmetric(Type::AES, password) {}
22
27 AES(const AES& other) = default;
28
33 AES(AES&& other) noexcept = default;
34
38 virtual ~AES() noexcept = default;
39
45 AES& operator=(const AES& other) = default;
46
52 AES& operator=(AES&& other) noexcept = default;
53
58 inline PointerType Clone() const noexcept override {
59 return std::make_shared<AES>(*this);
60 }
61
66 inline PointerType Move() noexcept override {
67 return std::make_shared<AES>(std::move(*this));
68 }
69 private:
76 bool DoEncrypt(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
77
84 Buffer::Consumer DoEncrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
85
92 bool DoDecrypt(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
93
100 Buffer::Consumer DoDecrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
101 };
102}
A symmetric crypter class.
Definition aes.hxx:14
virtual ~AES() noexcept=default
Virtual destructor.
AES(const std::string &password)
Constructor.
Definition aes.hxx:20
PointerType Move() noexcept override
Move the AES crypter.
Definition aes.hxx:66
AES(AES &&other) noexcept=default
Move constructor.
AES(const AES &other)=default
Copy constructor.
A generic symmetric crypter class.
Definition generic.hxx:16