-
Notifications
You must be signed in to change notification settings - Fork 794
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
Update hash function #111
Comments
ideally that function is just generic over our hashing function... i just checked though and the tiny_keccak hash does not implement |
Oh yep, I didn't notice the change to keccack! I also noticed that the hashing libs I saw didn't use I agree that it would be ideal that Why exactly is there a panic due to lighthouse moving to keccack, I would have thought |
I believe it has to do w/ this: https://github.com/sigp/lighthouse/blob/master/beacon_chain/utils/hashing/src/lib.rs#L13 and pretty sure it traces to this: https://github.com/sigp/signature-schemes/blob/master/src/amcl_utils.rs#L36 Seems like Is there a reason the buffer is this size? |
Oh yeah, sorry I'm with you now. So you were modifying Milagro expects 48 bytes (the curve is 381 bit) and it will cause an OOB panic if you give it any less. I raised this on the spec at one point but it didn't really go anywhere. My approach would be to leave it as it is for now, then revisit this once we're closer to a point where out signatures need to match other clients. AFAIK we don't even have test vectors yet, so it's likely that no-one is matching at this point. Unless of course it's blocking our progress. |
gotcha -- yeah i would have to dig into the crypto a bit to say more... i'll just extend the buffer for now like it was |
Description
The older spec used
blake2
as the hash function. The latest spec useskeccak256
.Present Behaviour
Uses the old hash.
Expected Behaviour
Should use the new hash.
Steps to resolve
Use the correct hash function.
I started this work on a branch and seem to be triggering a panic due to this line:
https://github.com/sigp/signature-schemes/blob/master/src/amcl_utils.rs#L36
And think we should just update that crate to use keccak256 as well.
Figured I would open this up for discussion before making more changes.
The text was updated successfully, but these errors were encountered: