-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Istanbul: EIP-152 Blake2 F function #584
Conversation
That's great! 😄 @s1na Not sure, would likely make sense to release this as its own |
@s1na Ah, just did some reading on the EIP for the first time, so this (the F part) is just some extract from the So eventually not useful to extract as an own lib? This part of the functionality is not directly callable through the API of the blakejs library? |
Yeah exactly. It's kind of the core of blake2. You could e.g. build the blake2b hash function on top of this F function.
I'm not sure it'll be very useful. We could first release it here, and afterwards maybe move it to
Unfortunately not, I opened dcposch/blakejs#12 a while back to ask whether that's an option, but haven't received a response. I'm not sure the repo is actively maintained. |
This is generally close-to-be-ready I would assume and we can wait to include this in the |
@s1na Yes, likely makes sense to just leave the code here for now I would say. |
Yeah I don't have any more changes in mind, unless some more changes are requested during review. Something to note is that Alex proposed some changes to the EIP. But if they were merged in the EIP we could open a fresh PR later. |
@s1na this implementation seems to be very specific to blake2b and it may not work with blake2s (the G function needs to mod by the word with). |
@axic Ah, the title is a bit misleading on the EIP-152 PR page - still stating I would have a tendency to nevertheless merge here and release if the general review remarks are tackled - @s1na or are these Does this make sense? The |
It turns out the EIP is unclear and there is a debate going on. This PR matches the reference implementation done by the EIP authors and matches the tests given they were generated using that reference. I hope there will be changes to the EIP, but that can happen in a subsequent PR here. |
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.
Work in progress to fix #568
I took the blake2 logic from blakejs. For now I put it right above the precompile to make testing easier. I'm not sure where we want to maintain this code. Ideas @holgerd77?
Also used test cases in geth, one which does 8 million rounds is failing. I was trying to use the cases in ethereum/tests#619 but they all fail. I think it might be due to us not having implemented EIP-2200 yet.
Also the linter insisted on putting every element of
SIGMA8
andIV
on their own lines (adding 100 extra LoC), which I find ugly 😛