summaryrefslogtreecommitdiffstats
path: root/src/mbedTLS++
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-06-28 23:12:01 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-07-06 22:33:03 +0200
commite735faf7558aff457432a14bdfde893b33d4d311 (patch)
tree35c76c2849b160c4fa112de6fce7a793ed670b9c /src/mbedTLS++
parentRemove outdated comment and redundant check (diff)
downloadcuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar.gz
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar.bz2
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar.lz
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar.xz
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.tar.zst
cuberite-e735faf7558aff457432a14bdfde893b33d4d311.zip
Diffstat (limited to 'src/mbedTLS++')
-rw-r--r--src/mbedTLS++/AesCfb128Encryptor.cpp4
-rw-r--r--src/mbedTLS++/AesCfb128Encryptor.h10
2 files changed, 5 insertions, 9 deletions
diff --git a/src/mbedTLS++/AesCfb128Encryptor.cpp b/src/mbedTLS++/AesCfb128Encryptor.cpp
index 7c2ae8b2b..2a08ef28e 100644
--- a/src/mbedTLS++/AesCfb128Encryptor.cpp
+++ b/src/mbedTLS++/AesCfb128Encryptor.cpp
@@ -43,8 +43,8 @@ void cAesCfb128Encryptor::Init(const Byte a_Key[16], const Byte a_IV[16])
-void cAesCfb128Encryptor::ProcessData(std::byte * const a_EncryptedOut, const std::byte * const a_PlainIn, size_t a_Length)
+void cAesCfb128Encryptor::ProcessData(std::byte * const a_PlainIn, const size_t a_Length)
{
ASSERT(IsValid()); // Must Init() first
- mbedtls_aes_crypt_cfb8(&m_Aes, MBEDTLS_AES_ENCRYPT, a_Length, m_IV, reinterpret_cast<const unsigned char *>(a_PlainIn), reinterpret_cast<unsigned char *>(a_EncryptedOut));
+ mbedtls_aes_crypt_cfb8(&m_Aes, MBEDTLS_AES_ENCRYPT, a_Length, m_IV, reinterpret_cast<const unsigned char *>(a_PlainIn), reinterpret_cast<unsigned char *>(a_PlainIn));
}
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;
} ;
-
-
-
-
-