From 078d62e6ffe1f840e2d2ae9bc43d3b2e48c5926a Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Wed, 15 Feb 2023 19:48:58 +0000 Subject: [PATCH] Simplify compute_challenge --- specs/deneb/polynomial-commitments.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 6b94e1d9a..afcf934fc 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -231,21 +231,16 @@ def compute_challenge(blob: Blob, commitment: KZGCommitment) -> BLSFieldElement: """ Return the Fiat-Shamir challenge required by the rest of the protocol. - The Fiat-Shamir logic works as per the following pseudocode: """ - # Append the number of polynomials and the degree of each polynomial as a domain separator - num_polynomials = int.to_bytes(1, 8, ENDIANNESS) - degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS) - data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly + num_polynomials + # Append the degree of the polynomial as a domain separator + degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 16, ENDIANNESS) + data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly - # Append each polynomial which is composed by field elements data += blob - - # Append serialized G1 points data += commitment - # Transcript has been prepared: time to create the challenges + # Transcript has been prepared: time to create the challenge return hash_to_bls_field(data) ```