diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-20 15:41:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-20 15:41:44 +0800 |
commit | d6bc0a0631897f893c06dcc9382bf29f23db6b26 (patch) | |
tree | bd4fba85b391e7005d2c69e88b7a25b5ab37c700 /libdevcore/SHA3.cpp | |
parent | 137b214be471dd690aeadaf0e02b9ad0915d9e84 (diff) | |
parent | f958463416e88a769d0904ca3da48dac8a9c1c5a (diff) | |
download | dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar.gz dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar.bz2 dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar.lz dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar.xz dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.tar.zst dexon-solidity-d6bc0a0631897f893c06dcc9382bf29f23db6b26.zip |
Merge pull request #2929 from ethereum/cppcheck
Another set of improvements found by cppcheck
Diffstat (limited to 'libdevcore/SHA3.cpp')
-rw-r--r-- | libdevcore/SHA3.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libdevcore/SHA3.cpp b/libdevcore/SHA3.cpp index 4d82ec85..b0e40ccb 100644 --- a/libdevcore/SHA3.cpp +++ b/libdevcore/SHA3.cpp @@ -97,10 +97,9 @@ static const uint64_t RC[24] = \ static inline void keccakf(void* state) { uint64_t* a = (uint64_t*)state; uint64_t b[5] = {0}; - uint64_t t = 0; - uint8_t x, y; for (int i = 0; i < 24; i++) { + uint8_t x, y; // Theta FOR5(x, 1, b[x] = 0; @@ -110,7 +109,7 @@ static inline void keccakf(void* state) { FOR5(y, 5, a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); )) // Rho and pi - t = a[1]; + uint64_t t = a[1]; x = 0; REPEAT24(b[0] = a[pi[x]]; a[pi[x]] = rol(t, rho[x]); |