Skip to content
Snippets Groups Projects
Commit 64644276 authored by Ben Adida's avatar Ben Adida
Browse files

Merge pull request #46 from np/check-zk-length

Additionally check for the length of the array of proofs
parents da246171 566d149a
No related branches found
No related tags found
No related merge requests found
......@@ -547,6 +547,10 @@ class EGCiphertext:
overall_challenge is what all of the challenges combined should yield.
"""
if len(plaintexts) != len(proof.proofs):
print("bad number of proofs (expected %s, found %s)" % (len(plaintexts), len(proof.proofs)))
return False
for i in range(len(plaintexts)):
# if a proof fails, stop right there
if not self.verify_encryption_proof(plaintexts[i], proof.proofs[i]):
......
......@@ -409,6 +409,10 @@ class Ciphertext:
overall_challenge is what all of the challenges combined should yield.
"""
if len(plaintexts) != len(proof.proofs):
print("bad number of proofs (expected %s, found %s)" % (len(plaintexts), len(proof.proofs)))
return False
for i in range(len(plaintexts)):
# if a proof fails, stop right there
if not self.verify_encryption_proof(plaintexts[i], proof.proofs[i]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment