#[repr(transparent)]pub struct BabyBearUnit(pub BabyBear);Tuple Fields§
§0: BabyBearTrait Implementations§
Source§impl Add for BabyBearUnit
impl Add for BabyBearUnit
Source§impl Clone for BabyBearUnit
impl Clone for BabyBearUnit
Source§fn clone(&self) -> BabyBearUnit
fn clone(&self) -> BabyBearUnit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BabyBearUnit
Source§impl Debug for BabyBearUnit
impl Debug for BabyBearUnit
Source§impl Deref for BabyBearUnit
impl Deref for BabyBearUnit
Source§type Target = MontyField31<BabyBearParameters>
type Target = MontyField31<BabyBearParameters>
Source§impl EncodedSessionId for BabyBearUnit
Reads a byte string as BabyBear units, one element per byte.
impl EncodedSessionId for BabyBearUnit
Reads a byte string as BabyBear units, one element per byte.
This is what lets a sponge over BabyBearUnit be seeded from a session
identifier: DuplexSponge implements
DuplexSpongeInit over any alphabet that
byte strings embed into. With it,
ProverState::new works over BabyBear
exactly as it does over bytes.
One element per byte rather than a denser packing: every element is then in
[0, 256), so the map is injective by inspection and there is no remainder
case to get wrong. A 32-byte session identifier costs 32 units, absorbed
once per proof.
§Security
Like the identity embedding on bytes, this map is injective but not
prefix-free across lengths: b"ab" maps to a prefix of b"abc". It is
admissible where the byte length is fixed by the protocol — a session
identifier is always 32 bytes — and a variable-length byte string must be
length-prefixed by the caller.
Source§fn encode_bytes(bytes: &[u8]) -> impl AsRef<[Self]>
fn encode_bytes(bytes: &[u8]) -> impl AsRef<[Self]>
bytes as a string of units.impl Eq for BabyBearUnit
Source§impl From<BabyBearUnit> for BabyBear
impl From<BabyBearUnit> for BabyBear
Source§fn from(value: BabyBearUnit) -> Self
fn from(value: BabyBearUnit) -> Self
Source§impl From<MontyField31<BabyBearParameters>> for BabyBearUnit
impl From<MontyField31<BabyBearParameters>> for BabyBearUnit
Source§impl Hash for BabyBearUnit
impl Hash for BabyBearUnit
Source§impl Mul for BabyBearUnit
impl Mul for BabyBearUnit
Source§impl PartialEq for BabyBearUnit
impl PartialEq for BabyBearUnit
Source§impl Ring for BabyBearUnit
impl Ring for BabyBearUnit
impl StructuralPartialEq for BabyBearUnit
Auto Trait Implementations§
impl Freeze for BabyBearUnit
impl RefUnwindSafe for BabyBearUnit
impl Send for BabyBearUnit
impl Sync for BabyBearUnit
impl Unpin for BabyBearUnit
impl UnsafeUnpin for BabyBearUnit
impl UnwindSafe for BabyBearUnit
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