Rename concept Cipher --> BlockCipher.
Chaos Ci / test (push) Successful in 3m12s
Chaos Ci / benchmark (push) Successful in 1m26s

This commit is contained in:
hashlag committed 2026-09-19 01:45:37 +03:00
1 parent d0b8cbe2ef
commit 611ffa2222
3 files changed
+8 -8

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#ifndef CHAOS_CIPHER_BLOCK_BLOCKCIPHER_HPP
#define CHAOS_CIPHER_BLOCK_BLOCKCIPHER_HPP
#include <concepts>
#include <type_traits>
#include "Key.hpp"
#include "Encryptor.hpp"
#include "Decryptor.hpp"
namespace Chaos::Cipher::Block
{
template<typename T>
concept BlockCipher = requires
{
typename T::Block;
typename T::Key;
typename T::Encryptor;
typename T::Decryptor;
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::BlockSize)>>;
typename std::integral_constant<decltype(T::BlockSize), T::BlockSize>;
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::KeySize)>>;
typename std::integral_constant<decltype(T::KeySize), T::KeySize>;
requires Key<typename T::Key>;
requires Encryptor<typename T::Encryptor>;
requires Decryptor<typename T::Decryptor>;
};
} // namespace Chaos::Cipher::Block
#endif // CHAOS_CIPHER_BLOCK_BLOCKCIPHER_HPP