Conversation
Codecov Report
@@ Coverage Diff @@
## master #5751 +/- ##
========================================
Coverage ? 63.8%
========================================
Files ? 358
Lines ? 30604
Branches ? 3403
========================================
Hits ? 19526
Misses ? 9848
Partials ? 1230 |
libdevcrypto/Blake2.cpp
Outdated
| uint64_t w; | ||
| memcpy(&w, src, sizeof w); | ||
| return w; | ||
| #else |
There was a problem hiding this comment.
@chfast Should we care about big endian platforms?
libdevcrypto/Blake2.cpp
Outdated
|
|
||
| s.t[0] = load64(_t0.data()); | ||
| s.t[1] = load64(_t1.data()); | ||
| s.t[0] = *reinterpret_cast<uint64_t const*>(_t0.data()); |
There was a problem hiding this comment.
These should stay load64 because otherwise this is undefined behavior if the memory is not aligned to 8 bytes.
libdevcrypto/Blake2.cpp
Outdated
| BLAKE2B_BLOCKBYTES = 128, | ||
| }; | ||
|
|
||
| typedef struct blake2b_state__ |
libdevcrypto/Blake2.cpp
Outdated
|
|
||
| enum blake2b_constant | ||
| { | ||
| BLAKE2B_BLOCKBYTES = 128, |
libdevcrypto/Blake2.cpp
Outdated
| } blake2b_state; | ||
|
|
||
| // clang-format off | ||
| const uint64_t blake2b_IV[8] = |
libdevcrypto/Blake2.cpp
Outdated
| return w; | ||
| } | ||
|
|
||
| inline uint64_t rotr64(const uint64_t w, const unsigned c) noexcept |
There was a problem hiding this comment.
| inline uint64_t rotr64(const uint64_t w, const unsigned c) noexcept | |
| inline constexpr uint64_t rotr64(uint64_t w, unsigned c) noexcept |
libdevcrypto/Blake2.cpp
Outdated
| { | ||
| uint64_t m[16]; | ||
| uint64_t v[16]; | ||
| size_t i; |
|
|
||
| #include <libdevcore/Exceptions.h> | ||
|
|
||
| // The Blake 2 F compression function implemenation is based on the reference implementation, |
There was a problem hiding this comment.
@chfast do we need any kind of license note here?
There was a problem hiding this comment.
It is not required because the reference implementation is in public domain, but I think it is nice to leave it here.
|
benchmarking test vectors from EIP (+ another one for 1200 rounds) currently looks like this to me |
|
This passes state tests from ethereum/tests#619, so I'm going to merge soon |
https://eips.ethereum.org/EIPS/eip-152