-
Notifications
You must be signed in to change notification settings - Fork 16
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
Backwards compatability of KeyGen #28
Comments
Or even after line 5? @kwantam: Could the extraneous round of hashing (which I guess is also a minor performance hit) be rolled back in a v5? |
The issue is that, from a security perspective, the extra hash is not extraneous. Per Hugo and the HKDF paper, using a structured salt string with HKDF violates its security analysis. So, for the sake of being conservative, we hash the structured string before using it as a salt. As discussed in the KeyGen section, it is completely fine if you want to use an alternative KeyGen function, including one that assumes that using a structured salt is OK, but making this more aggressive assumption doesn't seem appropriate for an IETF document when avoiding it is relatively simple. Regarding performance: there should be no hit, other than maybe 12 bytes of extra static storage: you can always precompute H("BLS-SIG-KEYGEN-SALT-"). |
Gotcha, thanks for the explanation :)
Right 👍 |
I didn't propose this as then the hash would be calculated and never used.
Thanks for clarifying, @kwantam, I was unaware of this.
Not really worried about this, it just felt like an extra reason to put the hash after the SK calcs. |
In #26,
KeyGen
was updated to never return SK=0. This is achieved by repeatedly hashing theseed
until a non-zero SK is found. This change was made in a non-backwards compatible way. Specifically, eth2 has tooling that uses the same methods for converting IKM into a SK in addition to this change requiring changes to BLS test vectors.For all real world use cases, the new
KeyGen
could have been made backwards compatible by hashing the seed only if the SK happens to be 0. This also has the benefit of saving one hash per key derived.This would be possible if the seed hashing that occurs in line 4 below occurred after line 7.
The text was updated successfully, but these errors were encountered: