From 151c93560c68129282c7bc35ed9581e8472071a6 Mon Sep 17 00:00:00 2001 From: hashlag Date: Sat, 7 Feb 2026 18:02:27 +0300 Subject: [PATCH] Expose DES key size through DesCrypt, DesCrypt::Encryptor, DesCrypt::Decryptor. --- Chaos/Cipher/Block/Des/DesCrypt.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Chaos/Cipher/Block/Des/DesCrypt.hpp b/Chaos/Cipher/Block/Des/DesCrypt.hpp index 8459b19..6bfb167 100644 --- a/Chaos/Cipher/Block/Des/DesCrypt.hpp +++ b/Chaos/Cipher/Block/Des/DesCrypt.hpp @@ -198,8 +198,10 @@ class DesCrypt public: using Block = uint64_t; static constexpr size_t BlockSize = 8; + static constexpr size_t KeySize = 8; static_assert(BlockSize == sizeof(Block)); + static_assert(KeySize == Inner_::RawKey::Size()); DesCrypt() = delete; @@ -232,6 +234,7 @@ public: { public: static constexpr size_t BlockSize = DesCrypt::BlockSize; + static constexpr size_t KeySize = DesCrypt::KeySize; DesEncryptor(const Key & key) : Schedule_(Inner_::KeySchedule::Direction::Encrypt, key.Key_) @@ -275,6 +278,7 @@ public: { public: static constexpr size_t BlockSize = DesCrypt::BlockSize; + static constexpr size_t KeySize = DesCrypt::KeySize; DesDecryptor(const Key & key) : Schedule_(Inner_::KeySchedule::Direction::Decrypt, key.Key_)