Skip to content

Commit 078d62e

Browse files
committed
Simplify compute_challenge
1 parent 48e7be7 commit 078d62e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

specs/deneb/polynomial-commitments.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,16 @@ def compute_challenge(blob: Blob,
231231
commitment: KZGCommitment) -> BLSFieldElement:
232232
"""
233233
Return the Fiat-Shamir challenge required by the rest of the protocol.
234-
The Fiat-Shamir logic works as per the following pseudocode:
235234
"""
236235

237-
# Append the number of polynomials and the degree of each polynomial as a domain separator
238-
num_polynomials = int.to_bytes(1, 8, ENDIANNESS)
239-
degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS)
240-
data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly + num_polynomials
236+
# Append the degree of the polynomial as a domain separator
237+
degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 16, ENDIANNESS)
238+
data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly
241239

242-
# Append each polynomial which is composed by field elements
243240
data += blob
244-
245-
# Append serialized G1 points
246241
data += commitment
247242

248-
# Transcript has been prepared: time to create the challenges
243+
# Transcript has been prepared: time to create the challenge
249244
return hash_to_bls_field(data)
250245
```
251246

0 commit comments

Comments
 (0)