From 8b9b67aa0ccdcf893171b317c986297e799923d6 Mon Sep 17 00:00:00 2001 From: hashlag Date: Fri, 31 Jul 2026 02:07:51 +0300 Subject: [PATCH] Merge branch 'dm-reorder' Reorder data members of some entities to mitigate performance issues on ARM. --- Chaos/Cipher/Arc4/Arc4Crypt.hpp | 2 +- Chaos/Cipher/Arc4/Arc4Gen.hpp | 6 +++--- Chaos/Cipher/Block/Mode/Ecb.hpp | 12 ++++++------ Chaos/Mac/Hmac.hpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Chaos/Cipher/Arc4/Arc4Crypt.hpp b/Chaos/Cipher/Arc4/Arc4Crypt.hpp index f7da4ab..7d09c96 100644 --- a/Chaos/Cipher/Arc4/Arc4Crypt.hpp +++ b/Chaos/Cipher/Arc4/Arc4Crypt.hpp @@ -45,8 +45,8 @@ public: } private: - bool IsInitialized_; Arc4Gen Gen_; + bool IsInitialized_; void EnsureInitialized() const { diff --git a/Chaos/Cipher/Arc4/Arc4Gen.hpp b/Chaos/Cipher/Arc4/Arc4Gen.hpp index f3f54f8..be1eb91 100644 --- a/Chaos/Cipher/Arc4/Arc4Gen.hpp +++ b/Chaos/Cipher/Arc4/Arc4Gen.hpp @@ -49,11 +49,11 @@ public: } private: - bool IsInitialized_; - + std::array Lookup_; uint8_t I_; uint8_t J_; - std::array Lookup_; + + bool IsInitialized_; void EnsureInitialized() const { diff --git a/Chaos/Cipher/Block/Mode/Ecb.hpp b/Chaos/Cipher/Block/Mode/Ecb.hpp index 9d52147..2c5e700 100644 --- a/Chaos/Cipher/Block/Mode/Ecb.hpp +++ b/Chaos/Cipher/Block/Mode/Ecb.hpp @@ -54,11 +54,11 @@ public: private: typename CipherT::Encryptor Encryptor_; - uint64_t BlockBytesPacked_; - Service::SeArray Block_; - Service::SeArray EncryptedBlock_; + Service::SeArray Block_; + uint64_t BlockBytesPacked_; + template static OutputIt EnsureCopy(OutputIt outBegin, OutputIt outEnd, InputIt inBegin, InputIt inEnd) @@ -169,12 +169,12 @@ public: typename CipherT::Decryptor Decryptor_; - uint64_t BlockBytesPacked_; BlockArray Block_; - - bool LastBlockSaved_; BlockArray LastBlock_; + uint64_t BlockBytesPacked_; + bool LastBlockSaved_; + template static OutputIt EnsureCopy(OutputIt outBegin, OutputIt outEnd, InputIt inBegin, InputIt inEnd) diff --git a/Chaos/Mac/Hmac.hpp b/Chaos/Mac/Hmac.hpp index b1b9c54..125bb3a 100644 --- a/Chaos/Mac/Hmac.hpp +++ b/Chaos/Mac/Hmac.hpp @@ -60,10 +60,10 @@ private: static constexpr uint8_t OPAD_BYTE = 0x5c; static constexpr uint8_t IPAD_BYTE = 0x36; - bool IsInitialized_; - - KeyType Key_; HasherImpl Hasher_; + KeyType Key_; + + bool IsInitialized_; void EnsureInitialized() const {