pub struct SsaShareGenerator<S: PixSpec> {
polynomials: Cache<S::Pseudonym, Arc<Mutex<SsaPseudonymEntry<S>>>, RandomState>,
cfg: SsaGeneratorConfig,
}Expand description
Generator for Session Stealth Address (SSA) shares distributed over Single Use Reply Blocks (SURBs).
Fields§
§polynomials: Cache<S::Pseudonym, Arc<Mutex<SsaPseudonymEntry<S>>>, RandomState>§cfg: SsaGeneratorConfigImplementations§
Sourcepub fn try_new(cfg: SsaGeneratorConfig) -> Result<Self, S::Pseudonym>
pub fn try_new(cfg: SsaGeneratorConfig) -> Result<Self, S::Pseudonym>
Creates a new share generator with the provided configuration.
Fails if the configuration does not validate. Prefer this over Self::new anywhere the
configuration is assembled at runtime — a config built programmatically or read from a file
is input, not a constant, and turning it into a panic makes it un-handleable by the caller.
Sourcepub fn new(cfg: SsaGeneratorConfig) -> Self
pub fn new(cfg: SsaGeneratorConfig) -> Self
Creates a new share generator with the provided configuration.
§Panics
Panics if the configuration fails validation. Use Self::try_new to handle that case
instead.
Sourcepub fn config(&self) -> &SsaGeneratorConfig
pub fn config(&self) -> &SsaGeneratorConfig
Returns the configuration used to generate this SsaShareGenerator.
Trait Implementations§
Generate the next 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>, S::Pseudonym>
fn new_ssa_commitment( &self, pseudonym: &S::Pseudonym, ssa_index: SsaIndex, ) -> Result<SsaCommitment<S>, S::Pseudonym>
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.
type Error = PixError<<S as PixSpec>::Pseudonym>
Auto Trait Implementations§
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more