pub struct Radix16Decomposition<Digits: ArraySize> {
digits: Array<i8, Digits>,
}Expand description
Signed radix-16 decomposition of a scalar.
Fields§
§digits: Array<i8, Digits>Implementations§
Source§impl<Digits: ArraySize> Radix16Decomposition<Digits>
impl<Digits: ArraySize> Radix16Decomposition<Digits>
Sourcepub fn new<Scalar: PrimeFieldExt>(scalar: &Scalar) -> Self
pub fn new<Scalar: PrimeFieldExt>(scalar: &Scalar) -> Self
Decompose a scalar into signed radix-16 digits.
Produces [a_0, ..., a_{digits-1}] such that scalar = sum(a_j * 16^j) and each a_j is
within [-8, 8].
a_0 is the least significant position; a_{digits-1} absorbs carry: the resulting
decomposition can be negative, so we need an additional byte to store it.
Assumes x < 2^(4*(digits-1)).
Trait Implementations§
Source§impl<Digits: Clone + ArraySize> Clone for Radix16Decomposition<Digits>
impl<Digits: Clone + ArraySize> Clone for Radix16Decomposition<Digits>
Source§fn clone(&self) -> Radix16Decomposition<Digits>
fn clone(&self) -> Radix16Decomposition<Digits>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<Digits> Freeze for Radix16Decomposition<Digits>
impl<Digits> RefUnwindSafe for Radix16Decomposition<Digits>
impl<Digits> Send for Radix16Decomposition<Digits>
impl<Digits> Sync for Radix16Decomposition<Digits>
impl<Digits> Unpin for Radix16Decomposition<Digits>
impl<Digits> UnsafeUnpin for Radix16Decomposition<Digits>
impl<Digits> UnwindSafe for Radix16Decomposition<Digits>
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