proxygen
|
#include <Mocks.h>
Public Member Functions | |
MOCK_CONST_METHOD0 (keyLength, size_t()) | |
MOCK_CONST_METHOD0 (ivLength, size_t()) | |
MOCK_CONST_METHOD0 (getCipherOverhead, size_t()) | |
MOCK_METHOD1 (setEncryptedBufferHeadroom, void(size_t)) | |
MOCK_METHOD1 (_setKey, void(TrafficKey &key)) | |
void | setKey (TrafficKey key) override |
MOCK_CONST_METHOD3 (_encrypt, std::unique_ptr< folly::IOBuf >(std::unique_ptr< folly::IOBuf > &plaintext, const folly::IOBuf *associatedData, uint64_t seqNum)) | |
std::unique_ptr< folly::IOBuf > | encrypt (std::unique_ptr< folly::IOBuf > &&plaintext, const folly::IOBuf *associatedData, uint64_t seqNum) const override |
MOCK_CONST_METHOD3 (_decrypt, std::unique_ptr< folly::IOBuf >(std::unique_ptr< folly::IOBuf > &ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum)) | |
std::unique_ptr< folly::IOBuf > | decrypt (std::unique_ptr< folly::IOBuf > &&ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum) const override |
MOCK_CONST_METHOD3 (_tryDecrypt, folly::Optional< std::unique_ptr< folly::IOBuf >>(std::unique_ptr< folly::IOBuf > &ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum)) | |
folly::Optional< std::unique_ptr< folly::IOBuf > > | tryDecrypt (std::unique_ptr< folly::IOBuf > &&ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum) const override |
void | setDefaults () |
Public Member Functions inherited from fizz::Aead | |
virtual | ~Aead ()=default |
virtual size_t | keyLength () const =0 |
virtual size_t | ivLength () const =0 |
virtual void | setEncryptedBufferHeadroom (size_t headroom)=0 |
virtual size_t | getCipherOverhead () const =0 |
|
inlineoverridevirtual |
Decrypt ciphertext. Will throw if the ciphertext does not decrypt successfully.
Reimplemented from fizz::Aead.
Definition at line 51 of file Mocks.h.
References MOCK_CONST_METHOD3, and uint64_t.
|
inlineoverridevirtual |
Encrypts plaintext. Will throw on error.
Implements fizz::Aead.
Definition at line 38 of file Mocks.h.
References MOCK_CONST_METHOD3, and uint64_t.
fizz::test::MockAead::MOCK_CONST_METHOD0 | ( | keyLength | , |
size_t() | |||
) |
fizz::test::MockAead::MOCK_CONST_METHOD0 | ( | ivLength | , |
size_t() | |||
) |
fizz::test::MockAead::MOCK_CONST_METHOD0 | ( | getCipherOverhead | , |
size_t() | |||
) |
fizz::test::MockAead::MOCK_CONST_METHOD3 | ( | _encrypt | , |
std::unique_ptr< folly::IOBuf > | std::unique_ptr< folly::IOBuf > &plaintext, const folly::IOBuf *associatedData, uint64_t seqNum | ||
) |
fizz::test::MockAead::MOCK_CONST_METHOD3 | ( | _decrypt | , |
std::unique_ptr< folly::IOBuf > | std::unique_ptr< folly::IOBuf > &ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum | ||
) |
fizz::test::MockAead::MOCK_CONST_METHOD3 | ( | _tryDecrypt | , |
folly::Optional< std::unique_ptr< folly::IOBuf >> | std::unique_ptr< folly::IOBuf > &ciphertext, const folly::IOBuf *associatedData, uint64_t seqNum | ||
) |
fizz::test::MockAead::MOCK_METHOD1 | ( | setEncryptedBufferHeadroom | , |
void(size_t) | |||
) |
fizz::test::MockAead::MOCK_METHOD1 | ( | _setKey | , |
void(TrafficKey &key) | |||
) |
|
inline |
Definition at line 71 of file Mocks.h.
References testing::_, folly::IOBuf::copyBuffer(), testing::InvokeWithoutArgs(), and ON_CALL.
|
inlineoverridevirtual |
Sets the key and iv for this aead. The length of the key and iv must match keyLength() and ivLength().
Implements fizz::Aead.
Definition at line 28 of file Mocks.h.
References MOCK_CONST_METHOD3, and uint64_t.
|
inlineoverridevirtual |
Decrypt ciphertext. Will return none if the ciphertext does not decrypt successfully. May still throw from errors unrelated to ciphertext.
Implements fizz::Aead.