pub struct SecurityTerm {
pub label: &'static str,
pub component: Option<&'static str>,
pub bits: ErrorBits,
}Expand description
A single named soundness contribution, in −log2(error) bits.
The label names the error source, and the crate charging it picks the name.
A protocol composing two instances of one scheme sees that label twice.
Naming the instance is what the component is for.
Fields§
§label: &'static strError source this term charges.
component: Option<&'static str>Which of the composing protocol’s parts charged it, when there is a choice.
bits: ErrorBitsThe bound itself, in −log2(error) bits.
Implementations§
Source§impl SecurityTerm
impl SecurityTerm
Sourcepub const fn new(label: &'static str, bits: ErrorBits) -> Self
pub const fn new(label: &'static str, bits: ErrorBits) -> Self
A term charged by whatever crate owns the error source.
The composing protocol is the only side that can name a component, so this leaves none.
Sourcepub const fn in_component(self, component: &'static str) -> Self
pub const fn in_component(self, component: &'static str) -> Self
The same term, attributed to one part of the composing protocol.
Sourcepub fn over_candidates(self, candidates: CandidateSet) -> Self
pub fn over_candidates(self, candidates: CandidateSet) -> Self
The same term, charged over every candidate a commitment still leaves open.
A draw made before one candidate is named gives a prover one try per candidate.
Subtracting the log of the set size is the union bound over those tries.
This is the workspace’s only implementation of that charge.
The set is passed by value and comes back unspent, so the layer above charges it too.
Trait Implementations§
Source§impl Clone for SecurityTerm
impl Clone for SecurityTerm
impl Copy for SecurityTerm
Source§impl Debug for SecurityTerm
impl Debug for SecurityTerm
Source§impl PartialEq for SecurityTerm
impl PartialEq for SecurityTerm
Source§impl Serialize for SecurityTerm
impl Serialize for SecurityTerm
impl StructuralPartialEq for SecurityTerm
Auto Trait Implementations§
impl Freeze for SecurityTerm
impl RefUnwindSafe for SecurityTerm
impl Send for SecurityTerm
impl Sync for SecurityTerm
impl Unpin for SecurityTerm
impl UnsafeUnpin for SecurityTerm
impl UnwindSafe for SecurityTerm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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