Skip to main content

Block128

Struct Block128 

Source
#[repr(transparent)]
pub struct Block128(pub u128);

Tuple Fields§

§0: u128

Implementations§

Source§

impl Block128

Source

pub fn new(lo: Block64, hi: Block64) -> Self

Source

pub fn split(self) -> (Block64, Block64)

Trait Implementations§

Source§

impl Add for Block128

Source§

type Output = Block128

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl AddAssign for Block128

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl CanonicalDeserialize for Block128

Source§

fn deserialize(bytes: &[u8]) -> Result<Self, ()>

Deserializes from a buffer. Returns Err if buffer is too short.
Source§

impl CanonicalSerialize for Block128

Source§

fn serialized_size(&self) -> usize

Returns the size in bytes.
Source§

fn serialize(&self, writer: &mut [u8]) -> Result<(), ()>

Serializes the element into a buffer. Returns error if buffer is too small.
Source§

fn to_bytes(&self) -> Vec<u8>

Convenience method: returns a Vec.
Source§

impl Clone for Block128

Source§

fn clone(&self) -> Block128

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Block128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Block128

Source§

fn default() -> Block128

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Block128

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FlatPromote<Block16> for Block128

Available on non-crate feature table-math only.
Source§

fn promote_flat(val: Flat<Block16>) -> Flat<Self>

Source§

fn promote_flat_batch(input: &[Flat<Block16>], output: &mut [Flat<Self>])

Batch promote a slice of flat elements. Read more
Source§

impl FlatPromote<Block32> for Block128

Available on non-crate feature table-math only.
Source§

fn promote_flat(val: Flat<Block32>) -> Flat<Self>

Source§

fn promote_flat_batch(input: &[Flat<Block32>], output: &mut [Flat<Self>])

Batch promote a slice of flat elements. Read more
Source§

impl FlatPromote<Block64> for Block128

Available on non-crate feature table-math only.
Source§

fn promote_flat(val: Flat<Block64>) -> Flat<Self>

Source§

fn promote_flat_batch(input: &[Flat<FromF>], output: &mut [Flat<Self>])

Batch promote a slice of flat elements. Read more
Source§

impl FlatPromote<Block8> for Block128

Available on non-crate feature table-math only.
Source§

fn promote_flat(val: Flat<Block8>) -> Flat<Self>

Source§

fn promote_flat_batch(input: &[Flat<Block8>], output: &mut [Flat<Self>])

Batch promote a slice of flat elements. Read more
Source§

impl From<Bit> for Block128

Source§

fn from(val: Bit) -> Self

Converts to this type from the input type.
Source§

impl From<Block16> for Block128

Source§

fn from(val: Block16) -> Self

Converts to this type from the input type.
Source§

impl From<Block32> for Block128

Source§

fn from(val: Block32) -> Self

Converts to this type from the input type.
Source§

impl From<Block64> for Block128

Source§

fn from(val: Block64) -> Self

Converts to this type from the input type.
Source§

impl From<Block8> for Block128

Source§

fn from(val: Block8) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Block128

Source§

fn from(val: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Block128

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Block128

Source§

fn from(val: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Block128

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.
Source§

impl HardwareField for Block128

Source§

fn to_hardware(self) -> Flat<Self>

Convert standard Tower element to hardware basis (Isomorphic).
Source§

fn from_hardware(value: Flat<Self>) -> Self

Convert hardware element back to Tower basis.
Source§

fn add_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>

Sum two elements assuming they are already in hardware basis.
Source§

fn add_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>

Sum packed vectors in hardware basis.
Source§

fn mul_hardware(lhs: Flat<Self>, rhs: Flat<Self>) -> Flat<Self>

Multiply two elements assuming they are already in hardware basis.
Source§

fn mul_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>

Multiply packed vectors in hardware basis.
Source§

fn mul_hardware_scalar_packed( lhs: PackedFlat<Self>, rhs: Flat<Self>, ) -> PackedFlat<Self>

Multiply packed vectors by a scalar in hardware basis.
Source§

fn tower_bit_from_hardware(value: Flat<Self>, bit_idx: usize) -> u8

Extracts the bit_idx bit of the canonical Tower representation directly from the Hardware (Flat) representation without a full basis conversion. Strictly constant time.
Source§

impl Mul<Block128> for PackedBlock128

Source§

type Output = PackedBlock128

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Block128) -> Self

Performs the * operation. Read more
Source§

impl Mul for Block128

Source§

type Output = Block128

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl MulAssign<Block128> for PackedBlock128

Source§

fn mul_assign(&mut self, rhs: Block128)

Performs the *= operation. Read more
Source§

impl MulAssign for Block128

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl PackableField for Block128

Source§

const WIDTH: usize = PACKED_WIDTH_128

How many elements fit in one packed vector.
Source§

type Packed = PackedBlock128

The packed vector type (e.g., PackedBlock128).
Source§

fn pack(chunk: &[Self]) -> Self::Packed

Pack a slice of scalars into a vector. Panics if slice len < WIDTH.
Source§

fn unpack(packed: Self::Packed, output: &mut [Self])

Unpack vector back to scalars.
Source§

impl PartialEq for Block128

Source§

fn eq(&self, other: &Block128) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Block128

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub for Block128

Source§

type Output = Block128

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl SubAssign for Block128

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl TowerField for Block128

Source§

const BITS: usize = 128

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const EXTENSION_TAU: Self = Self::TAU

The constant TAU needed to extend this field to the next level. If we are in F, then the next field F’ is constructed as F[X] / (X^2 + X + EXTENSION_TAU).
Source§

fn invert(&self) -> Self

Returns the multiplicative inverse of the element. By cryptographic convention, the inverse of 0 is defined as 0 to ensure constant-time execution without branching.
Source§

fn from_uniform_bytes(bytes: &[u8; 32]) -> Self

Constructs a field element from uniform bytes (e.g. hash output). Used for PRNG / Blinding. Read more
Source§

impl Zeroize for Block128

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl Copy for Block128

Source§

impl Eq for Block128

Source§

impl StructuralPartialEq for Block128

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F> FlatPromote<F> for F
where F: HardwareField,

Source§

fn promote_flat(val: Flat<F>) -> Flat<F>

Source§

fn promote_flat_batch(input: &[Flat<FromF>], output: &mut [Flat<Self>])

Batch promote a slice of flat elements. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,