#[repr(C)]pub struct PackedScalar {
pub v: [u32; 8],
}Expand description
BN254 scalar as an integer in [0, r), 32 bytes, standard form, little-endian
32-bit limbs. For MSM window decomposition only. See the module docs.
MSL twin: struct Scalar { uint v[8]; }.
Fields§
§v: [u32; 8]Implementations§
Source§impl PackedScalar
impl PackedScalar
pub const ZERO: Self
Sourcepub fn to_fr(&self) -> Option<Fr>
pub fn to_fr(&self) -> Option<Fr>
None if the limbs are not a canonical residue, which for a scalar is a real
possibility (unlike a Montgomery representative, which is canonical by
construction) and must not be papered over with a silent reduction.
pub fn pack_slice(xs: &[Fr]) -> Vec<Self>
Trait Implementations§
Source§impl Clone for PackedScalar
impl Clone for PackedScalar
impl Copy for PackedScalar
Source§impl Debug for PackedScalar
impl Debug for PackedScalar
Source§impl Default for PackedScalar
impl Default for PackedScalar
impl Eq for PackedScalar
impl Packed for PackedScalar
Source§impl PartialEq for PackedScalar
impl PartialEq for PackedScalar
impl StructuralPartialEq for PackedScalar
Auto Trait Implementations§
impl Freeze for PackedScalar
impl RefUnwindSafe for PackedScalar
impl Send for PackedScalar
impl Sync for PackedScalar
impl Unpin for PackedScalar
impl UnsafeUnpin for PackedScalar
impl UnwindSafe for PackedScalar
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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