42 #ifndef _DWMXCHACHA20POLY1305INBUFFER_HH_ 43 #define _DWMXCHACHA20POLY1305INBUFFER_HH_ 47 #include <cryptopp/cryptlib.h> 48 #include <cryptopp/chachapoly.h> 52 namespace XChaCha20Poly1305 {
64 :
public std::streambuf
72 InBuffer(std::istream & is,
const std::string & key);
78 int_type underflow()
override;
82 std::unique_ptr<char_type[]> _buffer;
83 CryptoPP::XChaCha20Poly1305::Decryption _decryptor;
84 CryptoPP::byte _key[32];
99 bool LoadIVAndCipherText(CryptoPP::byte *iv,
size_t ivlen,
100 std::string & cipherText);
107 #endif // _DWMXCHACHA20POLY1305INBUFFER_HH_ This class is a helper for encrypted stream input.
Definition: DwmXChaCha20Poly1305InBuffer.hh:63
InBuffer(std::istream &is, const std::string &key)
Construct from the given encrypted istream is and the decryption key key.