Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
ChaCha20Poly1305.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef ENIGMA_CHACHA_H
3 #define ENIGMA_CHACHA_H
4 
6 
15 class ChaCha20Poly1305 : public Algorithm {
16  public:
20  explicit ChaCha20Poly1305(const Algorithm::Intent intent) noexcept;
21  ~ChaCha20Poly1305() noexcept override;
22 
23  public:
24  std::vector<byte> Encrypt(const std::string& password, const byte *buffer, const std::size_t buffSize) override;
25  std::vector<byte> Encrypt(const std::string& password, const std::vector<byte>& buffer) override;
26  std::vector<byte> Decrypt(const std::string& password, const byte *cipher, const std::size_t cipherSize) override;
27  std::vector<byte> Decrypt(const std::string& password, const std::vector<byte>& cipher) override;
28  void Encrypt(const std::string& password, const fs::path& in_filename, const fs::path& out_filename) override;
29  void Decrypt(const std::string& password, const fs::path& in_filename, const fs::path& out_filename) override;
30 
31  private:
32  std::unique_ptr<CryptoPP::ChaCha20Poly1305::Encryption> m_chacha_encryptor;
33  std::unique_ptr<CryptoPP::ChaCha20Poly1305::Decryption> m_chacha_decryptor;
34 };
35 
37 #endif // !ENIGMA_CHACHA_H
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Algorithm abstract class.
Definition: Algorithm.hpp:53
~ChaCha20Poly1305() noexcept override
std::vector< byte > Encrypt(const std::string &password, const byte *buffer, const std::size_t buffSize) override
ChaCha20Poly1305(const Algorithm::Intent intent) noexcept
std::vector< byte > Decrypt(const std::string &password, const byte *cipher, const std::size_t cipherSize) override