StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
ecc.hxx
1#pragma once
2
3#include <StormByte/crypto/crypter/asymmetric/generic.hxx>
4#include <StormByte/crypto/keypair/ecc.hxx>
5
10namespace StormByte::Crypto::Crypter {
15 class STORMBYTE_CRYPTO_PUBLIC ECC final: public Asymmetric {
16 public:
21 inline ECC(KeyPair::Generic::PointerType keypair):
22 Asymmetric(Type::ECC, keypair) {}
23
28 inline ECC(const KeyPair::ECC& keypair):
29 Asymmetric(Type::ECC, keypair) {}
30
35 inline ECC(KeyPair::ECC&& keypair):
36 Asymmetric(Type::ECC, std::forward<KeyPair::ECC>(keypair)) {}
37
42 ECC(const ECC& other) = default;
43
48 ECC(ECC&& other) noexcept = default;
49
53 virtual ~ECC() noexcept = default;
54
60 ECC& operator=(const ECC& other) = default;
61
67 ECC& operator=(ECC&& other) noexcept = default;
68
73 inline PointerType Clone() const noexcept override {
74 return std::make_shared<ECC>(*this);
75 }
76
81 inline PointerType Move() noexcept override {
82 return std::make_shared<ECC>(std::move(*this));
83 }
84
85 private:
92 bool DoEncrypt(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
93
100 Buffer::Consumer DoEncrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
101
108 bool DoDecrypt(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
109
116 Buffer::Consumer DoDecrypt(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
117 };
118}
A generic asymmetric crypter class.
Definition generic.hxx:15
An asymmetric crypter class.
Definition ecc.hxx:15
ECC(const KeyPair::ECC &keypair)
Constructor.
Definition ecc.hxx:28
ECC(KeyPair::Generic::PointerType keypair)
Constructor.
Definition ecc.hxx:21
virtual ~ECC() noexcept=default
Virtual destructor.
ECC(KeyPair::ECC &&keypair)
Constructor.
Definition ecc.hxx:35
PointerType Move() noexcept override
Move the ECC crypter.
Definition ecc.hxx:81
ECC(const ECC &other)=default
Copy constructor.
ECC(ECC &&other) noexcept=default
Move constructor.
A ECC keypair class.
Definition ecc.hxx:14
The namespace containing all the keypair-related classes.