Comment on compute_challenge, assert on verify_blob_kzg_proof_multi

This commit is contained in:
Dankrad Feist 2023-02-14 21:10:09 +00:00
parent d8509e42c6
commit c3cb7fa773
No known key found for this signature in database
GPG Key ID: 6815E6A20BEBBABA
1 changed files with 3 additions and 4 deletions

View File

@ -229,11 +229,8 @@ def blob_to_polynomial(blob: Blob) -> Polynomial:
def compute_challenge(blob: Blob,
commitment: KZGCommitment) -> BLSFieldElement:
"""
Return the Fiat-Shamir challenges required by the rest of the protocol.
Return the Fiat-Shamir challenge required by the rest of the protocol.
The Fiat-Shamir logic works as per the following pseudocode:
hashed_data = hash(DOMAIN_SEPARATOR, polynomial, commitment)
eval_challenge = hash(hashed_data, 0)
"""
# Append the number of polynomials and the degree of each polynomial as a domain separator
@ -512,6 +509,8 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob],
Public method.
"""
assert len(blobs) == len(commitments_bytes) == len(proofs_bytes)
commitments, evaluation_challenges, ys, proofs = [], [], [], []
for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes):