Struct secp256k1::curve::Scalar [−][src]
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.
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][+]
impl Add<Scalar> for Scalar
[src][+]
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][+]
impl Mul<Scalar> for Scalar
[src][+]
impl<'a> MulAssign<&'a Scalar> for Scalar
[src][+]
impl MulAssign<Scalar> for Scalar
[src][+]
impl Neg for Scalar
[src][+]
impl<'a> Neg for &'a Scalar
[src][+]
impl PartialEq<Scalar> for Scalar
[src][+]
impl StructuralEq for Scalar
[src]
impl StructuralPartialEq for Scalar
[src]
impl TryFrom<Scalar> for SecretKey
[src][+]
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][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,