17 std::unique_ptr<folly::IOBuf>
key;
18 std::unique_ptr<folly::IOBuf>
iv;
26 virtual ~
Aead() =
default;
31 virtual size_t keyLength()
const = 0;
36 virtual size_t ivLength()
const = 0;
47 virtual std::unique_ptr<folly::IOBuf> encrypt(
48 std::unique_ptr<folly::IOBuf>&& plaintext,
57 virtual void setEncryptedBufferHeadroom(
size_t headroom) = 0;
63 virtual std::unique_ptr<folly::IOBuf>
decrypt(
64 std::unique_ptr<folly::IOBuf>&& ciphertext,
67 auto plaintext = tryDecrypt(
68 std::forward<std::unique_ptr<folly::IOBuf>>(ciphertext),
72 throw std::runtime_error(
"decryption failed");
82 std::unique_ptr<folly::IOBuf>&& ciphertext,
90 virtual size_t getCipherOverhead()
const = 0;
constexpr detail::Map< Move > move
std::unique_ptr< folly::IOBuf > key
std::unique_ptr< folly::IOBuf > iv
virtual std::unique_ptr< folly::IOBuf > decrypt(std::unique_ptr< folly::IOBuf > &&ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum) const