Struct StmClerk

Source
pub struct StmClerk<D: Clone + Digest> { /* private fields */ }
Expand description

Clerk can verify and aggregate SingleSignatures and verify AggregateSignatures. Clerks can only be generated with the registration closed. This avoids that a Merkle Tree is computed before all parties have registered.

Implementations§

Source§

impl<D: Digest + Clone + FixedOutput> Clerk<D>

Source

pub fn new_clerk_from_closed_key_registration( params: &Parameters, closed_reg: &ClosedKeyRegistration<D>, ) -> Self

Create a new Clerk from a closed registration instance.

Source

pub fn from_registration( params: &Parameters, closed_reg: &ClosedKeyRegistration<D>, ) -> Self

👎Deprecated since 0.4.9: Use new_clerk_from_closed_key_registration instead

Create a new Clerk from a closed registration instance.

Source

pub fn new_clerk_from_signer(signer: &Signer<D>) -> Self

Create a Clerk from a signer.

Source

pub fn from_signer(signer: &Signer<D>) -> Self

👎Deprecated since 0.4.9: Use new_clerk_from_signer instead

Create a Clerk from a signer.

Source

pub fn aggregate_signatures( &self, sigs: &[SingleSignature], msg: &[u8], ) -> Result<AggregateSignature<D>, AggregationError>

Aggregate a set of signatures for their corresponding indices.

This function first deduplicates the repeated signatures, and if there are enough signatures, it collects the merkle tree indexes of unique signatures. The list of merkle tree indexes is used to create a batch proof, to prove that all signatures are from eligible signers.

It returns an instance of AggregateSignature.

Source

pub fn aggregate( &self, sigs: &[SingleSignature], msg: &[u8], ) -> Result<AggregateSignature<D>, AggregationError>

👎Deprecated since 0.4.9: Use aggregate_signatures instead

Aggregate a set of signatures for their corresponding indices.

This function first deduplicates the repeated signatures, and if there are enough signatures, it collects the merkle tree indexes of unique signatures. The list of merkle tree indexes is used to create a batch proof, to prove that all signatures are from eligible signers.

It returns an instance of AggregateSignature.

Source

pub fn compute_aggregate_verification_key(&self) -> AggregateVerificationKey<D>

Compute the AggregateVerificationKey related to the used registration.

Source

pub fn compute_avk(&self) -> AggregateVerificationKey<D>

👎Deprecated since 0.4.9: Use compute_aggregate_verification_key instead

Compute the AggregateVerificationKey related to the used registration.

Source

pub fn get_registered_party_for_index( &self, party_index: &Index, ) -> Option<(VerificationKey, Stake)>

Get the (VK, stake) of a party given its index.

Source

pub fn get_reg_party( &self, party_index: &Index, ) -> Option<(VerificationKey, Stake)>

👎Deprecated since 0.4.9: Use get_registered_party_for_index instead

Get the (VK, stake) of a party given its index.

Trait Implementations§

Source§

impl<D: Clone + Clone + Digest> Clone for Clerk<D>

Source§

fn clone(&self) -> Clerk<D>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D: Debug + Clone + Digest> Debug for Clerk<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<D> Freeze for Clerk<D>

§

impl<D> RefUnwindSafe for Clerk<D>
where D: RefUnwindSafe,

§

impl<D> Send for Clerk<D>
where D: Sync + Send,

§

impl<D> Sync for Clerk<D>
where D: Sync + Send,

§

impl<D> Unpin for Clerk<D>

§

impl<D> UnwindSafe for Clerk<D>
where D: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.