proxygen
|
#include <Aead.h>
Public Member Functions | |
virtual | ~Aead ()=default |
virtual size_t | keyLength () const =0 |
virtual size_t | ivLength () const =0 |
virtual void | setKey (TrafficKey key)=0 |
virtual std::unique_ptr< folly::IOBuf > | encrypt (std::unique_ptr< folly::IOBuf > &&plaintext, const folly::IOBuf *associatedData, uint64_t seqNum) const =0 |
virtual void | setEncryptedBufferHeadroom (size_t headroom)=0 |
virtual std::unique_ptr< folly::IOBuf > | decrypt (std::unique_ptr< folly::IOBuf > &&ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum) const |
virtual folly::Optional< std::unique_ptr< folly::IOBuf > > | tryDecrypt (std::unique_ptr< folly::IOBuf > &&ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum) const =0 |
virtual size_t | getCipherOverhead () const =0 |
|
virtualdefault |
|
inlinevirtual |
Decrypt ciphertext. Will throw if the ciphertext does not decrypt successfully.
Reimplemented in fizz::test::MockAead.
Definition at line 63 of file Aead.h.
References folly::gen::move, and uint64_t.
|
pure virtual |
Encrypts plaintext. Will throw on error.
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >, and fizz::test::MockAead.
|
pure virtual |
Returns the number of bytes the aead will add to the plaintext (size of ciphertext - size of plaintext).
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >.
|
pure virtual |
Returns the number of iv bytes needed by this aead.
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >.
|
pure virtual |
Returns the number of key bytes needed by this aead.
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >.
|
pure virtual |
Set a hint to the AEAD about how much space to try to leave as headroom for ciphertexts returned from encrypt. Implementations may or may not honor this.
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >.
|
pure virtual |
Sets the key and iv for this aead. The length of the key and iv must match keyLength() and ivLength().
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >, and fizz::test::MockAead.
Referenced by encryptGCM().
|
pure virtual |
Decrypt ciphertext. Will return none if the ciphertext does not decrypt successfully. May still throw from errors unrelated to ciphertext.
Implemented in fizz::OpenSSLEVPCipher< EVPImpl >, and fizz::test::MockAead.