ethereum/trinity

Incomplete BLS key validation

veorq opened this issue · 0 comments

veorq commented

Public key validation is done like this in the experimental Eth2 branch:

def validate_public_key(pubkey: BLSPubkey, allow_empty: bool = False) -> None:
if len(pubkey) != 48:
raise PublicKeyError(
f"Invalid public key length, expect 48 got {len(pubkey)}. pubkey: {pubkey.hex()}"
)
if not allow_empty and pubkey == EMPTY_PUBKEY:
raise PublicKeyError(f"Empty public key is invalid pubkey={pubkey.hex()}")

It should include group membership and infinity checks, as per https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04#section-2.5.