Skip to main content

EntryShareGenerator

Trait EntryShareGenerator 

Source
pub trait EntryShareGenerator<S: PixSpec> {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn next_share(
        &self,
        pseudonym: &S::Pseudonym,
        msg: &impl AsRef<[u8]>,
    ) -> Result<Option<GeneratedShare<S>>, Self::Error>;
    fn new_ssa_commitment(
        &self,
        pseudonym: &S::Pseudonym,
        ssa_index: SsaIndex,
    ) -> Result<SsaCommitment<S>, Self::Error>;
}

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn next_share( &self, pseudonym: &S::Pseudonym, msg: &impl AsRef<[u8]>, ) -> Result<Option<GeneratedShare<S>>, Self::Error>

Generate the next crate::PartialSsaShare for the given pseudonym and message msg.

IMPORTANT: Each msg MUST be unique for a given pseudonym.

Returns None if all polynomials for the given pseudonym have been used up. This signals that a new SSA must be committed.

Source

fn new_ssa_commitment( &self, pseudonym: &S::Pseudonym, ssa_index: SsaIndex, ) -> Result<SsaCommitment<S>, Self::Error>

Generates a new SSA commitment from the sender side, for the given pseudonym.

Returns the new random SSA-commitment and the corresponding SSA share verifier.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, S: PixSpec, T: 'a + EntryShareGenerator<S> + ?Sized> EntryShareGenerator<S> for &'a T

Source§

type Error = <T as EntryShareGenerator<S>>::Error

Source§

fn next_share( &self, pseudonym: &S::Pseudonym, msg: &impl AsRef<[u8]>, ) -> Result<Option<GeneratedShare<S>>, Self::Error>

Source§

fn new_ssa_commitment( &self, pseudonym: &S::Pseudonym, ssa_index: SsaIndex, ) -> Result<SsaCommitment<S>, Self::Error>

Source§

impl<S: PixSpec, T: EntryShareGenerator<S> + ?Sized> EntryShareGenerator<S> for Arc<T>

Source§

type Error = <T as EntryShareGenerator<S>>::Error

Source§

fn next_share( &self, pseudonym: &S::Pseudonym, msg: &impl AsRef<[u8]>, ) -> Result<Option<GeneratedShare<S>>, Self::Error>

Source§

fn new_ssa_commitment( &self, pseudonym: &S::Pseudonym, ssa_index: SsaIndex, ) -> Result<SsaCommitment<S>, Self::Error>

Source§

impl<S: PixSpec, T: EntryShareGenerator<S> + ?Sized> EntryShareGenerator<S> for Box<T>

Source§

type Error = <T as EntryShareGenerator<S>>::Error

Source§

fn next_share( &self, pseudonym: &S::Pseudonym, msg: &impl AsRef<[u8]>, ) -> Result<Option<GeneratedShare<S>>, Self::Error>

Source§

fn new_ssa_commitment( &self, pseudonym: &S::Pseudonym, ssa_index: SsaIndex, ) -> Result<SsaCommitment<S>, Self::Error>

Implementors§