diff --git a/bandersnatch_vrfs/src/lib.rs b/bandersnatch_vrfs/src/lib.rs index a766957..a7267c5 100644 --- a/bandersnatch_vrfs/src/lib.rs +++ b/bandersnatch_vrfs/src/lib.rs @@ -218,12 +218,12 @@ impl<'a> EcVrfSigner for RingProver<'a> { type Error = (); type Secret = SecretKey; fn vrf_sign_detached( - &self, + self, t: impl IntoTranscript, ios: &[VrfInOut] ) -> Result { - let RingProver { ring_prover, secret } = *self; + let RingProver { ring_prover, secret } = self; let secret_blinding = None; // TODO: Set this first so we can hash the ring proof let (dleq_proof,secret_blinding) = pedersen_vrf().sign_pedersen_vrf(t, ios, secret_blinding, secret); let ring_proof = ring_prover.prove(secret_blinding.0[0]); @@ -233,7 +233,7 @@ impl<'a> EcVrfSigner for RingProver<'a> { impl<'a> RingProver<'a> { pub fn sign_ring_vrf( - &self, + self, t: impl IntoTranscript, ios: &[VrfInOut; N], ) -> RingVrfSignature diff --git a/dleq_vrf/src/thin.rs b/dleq_vrf/src/thin.rs index 69fa43d..8ab21df 100644 --- a/dleq_vrf/src/thin.rs +++ b/dleq_vrf/src/thin.rs @@ -245,12 +245,12 @@ impl PublicKey { } } -impl EcVrfSigner for SecretKey { +impl EcVrfSigner for &SecretKey { type Proof = ThinVrfProof; type Error = (); - type Secret = Self; + type Secret = SecretKey; fn vrf_sign_detached( - &self, + self, t: impl IntoTranscript, ios: &[VrfInOut] ) -> Result diff --git a/dleq_vrf/src/traits.rs b/dleq_vrf/src/traits.rs index d3c1d95..362cda7 100644 --- a/dleq_vrf/src/traits.rs +++ b/dleq_vrf/src/traits.rs @@ -261,7 +261,7 @@ pub trait EcVrfVerifier { /// /// Inherent methods and other traits being used here: /// `IntoTranscript`, `vrf::{VrfInOut, VrfPreOut}` -pub trait EcVrfSigner: Borrow { +pub trait EcVrfSigner: Sized+Borrow { /// Detached signature aka proof type created by the VRF type Proof: EcVrfProof; @@ -273,14 +273,14 @@ pub trait EcVrfSigner: Borrow { type Secret: EcVrfSecret>; fn vrf_sign_detached( - &self, + self, t: impl IntoTranscript, ios: &[IO] ) -> Result; /// VRF signature for a fixed number of input-output pairs fn vrf_sign( - &self, + self, t: impl IntoTranscript, ios: &[IO; N] ) -> Result,Self::Error> @@ -296,7 +296,7 @@ pub trait EcVrfSigner: Borrow { /// more for pedagogy than for convenience. It demonstrates choosing /// whether we sign the VRF, and what else we sign in its transcript, /// after examining the VRF output. - fn vrf_sign_one(&self, input: I, mut check: F) -> Result,Self::Error> + fn vrf_sign_one(self, input: I, mut check: F) -> Result,Self::Error> where I: IntoVrfInput>, T: IntoTranscript, @@ -309,7 +309,7 @@ pub trait EcVrfSigner: Borrow { /// VRF signature for a variable number of input-output pairs. fn vrf_sign_vec( - &self, + self, t: impl IntoTranscript, ios: &[IO] ) -> Result,Self::Error>