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

Update keygen for BLS v2 #59

Closed
mratsim opened this issue Jun 2, 2020 · 1 comment
Closed

Update keygen for BLS v2 #59

mratsim opened this issue Jun 2, 2020 · 1 comment

Comments

@mratsim
Copy link
Contributor

mratsim commented Jun 2, 2020

The HKDF info parameter was changed in the BLS draft v2 as mentioned in ethereum/EIPs#2337 (comment)

Current

1. PRK = HKDF-Extract("BLS-SIG-KEYGEN-SALT-", IKM)
2. OKM = HKDF-Expand(PRK, "", L)
3. SK = OS2IP(OKM) mod r
4. return SK

# 2. OKM = HKDF-Expand(PRK, "", L)
const L = 48
var okm: array[L, byte]
ctx.hkdfExpand(prk, "", okm)

Target

1. PRK = HKDF-Extract("BLS-SIG-KEYGEN-SALT-", IKM || I2OSP(0, 1))
2. OKM = HKDF-Expand(PRK, key_info || I2OSP(L, 2), L)
3. SK = OS2IP(OKM) mod r
4. return SK
@mratsim
Copy link
Contributor Author

mratsim commented Jul 22, 2020

Closed by #65

@mratsim mratsim closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant