pub struct BabyBearPoseidon2Config { /* private fields */ }Implementations§
Source§impl BabyBearPoseidon2Config
impl BabyBearPoseidon2Config
pub fn new_from_perm( params: SystemParams, perm: Poseidon2BabyBear<WIDTH>, ) -> Self
pub fn default_from_params(params: SystemParams) -> Self
Trait Implementations§
Source§impl Clone for BabyBearPoseidon2Config
impl Clone for BabyBearPoseidon2Config
Source§fn clone(&self) -> BabyBearPoseidon2Config
fn clone(&self) -> BabyBearPoseidon2Config
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BabyBearPoseidon2Config
impl Debug for BabyBearPoseidon2Config
Source§impl DecodableConfig for BabyBearPoseidon2Config
impl DecodableConfig for BabyBearPoseidon2Config
fn decode_base_field<R: Read>(reader: &mut R) -> Result<F>
fn decode_extension_field<R: Read>(reader: &mut R) -> Result<EF>
fn decode_digest<R: Read>(reader: &mut R) -> Result<Digest>
Source§fn decode_base_field_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::F>, Error>where
R: Read,
fn decode_base_field_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::F>, Error>where
R: Read,
Decode
n base field elements (known length, no length prefix).Source§fn decode_extension_field_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::EF>, Error>where
R: Read,
fn decode_extension_field_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::EF>, Error>where
R: Read,
Decode
n extension field elements (known length, no length prefix).Source§fn decode_digest_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::Digest>, Error>where
R: Read,
fn decode_digest_n<R>(
reader: &mut R,
n: usize,
) -> Result<Vec<Self::Digest>, Error>where
R: Read,
Decode
n digests (known length, no length prefix).Source§fn decode_base_field_vec<R>(reader: &mut R) -> Result<Vec<Self::F>, Error>where
R: Read,
fn decode_base_field_vec<R>(reader: &mut R) -> Result<Vec<Self::F>, Error>where
R: Read,
Decode a length-prefixed vector of base field elements.
Source§impl EncodableConfig for BabyBearPoseidon2Config
impl EncodableConfig for BabyBearPoseidon2Config
fn encode_base_field<W: Write>(val: &F, writer: &mut W) -> Result<()>
fn encode_extension_field<W: Write>(val: &EF, writer: &mut W) -> Result<()>
fn encode_digest<W: Write>(digest: &Self::Digest, writer: &mut W) -> Result<()>
Source§fn encode_base_field_iter<'a, W>(
iter: impl Iterator<Item = &'a Self::F>,
writer: &mut W,
) -> Result<(), Error>
fn encode_base_field_iter<'a, W>( iter: impl Iterator<Item = &'a Self::F>, writer: &mut W, ) -> Result<(), Error>
Encode each element from an iterator (no length prefix).
Source§fn encode_extension_field_iter<'a, W>(
iter: impl Iterator<Item = &'a Self::EF>,
writer: &mut W,
) -> Result<(), Error>
fn encode_extension_field_iter<'a, W>( iter: impl Iterator<Item = &'a Self::EF>, writer: &mut W, ) -> Result<(), Error>
Encode each element from an iterator (no length prefix).
Source§fn encode_digest_iter<'a, W>(
iter: impl Iterator<Item = &'a Self::Digest>,
writer: &mut W,
) -> Result<(), Error>
fn encode_digest_iter<'a, W>( iter: impl Iterator<Item = &'a Self::Digest>, writer: &mut W, ) -> Result<(), Error>
Encode each element from an iterator (no length prefix).
Source§fn encode_base_field_slice<W>(
vals: &[Self::F],
writer: &mut W,
) -> Result<(), Error>where
W: Write,
fn encode_base_field_slice<W>(
vals: &[Self::F],
writer: &mut W,
) -> Result<(), Error>where
W: Write,
Encode length-prefixed slice of base field elements.
Source§impl FiatShamirTranscript<BabyBearPoseidon2Config> for CpuTranscript
impl FiatShamirTranscript<BabyBearPoseidon2Config> for CpuTranscript
fn observe(&mut self, value: BabyBear)
fn sample(&mut self) -> BabyBear
Source§fn observe_commit(&mut self, digest: [BabyBear; 8])
fn observe_commit(&mut self, digest: [BabyBear; 8])
Implementations should pass through to Self::observe, but no default implementation is
provided since an explicit conversion from
Digest to array of F is required.Source§fn grind(&mut self, bits: usize) -> BabyBear
fn grind(&mut self, bits: usize) -> BabyBear
Finds a proof-of-work witness
w such that Self::check_witness(bits, w) holds, by
brute force over the base field.fn observe_ext(&mut self, value: <SC as StarkProtocolConfig>::EF)
fn sample_ext(&mut self) -> <SC as StarkProtocolConfig>::EF
Source§fn sample_bits(&mut self, bits: usize) -> u64
fn sample_bits(&mut self, bits: usize) -> u64
Samples and returns an integer in the range [0, 2^bits). Read more
Source§fn check_witness(
&mut self,
bits: usize,
witness: <SC as StarkProtocolConfig>::F,
) -> bool
fn check_witness( &mut self, bits: usize, witness: <SC as StarkProtocolConfig>::F, ) -> bool
Checks a proof-of-work witness: observes
witness into the transcript and accepts iff the
next Self::sample_bits is zero (probability ≈ 2^{-bits} for a random witness, so
Self::grind tries ≈ 2^bits witnesses to find one). Read moreSource§impl StarkProtocolConfig for BabyBearPoseidon2Config
impl StarkProtocolConfig for BabyBearPoseidon2Config
Source§type EF = BinomialExtensionField<MontyField31<BabyBearParameters>, 4>
type EF = BinomialExtensionField<MontyField31<BabyBearParameters>, 4>
The extension field, used for random challenges.
Source§type Hasher = Hasher<MontyField31<BabyBearParameters>, [MontyField31<BabyBearParameters>; 8], PaddingFreeSponge<Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, WIDTH>, Poseidon2InternalLayerMonty31<BabyBearParameters, WIDTH, BabyBearInternalLayerParameters>, WIDTH, p3_baby_bear::::poseidon2::Poseidon2BabyBear::{constant#0}>, WIDTH, RATE, DIGEST_SIZE>, TruncatedPermutation<Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, WIDTH>, Poseidon2InternalLayerMonty31<BabyBearParameters, WIDTH, BabyBearInternalLayerParameters>, WIDTH, p3_baby_bear::::poseidon2::Poseidon2BabyBear::{constant#0}>, 2, CHUNK, WIDTH>>
type Hasher = Hasher<MontyField31<BabyBearParameters>, [MontyField31<BabyBearParameters>; 8], PaddingFreeSponge<Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, WIDTH>, Poseidon2InternalLayerMonty31<BabyBearParameters, WIDTH, BabyBearInternalLayerParameters>, WIDTH, p3_baby_bear::::poseidon2::Poseidon2BabyBear::{constant#0}>, WIDTH, RATE, DIGEST_SIZE>, TruncatedPermutation<Poseidon2<MontyField31<BabyBearParameters>, Poseidon2ExternalLayerMonty31<BabyBearParameters, WIDTH>, Poseidon2InternalLayerMonty31<BabyBearParameters, WIDTH, BabyBearInternalLayerParameters>, WIDTH, p3_baby_bear::::poseidon2::Poseidon2BabyBear::{constant#0}>, 2, CHUNK, WIDTH>>
The merkle tree hasher used by the polynomial commitment scheme.
fn params(&self) -> &SystemParams
fn hasher(&self) -> &Self::Hasher
Auto Trait Implementations§
impl Freeze for BabyBearPoseidon2Config
impl RefUnwindSafe for BabyBearPoseidon2Config
impl Send for BabyBearPoseidon2Config
impl Sync for BabyBearPoseidon2Config
impl Unpin for BabyBearPoseidon2Config
impl UnsafeUnpin for BabyBearPoseidon2Config
impl UnwindSafe for BabyBearPoseidon2Config
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
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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