From 894f41fa57af7030118bbcd1fd628be6cd2d25e2 Mon Sep 17 00:00:00 2001 From: hashlag Date: Sat, 19 Sep 2026 18:33:52 +0300 Subject: [PATCH] Rename concept Encryptor --> BlockEncryptor. --- Chaos/Cipher/Block/BlockCipher.hpp | 4 ++-- .../Block/{Encryptor.hpp => BlockEncryptor.hpp} | 14 +++++++------- Chaos/Cipher/Block/Des/DesCrypt.hpp | 4 ++-- ChaosTests/Cipher/Block/Des/DesCryptTests.cpp | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) rename Chaos/Cipher/Block/{Encryptor.hpp => BlockEncryptor.hpp} (66%) diff --git a/Chaos/Cipher/Block/BlockCipher.hpp b/Chaos/Cipher/Block/BlockCipher.hpp index 8ce4208..e5c391e 100644 --- a/Chaos/Cipher/Block/BlockCipher.hpp +++ b/Chaos/Cipher/Block/BlockCipher.hpp @@ -5,7 +5,7 @@ #include #include "BlockKey.hpp" -#include "Encryptor.hpp" +#include "BlockEncryptor.hpp" #include "BlockDecryptor.hpp" namespace Chaos::Cipher::Block @@ -26,7 +26,7 @@ concept BlockCipher = requires typename std::integral_constant; requires BlockKey; - requires Encryptor; + requires BlockEncryptor; requires BlockDecryptor; }; diff --git a/Chaos/Cipher/Block/Encryptor.hpp b/Chaos/Cipher/Block/BlockEncryptor.hpp similarity index 66% rename from Chaos/Cipher/Block/Encryptor.hpp rename to Chaos/Cipher/Block/BlockEncryptor.hpp index ddd3cf3..53843e6 100644 --- a/Chaos/Cipher/Block/Encryptor.hpp +++ b/Chaos/Cipher/Block/BlockEncryptor.hpp @@ -1,5 +1,5 @@ -#ifndef CHAOS_CIPHER_BLOCK_ENCRYPTOR_HPP -#define CHAOS_CIPHER_BLOCK_ENCRYPTOR_HPP +#ifndef CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP +#define CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP #include #include @@ -9,10 +9,10 @@ namespace Chaos::Cipher::Block { template -concept Encryptor = requires(const T constEncryptor, - typename T::Block block, - uint8_t * outBegin, uint8_t * outEnd, - uint8_t * inBegin, uint8_t * inEnd) +concept BlockEncryptor = requires(const T constEncryptor, + typename T::Block block, + uint8_t * outBegin, uint8_t * outEnd, + uint8_t * inBegin, uint8_t * inEnd) { typename T::Block; typename T::Key; @@ -31,4 +31,4 @@ concept Encryptor = requires(const T constEncryptor, } // namespace Chaos::Cipher::Block -#endif // CHAOS_CIPHER_BLOCK_ENCRYPTOR_HPP +#endif // CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP diff --git a/Chaos/Cipher/Block/Des/DesCrypt.hpp b/Chaos/Cipher/Block/Des/DesCrypt.hpp index 8e2dee4..addbff8 100644 --- a/Chaos/Cipher/Block/Des/DesCrypt.hpp +++ b/Chaos/Cipher/Block/Des/DesCrypt.hpp @@ -11,7 +11,7 @@ #include "Service/SeArray.hpp" #include "Cipher/Block/BlockKey.hpp" -#include "Cipher/Block/Encryptor.hpp" +#include "Cipher/Block/BlockEncryptor.hpp" #include "Cipher/Block/BlockDecryptor.hpp" #include "Cipher/Block/BlockCipher.hpp" @@ -283,7 +283,7 @@ public: Inner_::KeySchedule Schedule_; }; - static_assert(Chaos::Cipher::Block::Encryptor); + static_assert(Chaos::Cipher::Block::BlockEncryptor); class Decryptor { diff --git a/ChaosTests/Cipher/Block/Des/DesCryptTests.cpp b/ChaosTests/Cipher/Block/Des/DesCryptTests.cpp index 0cf9d0e..7e9252f 100644 --- a/ChaosTests/Cipher/Block/Des/DesCryptTests.cpp +++ b/ChaosTests/Cipher/Block/Des/DesCryptTests.cpp @@ -6,7 +6,7 @@ #include #include "Cipher/Block/Des/DesCrypt.hpp" -#include "Cipher/Block/Encryptor.hpp" +#include "Cipher/Block/BlockEncryptor.hpp" #include "Cipher/Block/BlockDecryptor.hpp" #include "Service/ChaosException.hpp" @@ -486,7 +486,7 @@ TEST(DesCryptTests, OutIteratorUsageDecryptTest) } } -template +template static std::vector EncryptGeneric(const EncryptorImpl & enc, InputIt begin, InputIt end) { @@ -510,7 +510,7 @@ TEST(DesCryptTests, EncryptGenericTest) ASSERT_EQ(expected, EncryptGeneric(enc, data.begin(), data.end())); } -template +template static uint64_t EncryptUInt64BlockGeneric(const EncryptorImpl & enc, uint64_t block) { return enc.EncryptBlock(block);