Rename concept Encryptor --> BlockEncryptor.
This commit is contained in:
1 parent
d918e998d1
commit
894f41fa57
4 files changed
+14
-14
No files matched your search
@@ -0,0 +1,34 @@
|
||||
#ifndef CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP
|
||||
#define CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP
|
||||
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Chaos::Cipher::Block
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
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;
|
||||
requires std::constructible_from<T, typename T::Key>;
|
||||
|
||||
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>;
|
||||
|
||||
constEncryptor.EncryptBlock(outBegin, outEnd, inBegin, inEnd);
|
||||
{ constEncryptor.EncryptBlock(block) } -> std::same_as<typename T::Block>;
|
||||
{ constEncryptor.GetBlockSize() } -> std::unsigned_integral;
|
||||
};
|
||||
|
||||
} // namespace Chaos::Cipher::Block
|
||||
|
||||
#endif // CHAOS_CIPHER_BLOCK_BLOCKENCRYPTOR_HPP
|
||||
Reference in new issue
Block a user