Struct BlindedScalar
pub struct BlindedScalar<C>where
C: CurveArithmetic,{ /* private fields */ }Expand description
Scalar blinded with a randomly generated masking value.
This provides a randomly blinded impl of Invert which is useful for
e.g. ECDSA ephemeral (k) scalars.
It implements masked variable-time inversions using Stein’s algorithm, which may be helpful for performance on embedded platforms.
Implementations§
§impl<C> BlindedScalar<C>where
C: CurveArithmetic,
impl<C> BlindedScalar<C>where
C: CurveArithmetic,
pub fn new(
scalar: <C as CurveArithmetic>::Scalar,
rng: &mut impl CryptoRngCore,
) -> BlindedScalar<C>
pub fn new( scalar: <C as CurveArithmetic>::Scalar, rng: &mut impl CryptoRngCore, ) -> BlindedScalar<C>
Create a new BlindedScalar from a scalar and a CryptoRngCore.
Trait Implementations§
§impl<C> AsRef<<C as CurveArithmetic>::Scalar> for BlindedScalar<C>where
C: CurveArithmetic,
impl<C> AsRef<<C as CurveArithmetic>::Scalar> for BlindedScalar<C>where
C: CurveArithmetic,
§fn as_ref(&self) -> &<C as CurveArithmetic>::Scalar
fn as_ref(&self) -> &<C as CurveArithmetic>::Scalar
Converts this type into a shared reference of the (usually inferred) input type.
§impl<C> Clone for BlindedScalar<C>where
C: Clone + CurveArithmetic,
impl<C> Clone for BlindedScalar<C>where
C: Clone + CurveArithmetic,
§fn clone(&self) -> BlindedScalar<C>
fn clone(&self) -> BlindedScalar<C>
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 more§impl<C> Drop for BlindedScalar<C>where
C: CurveArithmetic,
impl<C> Drop for BlindedScalar<C>where
C: CurveArithmetic,
§impl<C> Invert for BlindedScalar<C>where
C: CurveArithmetic,
impl<C> Invert for BlindedScalar<C>where
C: CurveArithmetic,
§type Output = CtOption<<C as CurveArithmetic>::Scalar>
type Output = CtOption<<C as CurveArithmetic>::Scalar>
Field element type
§fn invert(&self) -> CtOption<<C as CurveArithmetic>::Scalar>
fn invert(&self) -> CtOption<<C as CurveArithmetic>::Scalar>
Invert a field element.
§fn invert_vartime(&self) -> Self::Output
fn invert_vartime(&self) -> Self::Output
Invert a field element in variable time. Read more
Auto Trait Implementations§
impl<C> Freeze for BlindedScalar<C>
impl<C> RefUnwindSafe for BlindedScalar<C>
impl<C> Send for BlindedScalar<C>
impl<C> Sync for BlindedScalar<C>
impl<C> Unpin for BlindedScalar<C>
impl<C> UnwindSafe for BlindedScalar<C>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more