From 16385e93e093105286b19c02718274aaacd38b46 Mon Sep 17 00:00:00 2001 From: hashlag Date: Mon, 21 Sep 2026 00:17:48 +0300 Subject: [PATCH] Arc4Gen: store the lookup table in SeArray. --- Chaos/Cipher/Stream/Arc4/Arc4Gen.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Chaos/Cipher/Stream/Arc4/Arc4Gen.hpp b/Chaos/Cipher/Stream/Arc4/Arc4Gen.hpp index ffcb4bd..b2c6173 100644 --- a/Chaos/Cipher/Stream/Arc4/Arc4Gen.hpp +++ b/Chaos/Cipher/Stream/Arc4/Arc4Gen.hpp @@ -1,12 +1,12 @@ #ifndef CHAOS_CIPHER_STREAM_ARC4_ARC4GEN_HPP #define CHAOS_CIPHER_STREAM_ARC4_ARC4GEN_HPP -#include #include #include #include #include "Service/ChaosException.hpp" +#include "Service/SeArray.hpp" namespace Chaos::Cipher::Stream::Arc4 { @@ -54,7 +54,7 @@ public: } private: - std::array Lookup_; + Service::SeArray Lookup_; uint8_t I_; uint8_t J_; @@ -76,7 +76,7 @@ private: I_ = 0; J_ = 0; - for (uint64_t idx = 0; idx < Lookup_.size(); ++idx) + for (uint64_t idx = 0; idx < Lookup_.Size(); ++idx) { Lookup_[idx] = static_cast(idx); } @@ -91,7 +91,7 @@ private: uint8_t a = 0; uint8_t b = 0; - for (uint64_t idx = 0; idx < Lookup_.size(); ++idx) + for (uint64_t idx = 0; idx < Lookup_.Size(); ++idx) { a = static_cast(idx); b = b + Lookup_[a] + key[a % key.size()];