Struct proof_system::sub_protocols::schnorr::SchnorrProtocol
source · pub struct SchnorrProtocol<'a, G: AffineRepr> {
pub id: usize,
pub commitment_key: &'a [G],
pub commitment: G,
pub commitment_to_randomness: Option<SchnorrCommitment<G>>,
pub witnesses: Option<Vec<G::ScalarField>>,
}
Fields§
§id: usize
§commitment_key: &'a [G]
§commitment: G
§commitment_to_randomness: Option<SchnorrCommitment<G>>
§witnesses: Option<Vec<G::ScalarField>>
Implementations§
source§impl<'a, G: AffineRepr> SchnorrProtocol<'a, G>
impl<'a, G: AffineRepr> SchnorrProtocol<'a, G>
pub fn new(id: usize, commitment_key: &'a [G], commitment: G) -> Self
sourcepub fn init<R: RngCore>(
&mut self,
rng: &mut R,
blindings: BTreeMap<usize, G::ScalarField>,
witnesses: Vec<G::ScalarField>
) -> Result<(), ProofSystemError>
pub fn init<R: RngCore>( &mut self, rng: &mut R, blindings: BTreeMap<usize, G::ScalarField>, witnesses: Vec<G::ScalarField> ) -> Result<(), ProofSystemError>
blindings
specifies the randomness to use. If some index is not present, new randomness is generated for it.
pub fn challenge_contribution<W: Write>( &self, writer: W ) -> Result<(), ProofSystemError>
pub fn gen_proof_contribution<E: Pairing<G1Affine = G>>( &mut self, challenge: &G::ScalarField ) -> Result<StatementProof<E>, ProofSystemError>
pub fn gen_proof_contribution_g2<E: Pairing<G2Affine = G>>( &mut self, challenge: &G::ScalarField ) -> Result<StatementProof<E>, ProofSystemError>
pub fn gen_proof_contribution_as_struct( &mut self, challenge: &G::ScalarField ) -> Result<PedersenCommitmentProof<G>, ProofSystemError>
pub fn verify_proof_contribution( &self, challenge: &G::ScalarField, proof: &PedersenCommitmentProof<G> ) -> Result<(), SchnorrError>
pub fn compute_challenge_contribution<W: Write>( bases: &[G], y: &G, t: &G, writer: W ) -> Result<(), ProofSystemError>
Trait Implementations§
source§impl<'a, G: Clone + AffineRepr> Clone for SchnorrProtocol<'a, G>where
G::ScalarField: Clone,
impl<'a, G: Clone + AffineRepr> Clone for SchnorrProtocol<'a, G>where
G::ScalarField: Clone,
source§fn clone(&self) -> SchnorrProtocol<'a, G>
fn clone(&self) -> SchnorrProtocol<'a, G>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, G: Debug + AffineRepr> Debug for SchnorrProtocol<'a, G>where
G::ScalarField: Debug,
impl<'a, G: Debug + AffineRepr> Debug for SchnorrProtocol<'a, G>where
G::ScalarField: Debug,
source§impl<'a, G: AffineRepr> Drop for SchnorrProtocol<'a, G>
impl<'a, G: AffineRepr> Drop for SchnorrProtocol<'a, G>
source§impl<'a, G: PartialEq + AffineRepr> PartialEq for SchnorrProtocol<'a, G>where
G::ScalarField: PartialEq,
impl<'a, G: PartialEq + AffineRepr> PartialEq for SchnorrProtocol<'a, G>where
G::ScalarField: PartialEq,
source§fn eq(&self, other: &SchnorrProtocol<'a, G>) -> bool
fn eq(&self, other: &SchnorrProtocol<'a, G>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a, G: AffineRepr> Zeroize for SchnorrProtocol<'a, G>
impl<'a, G: AffineRepr> Zeroize for SchnorrProtocol<'a, G>
impl<'a, G: Eq + AffineRepr> Eq for SchnorrProtocol<'a, G>where
G::ScalarField: Eq,
impl<'a, G: AffineRepr> StructuralPartialEq for SchnorrProtocol<'a, G>
Auto Trait Implementations§
impl<'a, G> Freeze for SchnorrProtocol<'a, G>where
G: Freeze,
impl<'a, G> RefUnwindSafe for SchnorrProtocol<'a, G>
impl<'a, G> Send for SchnorrProtocol<'a, G>
impl<'a, G> Sync for SchnorrProtocol<'a, G>
impl<'a, G> Unpin for SchnorrProtocol<'a, G>
impl<'a, G> UnwindSafe for SchnorrProtocol<'a, G>
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Upcastable for T
impl<T> Upcastable for T
source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref