Remove double hashing
This commit is contained in:
parent
855cf062f0
commit
3a6fccd389
|
@ -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]) ==
|
||||||
|
|
Loading…
Reference in New Issue