diff options
author | ethers <ethereum@outlook.com> | 2017-05-09 12:30:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 12:30:16 +0800 |
commit | cd1d1128160e64289b02f80d677d89905981d0e2 (patch) | |
tree | 89bff0c2f399e4b895c3da8b4aaaa628a2a1bca6 | |
parent | 9e8e6dd57b03a24dbe4bd2173c4a45ff2b0286cc (diff) | |
download | dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar.gz dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar.bz2 dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar.lz dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar.xz dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.tar.zst dexon-solidity-cd1d1128160e64289b02f80d677d89905981d0e2.zip |
Comment update SHA3-256 to Keccak-256
Could have been part of https://github.com/ethereum/solidity/commit/aefb6e5fcf9adc7c58da9ec0454707305f7e9ac9
-rw-r--r-- | libdevcore/SHA3.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libdevcore/SHA3.h b/libdevcore/SHA3.h index ce075521..73cb92ae 100644 --- a/libdevcore/SHA3.h +++ b/libdevcore/SHA3.h @@ -31,26 +31,26 @@ namespace dev // SHA-3 convenience routines. -/// Calculate SHA3-256 hash of the given input and load it into the given output. +/// Calculate Keccak-256 hash of the given input and load it into the given output. /// @returns false if o_output.size() != 32. bool keccak256(bytesConstRef _input, bytesRef o_output); -/// Calculate SHA3-256 hash of the given input, returning as a 256-bit hash. +/// Calculate Keccak-256 hash of the given input, returning as a 256-bit hash. 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. +/// Calculate Keccak-256 hash of the given input, returning as a 256-bit hash. 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. +/// Calculate Keccak-256 hash of the given input (presented as a binary-filled string), returning as a 256-bit hash. 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. +/// Calculate Keccak-256 hash of the given input (presented as a FixedHash), returns a 256-bit hash. 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. +/// Calculate Keccak-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 keccak256(std::string const& _input, bool _isNibbles) { return asString((_isNibbles ? keccak256(fromHex(_input)) : keccak256(bytesConstRef(&_input))).asBytes()); } -/// Calculate SHA3-256 MAC +/// Calculate Keccak-256 MAC inline void keccak256mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) { keccak256(_secret.toBytes() + _plain.toBytes()).ref().populate(_output); } } |