diff options
author | chriseth <chris@ethereum.org> | 2017-08-25 20:18:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-25 20:18:50 +0800 |
commit | d787aff6572bbc92778fb75fbeba0ce67dd408c9 (patch) | |
tree | c0a6fdec3b16f83e63ca02fb128a8dc5755e7acb /libdevcore | |
parent | 38035f8e32b39d1215ad30fbff400c10f44b3487 (diff) | |
parent | 157b5f1ae9dfdec8e82c9d1febb12d5d60dbc465 (diff) | |
download | dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar.gz dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar.bz2 dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar.lz dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar.xz dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.tar.zst dexon-solidity-d787aff6572bbc92778fb75fbeba0ce67dd408c9.zip |
Merge pull request #2810 from ethereum/cleanupSHA3
Cleanup of SHA3.h
Diffstat (limited to 'libdevcore')
-rw-r--r-- | libdevcore/SHA3.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libdevcore/SHA3.h b/libdevcore/SHA3.h index 1a561066..d1e2cc98 100644 --- a/libdevcore/SHA3.h +++ b/libdevcore/SHA3.h @@ -23,8 +23,9 @@ #pragma once +#include <libdevcore/FixedHash.h> + #include <string> -#include "FixedHash.h" namespace dev { @@ -47,10 +48,4 @@ inline h256 keccak256(std::string const& _input) { return keccak256(bytesConstRe /// 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 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 Keccak-256 MAC -inline void keccak256mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) { keccak256(_secret.toBytes() + _plain.toBytes()).ref().populate(_output); } - } |