diff --git a/Chaos/Cipher/Block/Des/DesCrypt.hpp b/Chaos/Cipher/Block/Des/DesCrypt.hpp index de6119f..1e50e76 100644 --- a/Chaos/Cipher/Block/Des/DesCrypt.hpp +++ b/Chaos/Cipher/Block/Des/DesCrypt.hpp @@ -10,6 +10,7 @@ #include "Service/ChaosException.hpp" #include "Service/SeArray.hpp" +#include "Cipher/Block/Key.hpp" #include "Cipher/Block/Encryptor.hpp" #include "Cipher/Block/Decryptor.hpp" @@ -233,6 +234,8 @@ public: Inner_::RawKey Key_; }; + static_assert(Chaos::Cipher::Block::Key); + class Encryptor { public: diff --git a/Chaos/Cipher/Block/Key.hpp b/Chaos/Cipher/Block/Key.hpp new file mode 100644 index 0000000..22a102e --- /dev/null +++ b/Chaos/Cipher/Block/Key.hpp @@ -0,0 +1,18 @@ +#ifndef CHAOS_CIPHER_BLOCK_KEY_HPP +#define CHAOS_CIPHER_BLOCK_KEY_HPP + +#include +#include + +namespace Chaos::Cipher::Block +{ + +template +concept Key = requires +{ + requires std::constructible_from; +}; + +} // namespace Chaos::Cipher::Block + +#endif // CHAOS_CIPHER_BLOCK_KEY_HPP