Introduce concept Key.

This commit is contained in:
hashlag committed 2026-09-13 01:14:41 +03:00
1 parent cb03a5db25
commit c9e90e4d0d
2 files changed
+21

No files matched your search

+3
View File
@@ -10,6 +10,7 @@
#include "Service/ChaosException.hpp" #include "Service/ChaosException.hpp"
#include "Service/SeArray.hpp" #include "Service/SeArray.hpp"
#include "Cipher/Block/Key.hpp"
#include "Cipher/Block/Encryptor.hpp" #include "Cipher/Block/Encryptor.hpp"
#include "Cipher/Block/Decryptor.hpp" #include "Cipher/Block/Decryptor.hpp"
@@ -233,6 +234,8 @@ public:
Inner_::RawKey Key_; Inner_::RawKey Key_;
}; };
static_assert(Chaos::Cipher::Block::Key<Key>);
class Encryptor class Encryptor
{ {
public: public:
+18
View File
@@ -0,0 +1,18 @@
#ifndef CHAOS_CIPHER_BLOCK_KEY_HPP
#define CHAOS_CIPHER_BLOCK_KEY_HPP
#include <concepts>
#include <cstdint>
namespace Chaos::Cipher::Block
{
template<typename T>
concept Key = requires
{
requires std::constructible_from<T, uint8_t *, uint8_t *>;
};
} // namespace Chaos::Cipher::Block
#endif // CHAOS_CIPHER_BLOCK_KEY_HPP