-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
* Adjust endianess on byte payload * f flag can have only 0 or 1 * Fewer successful vector tests * Tests for failure and edge cases
* added a test for not-finalized value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the description with a link to the EIP and any relevant notes about these specific changes if there are any?
@@ -27,21 +27,21 @@ | |||
private Blake2bfMessageDigest messageDigest; | |||
|
|||
// output when input is all 0 | |||
private byte[] blake2bfAllZero = | |||
private static final byte[] BLAKE2F_ALL_ZERO = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these test cases coming from? Is there a spec we can link to? Would the tests be clearer if kept these values as hexary strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are not as useful as the precompiled test vectors. Those have more coverage. As far as I can tell they were calculated from the blake RFC.
@@ -224,7 +224,7 @@ private int bytesToInt(final byte[] bytes) { | |||
} | |||
|
|||
private long bytesToLong(final byte[] bytes) { | |||
return Pack.bigEndianToLong(bytes, 0); | |||
return Pack.littleEndianToLong(bytes, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty bizarre that the payload is a mix of big endian and little endian values :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. But that's what some web3/solidity folks asked for in the EIP and got.
PR description
Fixed Issue(s)