diff --git a/include/fc/crypto/ripemd160.hpp b/include/fc/crypto/ripemd160.hpp index 389d677..58d8b18 100644 --- a/include/fc/crypto/ripemd160.hpp +++ b/include/fc/crypto/ripemd160.hpp @@ -1,5 +1,5 @@ #pragma once - +#include #include #include #include @@ -68,7 +68,7 @@ class ripemd160 friend bool operator > ( const ripemd160& h1, const ripemd160& h2 ); friend bool operator < ( const ripemd160& h1, const ripemd160& h2 ); - uint32_t _hash[5]; + boost::endian::little_uint32_buf_t _hash[5]; }; namespace raw { diff --git a/include/fc/crypto/sha1.hpp b/include/fc/crypto/sha1.hpp index 46b76e4..7209231 100644 --- a/include/fc/crypto/sha1.hpp +++ b/include/fc/crypto/sha1.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include @@ -64,7 +65,7 @@ class sha1 friend bool operator > ( const sha1& h1, const sha1& h2 ); friend bool operator < ( const sha1& h1, const sha1& h2 ); - uint32_t _hash[5]; + boost::endian::little_uint32_buf_t _hash[5]; }; class variant; diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp index 490e005..772e9f6 100644 --- a/include/fc/crypto/sha224.hpp +++ b/include/fc/crypto/sha224.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include #include #include @@ -65,7 +65,7 @@ class sha224 friend bool operator > ( const sha224& h1, const sha224& h2 ); friend bool operator < ( const sha224& h1, const sha224& h2 ); - uint32_t _hash[7]; + boost::endian::little_uint32_buf_t _hash[7]; }; namespace raw { diff --git a/include/fc/crypto/sha256.hpp b/include/fc/crypto/sha256.hpp index 353fc3a..a382ad0 100644 --- a/include/fc/crypto/sha256.hpp +++ b/include/fc/crypto/sha256.hpp @@ -1,6 +1,7 @@ #pragma once +#include #include -#include +#include #include namespace fc @@ -67,7 +68,7 @@ class sha256 friend bool operator > ( const sha256& h1, const sha256& h2 ); friend bool operator < ( const sha256& h1, const sha256& h2 ); - uint64_t _hash[4]; + boost::endian::little_uint64_buf_t _hash[4]; }; namespace raw { diff --git a/include/fc/crypto/sha512.hpp b/include/fc/crypto/sha512.hpp index 9751a56..10c9ea0 100644 --- a/include/fc/crypto/sha512.hpp +++ b/include/fc/crypto/sha512.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include namespace fc @@ -62,7 +63,7 @@ class sha512 friend bool operator > ( const sha512& h1, const sha512& h2 ); friend bool operator < ( const sha512& h1, const sha512& h2 ); - uint64_t _hash[8]; + boost::endian::little_uint64_buf_t _hash[8]; }; namespace raw { diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index b76de34..fe6c588 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -76,11 +76,11 @@ ripemd160 operator << ( const ripemd160& h1, uint32_t i ) { } ripemd160 operator ^ ( const ripemd160& h1, const ripemd160& h2 ) { ripemd160 result; - result._hash[0] = h1._hash[0] ^ h2._hash[0]; - result._hash[1] = h1._hash[1] ^ h2._hash[1]; - result._hash[2] = h1._hash[2] ^ h2._hash[2]; - result._hash[3] = h1._hash[3] ^ h2._hash[3]; - result._hash[4] = h1._hash[4] ^ h2._hash[4]; + result._hash[0] = h1._hash[0].value() ^ h2._hash[0].value(); + result._hash[1] = h1._hash[1].value() ^ h2._hash[1].value(); + result._hash[2] = h1._hash[2].value() ^ h2._hash[2].value(); + result._hash[3] = h1._hash[3].value() ^ h2._hash[3].value(); + result._hash[4] = h1._hash[4].value() ^ h2._hash[4].value(); return result; } bool operator >= ( const ripemd160& h1, const ripemd160& h2 ) { diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index 983edc4..d8337e5 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -60,11 +60,11 @@ sha1 operator << ( const sha1& h1, uint32_t i ) { } sha1 operator ^ ( const sha1& h1, const sha1& h2 ) { sha1 result; - result._hash[0] = h1._hash[0] ^ h2._hash[0]; - result._hash[1] = h1._hash[1] ^ h2._hash[1]; - result._hash[2] = h1._hash[2] ^ h2._hash[2]; - result._hash[3] = h1._hash[3] ^ h2._hash[3]; - result._hash[4] = h1._hash[4] ^ h2._hash[4]; + result._hash[0] = h1._hash[0].value() ^ h2._hash[0].value(); + result._hash[1] = h1._hash[1].value() ^ h2._hash[1].value(); + result._hash[2] = h1._hash[2].value() ^ h2._hash[2].value(); + result._hash[3] = h1._hash[3].value() ^ h2._hash[3].value(); + result._hash[4] = h1._hash[4].value() ^ h2._hash[4].value(); return result; } bool operator >= ( const sha1& h1, const sha1& h2 ) { diff --git a/src/crypto/sha224.cpp b/src/crypto/sha224.cpp index b1096b6..54be117 100644 --- a/src/crypto/sha224.cpp +++ b/src/crypto/sha224.cpp @@ -60,7 +60,7 @@ namespace fc { sha224 operator ^ ( const sha224& h1, const sha224& h2 ) { sha224 result; for( uint32_t i = 0; i < 7; ++i ) - result._hash[i] = h1._hash[i] ^ h2._hash[i]; + result._hash[i] = h1._hash[i].value() ^ h2._hash[i].value(); return result; } bool operator >= ( const sha224& h1, const sha224& h2 ) { diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index db0a18a..6d35035 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -77,10 +77,10 @@ namespace fc { } sha256 operator ^ ( const sha256& h1, const sha256& h2 ) { sha256 result; - result._hash[0] = h1._hash[0] ^ h2._hash[0]; - result._hash[1] = h1._hash[1] ^ h2._hash[1]; - result._hash[2] = h1._hash[2] ^ h2._hash[2]; - result._hash[3] = h1._hash[3] ^ h2._hash[3]; + result._hash[0] = h1._hash[0].value() ^ h2._hash[0].value(); + result._hash[1] = h1._hash[1].value() ^ h2._hash[1].value(); + result._hash[2] = h1._hash[2].value() ^ h2._hash[2].value(); + result._hash[3] = h1._hash[3].value() ^ h2._hash[3].value(); return result; } bool operator >= ( const sha256& h1, const sha256& h2 ) { diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp index 4b82efe..d499314 100644 --- a/src/crypto/sha512.cpp +++ b/src/crypto/sha512.cpp @@ -59,14 +59,14 @@ namespace fc { } sha512 operator ^ ( const sha512& h1, const sha512& h2 ) { sha512 result; - result._hash[0] = h1._hash[0] ^ h2._hash[0]; - result._hash[1] = h1._hash[1] ^ h2._hash[1]; - result._hash[2] = h1._hash[2] ^ h2._hash[2]; - result._hash[3] = h1._hash[3] ^ h2._hash[3]; - result._hash[4] = h1._hash[4] ^ h2._hash[4]; - result._hash[5] = h1._hash[5] ^ h2._hash[5]; - result._hash[6] = h1._hash[6] ^ h2._hash[6]; - result._hash[7] = h1._hash[7] ^ h2._hash[7]; + result._hash[0] = h1._hash[0].value() ^ h2._hash[0].value(); + result._hash[1] = h1._hash[1].value() ^ h2._hash[1].value(); + result._hash[2] = h1._hash[2].value() ^ h2._hash[2].value(); + result._hash[3] = h1._hash[3].value() ^ h2._hash[3].value(); + result._hash[4] = h1._hash[4].value() ^ h2._hash[4].value(); + result._hash[5] = h1._hash[5].value() ^ h2._hash[5].value(); + result._hash[6] = h1._hash[6].value() ^ h2._hash[6].value(); + result._hash[7] = h1._hash[7].value() ^ h2._hash[7].value(); return result; } bool operator >= ( const sha512& h1, const sha512& h2 ) {