mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-02 22:03:37 +00:00
Add KZGProof at G1_POINT_AT_INFINITY
case
This commit is contained in:
parent
ce240ca795
commit
6041c9b9d6
@ -399,6 +399,20 @@ def case05_verify_blob_kzg_proof():
|
||||
'output': None
|
||||
}
|
||||
|
||||
# Edge case: Incorrect `G1_POINT_AT_INFINITY` Proof
|
||||
blob = BLOB_RANDOM_VALID1
|
||||
commitment = spec.blob_to_kzg_commitment(blob)
|
||||
proof = spec.G1_POINT_AT_INFINITY
|
||||
assert not spec.verify_blob_kzg_proof(blob, commitment, proof)
|
||||
yield 'verify_blob_kzg_proof_case_incorrect_proof_point_at_infinity', {
|
||||
'input': {
|
||||
'blob': encode_hex(blob),
|
||||
'commitment': encode_hex(commitment),
|
||||
'proof': encode_hex(proof),
|
||||
},
|
||||
'output': False
|
||||
}
|
||||
|
||||
|
||||
def case06_verify_blob_kzg_proof_batch():
|
||||
# Valid cases
|
||||
@ -423,7 +437,7 @@ def case06_verify_blob_kzg_proof_batch():
|
||||
# Incorrect proof
|
||||
proofs_incorrect = [bls_add_one(proofs[0])] + proofs[1:]
|
||||
assert not spec.verify_blob_kzg_proof_batch(VALID_BLOBS, commitments, proofs_incorrect)
|
||||
yield 'verify_blob_kzg_proof_batch_case_invalid_proof', {
|
||||
yield 'verify_blob_kzg_proof_batch_case_incorrect_proof_add_one', {
|
||||
'input': {
|
||||
'blobs': encode_hex_list(VALID_BLOBS),
|
||||
'commitments': encode_hex_list(commitments),
|
||||
@ -509,6 +523,21 @@ def case06_verify_blob_kzg_proof_batch():
|
||||
'output': None
|
||||
}
|
||||
|
||||
# Edge case: Incorrect `G1_POINT_AT_INFINITY` Proof
|
||||
blob = BLOB_RANDOM_VALID1
|
||||
commitment = spec.blob_to_kzg_commitment(blob)
|
||||
proof = spec.G1_POINT_AT_INFINITY
|
||||
assert not spec.verify_blob_kzg_proof_batch([blob], [commitment], [proof])
|
||||
|
||||
yield 'verify_blob_kzg_proof_batch_case_incorrect_proof_point_at_infinity', {
|
||||
'input': {
|
||||
'blobs': encode_hex_list([blob]),
|
||||
'commitments': encode_hex_list([commitment]),
|
||||
'proofs': encode_hex_list([proof]),
|
||||
},
|
||||
'output': False
|
||||
}
|
||||
|
||||
|
||||
def create_provider(fork_name: SpecForkName,
|
||||
handler_name: str,
|
||||
|
Loading…
x
Reference in New Issue
Block a user