Struct secp256k1::curve::Scalar[][src]

pub struct Scalar(pub [u32; 8]);

A 256-bit scalar value.

Implementations

impl Scalar[src]

pub fn clear(&mut self)[src]

Clear a scalar to prevent the leak of sensitive data.

pub fn set_int(&mut self, v: u32)[src]

Set a scalar to an unsigned integer.

pub fn from_int(v: u32) -> Self[src]

Create a scalar from an unsigned integer.

pub fn bits(&self, offset: usize, count: usize) -> u32[src]

Access bits from a scalar. All requested bits must belong to the same 32-bit limb.

pub fn bits_var(&self, offset: usize, count: usize) -> u32[src]

Access bits from a scalar. Not constant time.

pub fn cadd_bit(&mut self, bit: usize, flag: bool)[src]

Conditionally add a power of two to a scalar. The result is not allowed to overflow.

#[must_use]pub fn set_b32(&mut self, b32: &[u8; 32]) -> Choice[src]

Set a scalar from a big endian byte array, return whether it overflowed.

pub fn b32(&self) -> [u8; 32][src]

Convert a scalar to a byte array.

pub fn fill_b32(&self, bin: &mut [u8; 32])[src]

Convert a scalar to a byte array.

pub fn is_zero(&self) -> bool[src]

Check whether a scalar equals zero.

pub fn is_one(&self) -> bool[src]

Check whether a scalar equals one.

pub fn is_high(&self) -> bool[src]

Check whether a scalar is higher than the group order divided by 2.

pub fn cond_neg_assign(&mut self, flag: Choice)[src]

Conditionally negate a number, in constant time.

impl Scalar[src]

pub fn mul_in_place(&mut self, a: &Scalar, b: &Scalar)[src]

pub fn shr_int(&mut self, n: usize) -> u32[src]

Shift a scalar right by some amount strictly between 0 and 16, returning the low bits that were shifted off.

pub fn sqr_in_place(&mut self, a: &Scalar)[src]

pub fn sqr(&self) -> Scalar[src]

pub fn inv_in_place(&mut self, x: &Scalar)[src]

pub fn inv(&self) -> Scalar[src]

pub fn inv_var(&self) -> Scalar[src]

pub fn is_even(&self) -> bool[src]

Trait Implementations

impl<'a, 'b> Add<&'a Scalar> for &'b Scalar[src]

type Output = Scalar

The resulting type after applying the + operator.

impl Add<Scalar> for Scalar[src]

type Output = Scalar

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a Scalar> for Scalar[src]

impl AddAssign<Scalar> for Scalar[src]

impl Clone for Scalar[src]

impl Debug for Scalar[src]

impl Default for Scalar[src]

impl Drop for Scalar[src]

impl Eq for Scalar[src]

impl Into<Scalar> for SecretKey[src]

impl LowerHex for Scalar[src]

impl<'a, 'b> Mul<&'a Scalar> for &'b Scalar[src]

type Output = Scalar

The resulting type after applying the * operator.

impl Mul<Scalar> for Scalar[src]

type Output = Scalar

The resulting type after applying the * operator.

impl<'a> MulAssign<&'a Scalar> for Scalar[src]

impl MulAssign<Scalar> for Scalar[src]

impl Neg for Scalar[src]

type Output = Scalar

The resulting type after applying the - operator.

impl<'a> Neg for &'a Scalar[src]

type Output = Scalar

The resulting type after applying the - operator.

impl PartialEq<Scalar> for Scalar[src]

impl StructuralEq for Scalar[src]

impl StructuralPartialEq for Scalar[src]

impl TryFrom<Scalar> for SecretKey[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Scalar

impl Send for Scalar

impl Sync for Scalar

impl Unpin for Scalar

impl UnwindSafe for Scalar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]