Skip to content

Conversation

@barnabasbusa
Copy link

The Bug: The ethereum-consensus library's SecretKey::try_from() method was overly strict, rejecting mathematically valid BLS12-381 private keys that exceed the field order instead of performing proper modular reduction.


// Use HKDF with the key as input material to perform proper reduction
// This follows EIP-2333 key generation pattern
let sk = bls_impl::SecretKey::key_gen(&key_int, &[]).map_err(BLSTError::from)?;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to go this route, we probably want something like this

https://docs.rs/blst/0.3.15/blst/min_pk/struct.SecretKey.html#method.derive_master_eip2333

let me see if there is a better way to expose this though before making any changes

@ralexstokes
Copy link
Owner

closing in lieu of #421

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

Successfully merging this pull request may close these issues.

2 participants