From eed5bb2649155f974c6dde827181ba90cccde2b3 Mon Sep 17 00:00:00 2001 From: hashlag Date: Sun, 20 Sep 2026 22:44:10 +0300 Subject: [PATCH] Remove redundant IsInitialized_ state from Arc4Crypt. --- Chaos/Cipher/Stream/Arc4/Arc4Crypt.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Chaos/Cipher/Stream/Arc4/Arc4Crypt.hpp b/Chaos/Cipher/Stream/Arc4/Arc4Crypt.hpp index b35111c..2194ede 100644 --- a/Chaos/Cipher/Stream/Arc4/Arc4Crypt.hpp +++ b/Chaos/Cipher/Stream/Arc4/Arc4Crypt.hpp @@ -15,7 +15,6 @@ class Arc4Crypt { public: Arc4Crypt() - : IsInitialized_(false) { } template @@ -46,11 +45,10 @@ public: private: Arc4Gen Gen_; - bool IsInitialized_; void EnsureInitialized() const { - if (!IsInitialized_) + if (!Gen_.IsInitialized()) { throw Service::ChaosException("Arc4Crypt: not initialized"); } @@ -59,9 +57,7 @@ private: template void RekeyImpl(InputIt keyBegin, InputIt keyEnd) { - IsInitialized_ = false; Gen_.Rekey(keyBegin, keyEnd); - IsInitialized_ = true; } template