Skip to content
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

Outdated EIP2333 version #7763

Closed
CarlBeek opened this issue Nov 10, 2020 · 1 comment
Closed

Outdated EIP2333 version #7763

CarlBeek opened this issue Nov 10, 2020 · 1 comment
Assignees
Labels
Priority: High High priority item
Milestone

Comments

@CarlBeek
Copy link

Outdated EIP2333 version

Description

A few months ago, EIP 2333 was updated so that hkdf_mod_r matched the KeyGen function update in the BLS specs. Prysm is still using the old version.

🔬 Minimal Reproduction

Try run the EIP's tests against your implementation.

The fix

Update hkdf_mod_r to the new version with the while loop as per EIP2333 and run it against the given test vectors:

1. salt = "BLS-SIG-KEYGEN-SALT-"
2. SK = 0
3. while SK == 0:
4.     salt = H(salt)
5.     PRK = HKDF-Extract(salt, IKM || I2OSP(0, 1))
6.     OKM = HKDF-Expand(PRK, key_info || I2OSP(L, 2), L)
7.     SK = OS2IP(OKM) mod r
8. return SK
@nisdas nisdas added the Priority: High High priority item label Nov 10, 2020
@rauljordan rauljordan added this to the Diamond milestone Nov 10, 2020
@rauljordan
Copy link
Contributor

Hi @CarlBeek we just tested this out in #7783 and are compliant with the tests. The reason there might be a misunderstanding is because we vendored in an old dependency to support old users of the Medalla testnet

func (dr *Keymanager) deriveKey(path string) (*types.BLSPrivateKey, error) {

We have a tracking issue to remove this old dependency before Prysm's mainnet release here #7752, thanks for bringing this up as now we have included the tests into our repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority item
Projects
None yet
Development

No branches or pull requests

3 participants