pub struct CandidateSet { /* private fields */ }Expand description
How many polynomials a commitment still leaves open.
The rule: a layer charges its own draws over the whole set, then passes the set on.
A charge never shrinks the set, which the commitment fixed before anything above drew.
Unique decoding leaves one candidate, which costs a later draw nothing.
A list-decoding argument leaves a list, and each earlier draw gets one try per member.
§What this type does and does not catch
It catches a count that is not a set size.
That is the one arithmetic error here that overstates a level.
A negative count would add bits to the term it is charged over.
Being copied rather than spent is what forwarding looks like in the signature.
It does not catch a draw nobody charged.
Nor a scheme reporting an open list as unique.
Both of those overstate a level, and no type can see either one.
A component supplying no evidence leaves the report with no number to give.
Past that, a missing term is caught by the tests that name each one.
An understated list is a claim about the proximity argument, checked where it lives.
§Example
Two stacked layers, over a commitment leaving sixteen candidates open.
use p3_security::{CandidateSet, ErrorBits, SecurityTerm};
let candidates = CandidateSet::from_log2(4.0).unwrap();
// The inner layer charges its own reduction and forwards the set untouched.
let inner = SecurityTerm::new("inner", ErrorBits::from_log2(100.0)).over_candidates(candidates);
assert_eq!(inner.bits.bits(), 96.0);
// The outer layer charges its own draw over the same set, not over what is left of it.
let outer = SecurityTerm::new("outer", ErrorBits::from_log2(100.0)).over_candidates(candidates);
assert_eq!(outer.bits.bits(), 96.0);Implementations§
Source§impl CandidateSet
impl CandidateSet
Trait Implementations§
Source§impl Clone for CandidateSet
impl Clone for CandidateSet
impl Copy for CandidateSet
Source§impl Debug for CandidateSet
impl Debug for CandidateSet
Source§impl PartialEq for CandidateSet
impl PartialEq for CandidateSet
Source§impl PartialOrd for CandidateSet
impl PartialOrd for CandidateSet
Source§impl Serialize for CandidateSet
impl Serialize for CandidateSet
impl StructuralPartialEq for CandidateSet
Auto Trait Implementations§
impl Freeze for CandidateSet
impl RefUnwindSafe for CandidateSet
impl Send for CandidateSet
impl Sync for CandidateSet
impl Unpin for CandidateSet
impl UnsafeUnpin for CandidateSet
impl UnwindSafe for CandidateSet
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