From e735faf7558aff457432a14bdfde893b33d4d311 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 28 Jun 2021 22:12:01 +0100 Subject: Protocol: call the encryptor once before sending data --- src/mbedTLS++/AesCfb128Encryptor.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/mbedTLS++/AesCfb128Encryptor.h') diff --git a/src/mbedTLS++/AesCfb128Encryptor.h b/src/mbedTLS++/AesCfb128Encryptor.h index f25998c15..ce3e1fd56 100644 --- a/src/mbedTLS++/AesCfb128Encryptor.h +++ b/src/mbedTLS++/AesCfb128Encryptor.h @@ -26,13 +26,14 @@ public: /** Initializes the decryptor with the specified Key / IV */ void Init(const Byte a_Key[16], const Byte a_IV[16]); - /** Encrypts a_Length bytes of the plain data; produces a_Length output bytes */ - void ProcessData(std::byte * a_EncryptedOut, const std::byte * a_PlainIn, size_t a_Length); + /** Encrypts a_Length bytes of the plain data in-place; produces a_Length output bytes */ + void ProcessData(std::byte * a_PlainIn, size_t a_Length); /** Returns true if the object has been initialized with the Key / IV */ bool IsValid(void) const { return m_IsValid; } protected: + mbedtls_aes_context m_Aes; /** The InitialVector, used by the CFB mode encryption */ @@ -41,8 +42,3 @@ protected: /** Indicates whether the object has been initialized with the Key / IV */ bool m_IsValid; } ; - - - - - -- cgit v1.2.3