pub struct WhirConfig {
pub k: usize,
pub rounds: Vec<WhirRoundConfig>,
pub mu_pow_bits: usize,
pub query_phase_pow_bits: usize,
pub folding_pow_bits: usize,
pub proximity: WhirProximityStrategy,
}Fields§
§k: usizeConstant folding factor. This means that 2^k terms are folded per round.
rounds: Vec<WhirRoundConfig>§mu_pow_bits: usizeNumber of bits of grinding before sampling the μ batching challenge.
query_phase_pow_bits: usizeNumber of bits of grinding for the query phase of each WHIR round. The PoW bits can vary per round, but for simplicity we use the same number for all rounds.
folding_pow_bits: usizeNumber of bits of grinding before sampling folding randomness in each WHIR round. The folding PoW bits can vary per round, but for simplicity (and efficiency of the recursion circuit) we use the same number for all rounds.
proximity: WhirProximityStrategyProximity regimes for WHIR rounds. We use only proven error bounds.
Note: this field is not needed by the verifier as it is only used to determine the number
of queries in the rounds field. However we store it in WhirConfig for security analysis
purposes.
Implementations§
Source§impl WhirConfig
impl WhirConfig
Sourcepub fn new(
log_blowup: usize,
log_stacked_height: usize,
whir_params: WhirParams,
security_bits: usize,
) -> Self
pub fn new( log_blowup: usize, log_stacked_height: usize, whir_params: WhirParams, security_bits: usize, ) -> Self
Sets parameters targeting security_bits of provable security (including grinding), using
the given proximity regime.
pub fn log_final_poly_len(&self, log_stacked_height: usize) -> usize
pub fn num_whir_rounds(&self) -> usize
pub fn num_sumcheck_rounds(&self) -> usize
Sourcepub fn queries(
proximity_regime: ProximityRegime,
protocol_security_level: usize,
log_inv_rate: usize,
) -> usize
pub fn queries( proximity_regime: ProximityRegime, protocol_security_level: usize, log_inv_rate: usize, ) -> usize
Pure function to calculate the number of queries necessary for a given WHIR round.
protocol_security_levelrefers to the target bits of security without grinding.log_inv_rateis the log blowup for the WHIR round we want to calculate the number of queries for.
Trait Implementations§
Source§impl Clone for WhirConfig
impl Clone for WhirConfig
Source§fn clone(&self) -> WhirConfig
fn clone(&self) -> WhirConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WhirConfig
impl Debug for WhirConfig
Source§impl<'de> Deserialize<'de> for WhirConfig
impl<'de> Deserialize<'de> for WhirConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for WhirConfig
Source§impl PartialEq for WhirConfig
impl PartialEq for WhirConfig
Source§impl Serialize for WhirConfig
impl Serialize for WhirConfig
impl StructuralPartialEq for WhirConfig
Auto Trait Implementations§
impl Freeze for WhirConfig
impl RefUnwindSafe for WhirConfig
impl Send for WhirConfig
impl Sync for WhirConfig
impl Unpin for WhirConfig
impl UnsafeUnpin for WhirConfig
impl UnwindSafe for WhirConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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