5.4. sdzkp.verifier
Classes
- class sdzkp.verifier.Verifier(instance_id)[source]
The Verifier class is responsible for verifying the proofs provided by the Prover in the Zero-Knowledge Proof (ZKP) protocol for the Subgroup Distance Problem (SGD).
- instance_id
A unique identifier for the problem instance.
- Type:
str
- SGD
The instance of the Subgroup Distance Problem.
- Type:
Initializes the Verifier with a given instance ID.
- Parameters:
instance_id (str) – A unique identifier for the problem instance.
- handleSetup(sgdinst)[source]
Handles the setup phase by creating a Subgroup Distance Problem instance from the provided data.
- Parameters:
sgdinst (sdzkp_pb2.SGDInstance) – The SGD instance received from the Prover.
- Returns:
An acknowledgment message indicating whether the setup was successful.
- Return type:
sdzkp_pb2.SetupAck
- handleCommit(commitments)[source]
Handles the commit phase by storing the commitments and generating a challenge.
- Parameters:
commitments (sdzkp_pb2.Commitments) – The commitments received from the Prover.
- Returns:
A challenge message to be sent to the Prover.
- Return type:
sdzkp_pb2.Challenge
- verify_0(rd, Z1, s, t_u)[source]
Verifies the proof for the challenge c=0.
- Parameters:
rd (SubgroupDistanceRound) – The round data.
Z1 (list) – The Z1 value received from the Prover.
s (int) – The seed used for random generation.
t_u (list) – The t_u value received from the Prover.
- Returns:
True if the verification succeeds, False otherwise.
- Return type:
bool
- verify_1(rd, Z2, s, t_r)[source]
Verifies the proof for the challenge c=1.
- Parameters:
rd (SubgroupDistanceRound) – The round data.
Z2 (list) – The Z2 value received from the Prover.
s (int) – The seed used for random generation.
t_r (list) – The t_r value received from the Prover.
- Returns:
True if the verification succeeds, False otherwise.
- Return type:
bool
- verify_2(rd, Z1, Z2)[source]
Verifies the proof for the challenge c=2.
- Parameters:
rd (SubgroupDistanceRound) – The round data.
Z1 (list) – The Z1 value received from the Prover.
Z2 (list) – The Z2 value received from the Prover.
- Returns:
True if the verification succeeds, False otherwise.
- Return type:
bool