Remove double hashing

This commit is contained in:
Dankrad Feist 2023-02-14 20:17:25 +00:00
parent 855cf062f0
commit 3a6fccd389
No known key found for this signature in database
GPG Key ID: 6815E6A20BEBBABA
1 changed files with 2 additions and 4 deletions

View File

@ -248,8 +248,7 @@ def compute_challenge(blob: Blob,
data += commitment data += commitment
# Transcript has been prepared: time to create the challenges # Transcript has been prepared: time to create the challenges
hashed_data = hash(data) return hash_to_bls_field(data)
return hash_to_bls_field(hashed_data + b'\x00')
``` ```
#### `bls_modular_inverse` #### `bls_modular_inverse`
@ -413,8 +412,7 @@ def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment],
+ int.to_bytes(y, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \ + int.to_bytes(y, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \
+ proof + proof
hashed_data = hash(data) r = hash_to_bls_field(data)
r = hash_to_bls_field(hashed_data + b'\x00')
r_powers = compute_powers(r, len(commitments)) r_powers = compute_powers(r, len(commitments))
# Verify: e(sum r^i proof_i, [s]) == # Verify: e(sum r^i proof_i, [s]) ==