Merge pull request #3077 from asn-d6/type_fix_hash_to_bls_field

Fix type error in the inputs to hash_to_bls_field()
This commit is contained in:
George Kadianakis 2022-11-03 18:47:17 +02:00 committed by GitHub
commit 26695a9fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -346,13 +346,16 @@ def compute_aggregated_poly_and_commitment(
Return (1) the aggregated polynomial, (2) the aggregated KZG commitment, Return (1) the aggregated polynomial, (2) the aggregated KZG commitment,
and (3) the polynomial evaluation random challenge. and (3) the polynomial evaluation random challenge.
""" """
# Convert blobs to polynomials
polynomials = [blob_to_polynomial(blob) for blob in blobs]
# Generate random linear combination challenges # Generate random linear combination challenges
r = hash_to_bls_field(blobs, kzg_commitments) r = hash_to_bls_field(polynomials, kzg_commitments)
r_powers = compute_powers(r, len(kzg_commitments)) r_powers = compute_powers(r, len(kzg_commitments))
evaluation_challenge = int(r_powers[-1]) * r % BLS_MODULUS evaluation_challenge = int(r_powers[-1]) * r % BLS_MODULUS
# Create aggregated polynomial in evaluation form # Create aggregated polynomial in evaluation form
aggregated_poly = Polynomial(poly_lincomb([blob_to_polynomial(blob) for blob in blobs], r_powers)) aggregated_poly = Polynomial(poly_lincomb(polynomials, r_powers))
# Compute commitment to aggregated polynomial # Compute commitment to aggregated polynomial
aggregated_poly_commitment = KZGCommitment(g1_lincomb(kzg_commitments, r_powers)) aggregated_poly_commitment = KZGCommitment(g1_lincomb(kzg_commitments, r_powers))