Introduce concept Key.
This commit is contained in:
1 parent
cb03a5db25
commit
c9e90e4d0d
2 files changed
+21
No files matched your search
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in new issue
Block a user