diff --git a/crypto/symmetric/CFB_Cipher.h b/crypto/symmetric/CFB_Cipher.h index f67a8c16..64056aac 100644 --- a/crypto/symmetric/CFB_Cipher.h +++ b/crypto/symmetric/CFB_Cipher.h @@ -14,8 +14,6 @@ namespace cpputils { template class CFB_Cipher { public: - BOOST_CONCEPT_ASSERT((CipherConcept>)); - using EncryptionKey = FixedSizeData; static EncryptionKey CreateKey(RandomGenerator &randomGenerator) { diff --git a/crypto/symmetric/Cipher.h b/crypto/symmetric/Cipher.h index d8e705d5..196dbd92 100644 --- a/crypto/symmetric/Cipher.h +++ b/crypto/symmetric/Cipher.h @@ -7,6 +7,8 @@ #include "../../data/Data.h" #include "../../random/Random.h" +using std::string; + namespace cpputils { template @@ -18,6 +20,7 @@ public: typename X::EncryptionKey key = X::CreateKey(Random::OSRandom()); same_type(Data(0), X::encrypt((uint8_t*)nullptr, UINT32_C(0), key)); same_type(boost::optional(Data(0)), X::decrypt((uint8_t*)nullptr, UINT32_C(0), key)); + string name = X::NAME; } private: diff --git a/crypto/symmetric/GCM_Cipher.h b/crypto/symmetric/GCM_Cipher.h index 2680518f..e2a7a117 100644 --- a/crypto/symmetric/GCM_Cipher.h +++ b/crypto/symmetric/GCM_Cipher.h @@ -13,8 +13,6 @@ namespace cpputils { template class GCM_Cipher { public: - BOOST_CONCEPT_ASSERT((CipherConcept>)); - using EncryptionKey = FixedSizeData; static EncryptionKey CreateKey(RandomGenerator &randomGenerator) { diff --git a/crypto/symmetric/ciphers.h b/crypto/symmetric/ciphers.h index f57bca84..4e263c5a 100644 --- a/crypto/symmetric/ciphers.h +++ b/crypto/symmetric/ciphers.h @@ -13,6 +13,7 @@ #define DEFINE_CIPHER(InstanceName, StringName, Mode, Base, Keysize) \ class InstanceName final: public Mode { \ public: \ + BOOST_CONCEPT_ASSERT((CipherConcept)); \ static constexpr const char *NAME = StringName; \ } \ diff --git a/test/crypto/symmetric/testutils/FakeAuthenticatedCipher.h b/test/crypto/symmetric/testutils/FakeAuthenticatedCipher.h index ff832c83..2c09b96f 100644 --- a/test/crypto/symmetric/testutils/FakeAuthenticatedCipher.h +++ b/test/crypto/symmetric/testutils/FakeAuthenticatedCipher.h @@ -85,6 +85,8 @@ namespace cpputils { return std::move(result); } + static constexpr const char *NAME = "FakeAuthenticatedCipher"; + private: static int32_t _parity(const byte *data, unsigned int size) { int32_t parity = 34343435; // some init value