From f1746b705abb0c9483d469846d106c1463213451 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Mon, 10 Jun 2019 23:24:09 +0200 Subject: [PATCH] Make data_size static in hash classes --- include/fc/crypto/ripemd160.hpp | 2 +- include/fc/crypto/sha1.hpp | 2 +- include/fc/crypto/sha224.hpp | 2 +- include/fc/crypto/sha256.hpp | 2 +- include/fc/crypto/sha512.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/fc/crypto/ripemd160.hpp b/include/fc/crypto/ripemd160.hpp index faea983..ac48d16 100644 --- a/include/fc/crypto/ripemd160.hpp +++ b/include/fc/crypto/ripemd160.hpp @@ -18,7 +18,7 @@ class ripemd160 explicit operator string()const; char* data()const; - constexpr size_t data_size()const { return 160/8; } + static constexpr size_t data_size() { return 160/8; } static ripemd160 hash( const fc::sha512& h ); static ripemd160 hash( const fc::sha256& h ); diff --git a/include/fc/crypto/sha1.hpp b/include/fc/crypto/sha1.hpp index 68fe77d..0050146 100644 --- a/include/fc/crypto/sha1.hpp +++ b/include/fc/crypto/sha1.hpp @@ -17,7 +17,7 @@ class sha1 operator std::string()const; char* data()const; - constexpr size_t data_size()const { return 20; } + static constexpr size_t data_size() { return 20; } static sha1 hash( const char* d, uint32_t dlen ); static sha1 hash( const std::string& ); diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp index 923c623..c35c98f 100644 --- a/include/fc/crypto/sha224.hpp +++ b/include/fc/crypto/sha224.hpp @@ -16,7 +16,7 @@ class sha224 operator string()const; char* data()const; - constexpr size_t data_size()const { return 224 / 8; } + static constexpr size_t data_size() { return 224 / 8; } static sha224 hash( const char* d, uint32_t dlen ); static sha224 hash( const string& ); diff --git a/include/fc/crypto/sha256.hpp b/include/fc/crypto/sha256.hpp index dcc6159..840d38f 100644 --- a/include/fc/crypto/sha256.hpp +++ b/include/fc/crypto/sha256.hpp @@ -18,7 +18,7 @@ class sha256 operator string()const; char* data()const; - constexpr size_t data_size()const { return 256 / 8; } + static constexpr size_t data_size() { return 256 / 8; } static sha256 hash( const char* d, uint32_t dlen ); static sha256 hash( const string& ); diff --git a/include/fc/crypto/sha512.hpp b/include/fc/crypto/sha512.hpp index 0eb5715..521c93b 100644 --- a/include/fc/crypto/sha512.hpp +++ b/include/fc/crypto/sha512.hpp @@ -16,7 +16,7 @@ class sha512 operator std::string()const; char* data()const; - constexpr size_t data_size()const { return 512 / 8; } + static constexpr size_t data_size() { return 512 / 8; } static sha512 hash( const char* d, uint32_t dlen ); static sha512 hash( const std::string& );