diff --git a/proof-essentials/src/zkp/proofs/schnorr_identification/proof.rs b/proof-essentials/src/zkp/proofs/schnorr_identification/proof.rs index 024df94..c1924b7 100644 --- a/proof-essentials/src/zkp/proofs/schnorr_identification/proof.rs +++ b/proof-essentials/src/zkp/proofs/schnorr_identification/proof.rs @@ -14,7 +14,7 @@ pub struct Proof where C: ProjectiveCurve, { - pub(crate) random_commit: C, + pub(crate) random_commit: C::Affine, pub(crate) opening: C::ScalarField, } @@ -34,7 +34,9 @@ impl Proof { let c = C::ScalarField::rand(fs_rng); - if pp.mul(self.opening.into_repr()) + statement.mul(c.into_repr()) != self.random_commit { + if pp.mul(self.opening.into_repr()) + statement.mul(c.into_repr()) + != self.random_commit.into() + { return Err(CryptoError::ProofVerificationError(String::from( "Schnorr Identification", ))); diff --git a/proof-essentials/src/zkp/proofs/schnorr_identification/prover.rs b/proof-essentials/src/zkp/proofs/schnorr_identification/prover.rs index 5cfb19e..253f2bd 100644 --- a/proof-essentials/src/zkp/proofs/schnorr_identification/prover.rs +++ b/proof-essentials/src/zkp/proofs/schnorr_identification/prover.rs @@ -31,7 +31,7 @@ where ) -> Result, CryptoError> { let random = C::ScalarField::rand(rng); - let random_commit = pp.mul(random.into_repr()); + let random_commit = pp.mul(random.into_repr()).into(); fs_rng.absorb(&to_bytes![ b"schnorr_identity",