aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore/SHA3.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-05 18:30:28 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-06 21:53:40 +0800
commitaefb6e5fcf9adc7c58da9ec0454707305f7e9ac9 (patch)
tree30d17c29abf022cfcde24d13ebbd9285aadeb62b /libdevcore/SHA3.h
parentd5cfb17b32147e950a689a507e0d5487dece7e8a (diff)
downloaddexon-solidity-aefb6e5fcf9adc7c58da9ec0454707305f7e9ac9.tar.gz
dexon-solidity-aefb6e5fcf9adc7c58da9ec0454707305f7e9ac9.tar.zst
dexon-solidity-aefb6e5fcf9adc7c58da9ec0454707305f7e9ac9.zip
Rename dev::sha3 to dev::keccak256
Diffstat (limited to 'libdevcore/SHA3.h')
-rw-r--r--libdevcore/SHA3.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/libdevcore/SHA3.h b/libdevcore/SHA3.h
index 5393952f..b2a84c74 100644
--- a/libdevcore/SHA3.h
+++ b/libdevcore/SHA3.h
@@ -34,26 +34,26 @@ namespace dev
/// Calculate SHA3-256 hash of the given input and load it into the given output.
/// @returns false if o_output.size() != 32.
-bool sha3(bytesConstRef _input, bytesRef o_output);
+bool keccak256(bytesConstRef _input, bytesRef o_output);
/// Calculate SHA3-256 hash of the given input, returning as a 256-bit hash.
-inline h256 sha3(bytesConstRef _input) { h256 ret; sha3(_input, ret.ref()); return ret; }
+inline h256 keccak256(bytesConstRef _input) { h256 ret; keccak256(_input, ret.ref()); return ret; }
/// Calculate SHA3-256 hash of the given input, returning as a 256-bit hash.
-inline h256 sha3(bytes const& _input) { return sha3(bytesConstRef(&_input)); }
+inline h256 keccak256(bytes const& _input) { return keccak256(bytesConstRef(&_input)); }
/// Calculate SHA3-256 hash of the given input (presented as a binary-filled string), returning as a 256-bit hash.
-inline h256 sha3(std::string const& _input) { return sha3(bytesConstRef(_input)); }
+inline h256 keccak256(std::string const& _input) { return keccak256(bytesConstRef(_input)); }
/// Calculate SHA3-256 hash of the given input (presented as a FixedHash), returns a 256-bit hash.
-template<unsigned N> inline h256 sha3(FixedHash<N> const& _input) { return sha3(_input.ref()); }
+template<unsigned N> inline h256 keccak256(FixedHash<N> const& _input) { return keccak256(_input.ref()); }
/// Calculate SHA3-256 hash of the given input, possibly interpreting it as nibbles, and return the hash as a string filled with binary data.
-inline std::string sha3(std::string const& _input, bool _isNibbles) { return asString((_isNibbles ? sha3(fromHex(_input)) : sha3(bytesConstRef(&_input))).asBytes()); }
+inline std::string keccak256(std::string const& _input, bool _isNibbles) { return asString((_isNibbles ? keccak256(fromHex(_input)) : keccak256(bytesConstRef(&_input))).asBytes()); }
/// Calculate SHA3-256 MAC
-inline void sha3mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) { sha3(_secret.toBytes() + _plain.toBytes()).ref().populate(_output); }
+inline void keccak256mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) { keccak256(_secret.toBytes() + _plain.toBytes()).ref().populate(_output); }
-extern unsigned g_sha3Counter;
+extern unsigned g_keccak256Counter;
}