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

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

A 256-bit scalar value.

Methods

impl Scalar
[src]

Clear a scalar to prevent the leak of sensitive data.

Set a scalar to an unsigned integer.

Create a scalar from an unsigned integer.

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

Access bits from a scalar. Not constant time.

Add two scalars together (modulo the group order). Returns whether it overflowed.

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

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

Convert a scalar to a byte array.

Convert a scalar to a byte array.

Check whether a scalar equals zero.

Compute the complement of a scalar (modulo the group order).

Check whether a scalar equals one.

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

Conditionally negate a number, in constant time. Returns -1 if the number was negated, 1 otherwise.

impl Scalar
[src]

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

Trait Implementations

impl PartialEq<Scalar> for Scalar
[src]

impl Eq for Scalar
[src]

impl Debug for Scalar
[src]

impl Add<Scalar> for Scalar
[src]

The resulting type after applying the + operator.

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

The resulting type after applying the + operator.

impl Mul<Scalar> for Scalar
[src]

The resulting type after applying the * operator.

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

The resulting type after applying the * operator.

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

impl AddAssign<Scalar> for Scalar
[src]

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

impl MulAssign<Scalar> for Scalar
[src]

impl Clone for Scalar
[src]

Performs copy-assignment from source. Read more

impl Default for Scalar
[src]

impl Into<Scalar> for SecretKey
[src]

Auto Trait Implementations

impl Send for Scalar

impl Sync for Scalar

Blanket Implementations

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T
[src]

Should always be Self