diff options
author | Jack Lloyd <[email protected]> | 2016-09-15 21:08:51 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-09-15 21:08:51 -0400 |
commit | 45a8210d63c2fc0b0ab0411dba55c903da226123 (patch) | |
tree | 9bc380f1134738f624700645f8a9692c363dc7bc /src/lib/block | |
parent | 04bf8dc51861bab37d6260de8b318dc71ea4bba7 (diff) |
Change T::provider to return std::string
Diffstat (limited to 'src/lib/block')
-rw-r--r-- | src/lib/block/aes/aes.cpp | 6 | ||||
-rw-r--r-- | src/lib/block/aes/aes.h | 6 | ||||
-rw-r--r-- | src/lib/block/block_cipher.h | 3 | ||||
-rw-r--r-- | src/lib/block/idea/idea.cpp | 2 | ||||
-rw-r--r-- | src/lib/block/idea/idea.h | 2 | ||||
-rw-r--r-- | src/lib/block/noekeon/noekeon.cpp | 2 | ||||
-rw-r--r-- | src/lib/block/noekeon/noekeon.h | 2 | ||||
-rw-r--r-- | src/lib/block/serpent/serpent.cpp | 2 | ||||
-rw-r--r-- | src/lib/block/serpent/serpent.h | 2 | ||||
-rw-r--r-- | src/lib/block/threefish/threefish.cpp | 2 | ||||
-rw-r--r-- | src/lib/block/threefish/threefish.h | 2 |
11 files changed, 15 insertions, 16 deletions
diff --git a/src/lib/block/aes/aes.cpp b/src/lib/block/aes/aes.cpp index 9483dc0eb..39f5bd0db 100644 --- a/src/lib/block/aes/aes.cpp +++ b/src/lib/block/aes/aes.cpp @@ -437,9 +437,9 @@ const char* aes_provider() } -const char* AES_128::provider() const { return aes_provider(); } -const char* AES_192::provider() const { return aes_provider(); } -const char* AES_256::provider() const { return aes_provider(); } +std::string AES_128::provider() const { return aes_provider(); } +std::string AES_192::provider() const { return aes_provider(); } +std::string AES_256::provider() const { return aes_provider(); } void AES_128::encrypt_n(const byte in[], byte out[], size_t blocks) const { diff --git a/src/lib/block/aes/aes.h b/src/lib/block/aes/aes.h index e22e96e00..6bd38cada 100644 --- a/src/lib/block/aes/aes.h +++ b/src/lib/block/aes/aes.h @@ -23,7 +23,7 @@ class BOTAN_DLL AES_128 final : public Block_Cipher_Fixed_Params<16, 16> void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "AES-128"; } BlockCipher* clone() const override { return new AES_128; } private: @@ -56,7 +56,7 @@ class BOTAN_DLL AES_192 final : public Block_Cipher_Fixed_Params<16, 24> void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "AES-192"; } BlockCipher* clone() const override { return new AES_192; } private: @@ -89,7 +89,7 @@ class BOTAN_DLL AES_256 final : public Block_Cipher_Fixed_Params<16, 32> void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "AES-256"; } BlockCipher* clone() const override { return new AES_256; } diff --git a/src/lib/block/block_cipher.h b/src/lib/block/block_cipher.h index 68fc0f487..b16468958 100644 --- a/src/lib/block/block_cipher.h +++ b/src/lib/block/block_cipher.h @@ -56,9 +56,8 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * @return provider information about this implementation. Default is "base", * might also return "sse2", "avx2", "openssl", or some other arbitrary string. - * The return value is guaranteed to point to a string literal constant. */ - virtual const char* provider() const { return "base"; } + virtual std::string provider() const { return "base"; } /** * Encrypt a block. diff --git a/src/lib/block/idea/idea.cpp b/src/lib/block/idea/idea.cpp index 8616b7765..85cc5e757 100644 --- a/src/lib/block/idea/idea.cpp +++ b/src/lib/block/idea/idea.cpp @@ -109,7 +109,7 @@ void idea_op(const byte in[], byte out[], size_t blocks, const u16bit K[52]) } -const char* IDEA::provider() const +std::string IDEA::provider() const { #if defined(BOTAN_HAS_IDEA_SSE2) if(CPUID::has_sse2()) diff --git a/src/lib/block/idea/idea.h b/src/lib/block/idea/idea.h index 4a72685c8..eb391a0c8 100644 --- a/src/lib/block/idea/idea.h +++ b/src/lib/block/idea/idea.h @@ -23,7 +23,7 @@ class BOTAN_DLL IDEA final : public Block_Cipher_Fixed_Params<8, 16> void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "IDEA"; } BlockCipher* clone() const override { return new IDEA; } private: diff --git a/src/lib/block/noekeon/noekeon.cpp b/src/lib/block/noekeon/noekeon.cpp index fbafe092e..eac0979a4 100644 --- a/src/lib/block/noekeon/noekeon.cpp +++ b/src/lib/block/noekeon/noekeon.cpp @@ -73,7 +73,7 @@ inline void gamma(u32bit& A0, u32bit& A1, u32bit& A2, u32bit& A3) } -const char* Noekeon::provider() const +std::string Noekeon::provider() const { #if defined(BOTAN_HAS_NOEKEON_SIMD) if(CPUID::has_simd_32()) diff --git a/src/lib/block/noekeon/noekeon.h b/src/lib/block/noekeon/noekeon.h index 31069eb75..b0aa4218c 100644 --- a/src/lib/block/noekeon/noekeon.h +++ b/src/lib/block/noekeon/noekeon.h @@ -21,7 +21,7 @@ class BOTAN_DLL Noekeon final : public Block_Cipher_Fixed_Params<16, 16> void encrypt_n(const byte in[], byte out[], size_t blocks) const override; void decrypt_n(const byte in[], byte out[], size_t blocks) const override; - const char* provider() const override; + std::string provider() const override; void clear() override; std::string name() const override { return "Noekeon"; } BlockCipher* clone() const override { return new Noekeon; } diff --git a/src/lib/block/serpent/serpent.cpp b/src/lib/block/serpent/serpent.cpp index f2a6035f1..07088211d 100644 --- a/src/lib/block/serpent/serpent.cpp +++ b/src/lib/block/serpent/serpent.cpp @@ -231,7 +231,7 @@ void Serpent::clear() zap(m_round_key); } -const char* Serpent::provider() const +std::string Serpent::provider() const { #if defined(BOTAN_HAS_SERPENT_SIMD) if(CPUID::has_simd_32()) diff --git a/src/lib/block/serpent/serpent.h b/src/lib/block/serpent/serpent.h index 72c26d452..218772e0c 100644 --- a/src/lib/block/serpent/serpent.h +++ b/src/lib/block/serpent/serpent.h @@ -23,7 +23,7 @@ class BOTAN_DLL Serpent final : public Block_Cipher_Fixed_Params<16, 16, 32, 8> void decrypt_n(const byte in[], byte out[], size_t blocks) const override; void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "Serpent"; } BlockCipher* clone() const override { return new Serpent; } diff --git a/src/lib/block/threefish/threefish.cpp b/src/lib/block/threefish/threefish.cpp index 4ba834c94..f592021fb 100644 --- a/src/lib/block/threefish/threefish.cpp +++ b/src/lib/block/threefish/threefish.cpp @@ -98,7 +98,7 @@ void Threefish_512::skein_feedfwd(const secure_vector<u64bit>& M, m_K[4] ^ m_K[5] ^ m_K[6] ^ m_K[7] ^ 0x1BD11BDAA9FC1A22; } -const char* Threefish_512::provider() const +std::string Threefish_512::provider() const { #if defined(BOTAN_HAS_THREEFISH_512_AVX2) if(CPUID::has_avx2()) diff --git a/src/lib/block/threefish/threefish.h b/src/lib/block/threefish/threefish.h index 230c742f3..b02239c93 100644 --- a/src/lib/block/threefish/threefish.h +++ b/src/lib/block/threefish/threefish.h @@ -24,7 +24,7 @@ class BOTAN_DLL Threefish_512 final : public Block_Cipher_Fixed_Params<64, 64> void set_tweak(const byte tweak[], size_t len); void clear() override; - const char* provider() const override; + std::string provider() const override; std::string name() const override { return "Threefish-512"; } BlockCipher* clone() const override { return new Threefish_512; } protected: |