Struct libsecp256k1_rs::secp256k1::Scalar[][src]

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.

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.

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 Into<Scalar> for SecretKey
[src]

Performs the conversion.

impl Debug for Scalar
[src]

Formats the value using the given formatter. Read more

impl Clone for Scalar
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Scalar
[src]

impl Eq for Scalar
[src]

impl PartialEq for Scalar
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Scalar
[src]

Returns the "default value" for a type. Read more

impl Add<Scalar> for Scalar
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Neg for Scalar
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

Performs the += operation.

impl AddAssign<Scalar> for Scalar
[src]

Performs the += operation.

impl Mul<Scalar> for Scalar
[src]

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

Performs the *= operation.

impl MulAssign<Scalar> for Scalar
[src]

Performs the *= operation.

Auto Trait Implementations

impl Send for Scalar

impl Sync for Scalar