pub struct RustCryptoScalar<E: CurveArithmetic>(pub E::Scalar);Available on crate feature
rust-crypto only.Expand description
Scalar wrapper
Tuple Fields§
§0: E::ScalarTrait Implementations§
Source§impl<E: CurveArithmetic> Additive for RustCryptoScalar<E>
impl<E: CurveArithmetic> Additive for RustCryptoScalar<E>
Source§impl<E: CurveArithmetic> Clone for RustCryptoScalar<E>
impl<E: CurveArithmetic> Clone for RustCryptoScalar<E>
Source§impl<E> ConditionallySelectable for RustCryptoScalar<E>
impl<E> ConditionallySelectable for RustCryptoScalar<E>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<E> ConstantTimeEq for RustCryptoScalar<E>
impl<E> ConstantTimeEq for RustCryptoScalar<E>
Source§impl<E: CurveArithmetic> Default for RustCryptoScalar<E>
impl<E: CurveArithmetic> Default for RustCryptoScalar<E>
Source§impl<E: CurveArithmetic + Curve> IntegerEncoding for RustCryptoScalar<E>
impl<E: CurveArithmetic + Curve> IntegerEncoding for RustCryptoScalar<E>
Source§type Bytes = GenericArray<u8, <<E as Curve>::Uint as ArrayEncoding>::ByteSize>
type Bytes = GenericArray<u8, <<E as Curve>::Uint as ArrayEncoding>::ByteSize>
Byte array that fits the whole encoded integer
Source§fn to_be_bytes(&self) -> Self::Bytes
fn to_be_bytes(&self) -> Self::Bytes
Encodes integer as bytes in big-endian byte order
Source§fn to_le_bytes(&self) -> Self::Bytes
fn to_le_bytes(&self) -> Self::Bytes
Encodes integer as bytes in little-endian byte order
Source§fn from_be_bytes_exact(bytes: &Self::Bytes) -> Option<Self>
fn from_be_bytes_exact(bytes: &Self::Bytes) -> Option<Self>
Decodes integer encoded as bytes in big-endian bytes order Read more
Source§fn from_le_bytes_exact(bytes: &Self::Bytes) -> Option<Self>
fn from_le_bytes_exact(bytes: &Self::Bytes) -> Option<Self>
Decodes integer encoded as bytes in little-endian bytes order Read more
Source§fn from_be_bytes_mod_order(bytes: &[u8]) -> Self
fn from_be_bytes_mod_order(bytes: &[u8]) -> Self
Interprets
bytes as big-endian encoding of an integer. Returns integer mod curve (prime) order.Source§fn from_le_bytes_mod_order(bytes: &[u8]) -> Self
fn from_le_bytes_mod_order(bytes: &[u8]) -> Self
Interprets
bytes as little-endian encoding of an integer. Returns integer mod curve (prime) order.Source§impl<E: CurveArithmetic> Invertible for RustCryptoScalar<E>
impl<E: CurveArithmetic> Invertible for RustCryptoScalar<E>
Source§impl<E> Multiplicative<CurveGenerator> for RustCryptoScalar<E>where
E: CurveArithmetic,
for<'a> &'a E::ProjectivePoint: Mul<&'a E::Scalar, Output = E::ProjectivePoint>,
impl<E> Multiplicative<CurveGenerator> for RustCryptoScalar<E>where
E: CurveArithmetic,
for<'a> &'a E::ProjectivePoint: Mul<&'a E::Scalar, Output = E::ProjectivePoint>,
Source§type Output = RustCryptoPoint<E>
type Output = RustCryptoPoint<E>
Type of multiplication output
Source§fn mul(a: &Self, _b: &CurveGenerator) -> Self::Output
fn mul(a: &Self, _b: &CurveGenerator) -> Self::Output
Computes
a * bSource§impl<E> Multiplicative<RustCryptoPoint<E>> for RustCryptoScalar<E>where
E: CurveArithmetic,
for<'a> &'a E::ProjectivePoint: Mul<&'a E::Scalar, Output = E::ProjectivePoint>,
impl<E> Multiplicative<RustCryptoPoint<E>> for RustCryptoScalar<E>where
E: CurveArithmetic,
for<'a> &'a E::ProjectivePoint: Mul<&'a E::Scalar, Output = E::ProjectivePoint>,
Source§type Output = RustCryptoPoint<E>
type Output = RustCryptoPoint<E>
Type of multiplication output
Source§fn mul(a: &Self, b: &RustCryptoPoint<E>) -> Self::Output
fn mul(a: &Self, b: &RustCryptoPoint<E>) -> Self::Output
Computes
a * bSource§impl<E: CurveArithmetic> Multiplicative<RustCryptoScalar<E>> for RustCryptoScalar<E>
impl<E: CurveArithmetic> Multiplicative<RustCryptoScalar<E>> for RustCryptoScalar<E>
Source§type Output = RustCryptoScalar<E>
type Output = RustCryptoScalar<E>
Type of multiplication output
Source§fn mul(a: &Self, b: &RustCryptoScalar<E>) -> Self::Output
fn mul(a: &Self, b: &RustCryptoScalar<E>) -> Self::Output
Computes
a * bSource§impl<E: CurveArithmetic> One for RustCryptoScalar<E>
impl<E: CurveArithmetic> One for RustCryptoScalar<E>
Source§impl<E> PartialEq for RustCryptoScalar<E>
impl<E> PartialEq for RustCryptoScalar<E>
Source§impl<E: CurveArithmetic + Curve> Reduce<32> for RustCryptoScalar<E>
impl<E: CurveArithmetic + Curve> Reduce<32> for RustCryptoScalar<E>
Source§fn from_be_array_mod_order(bytes: &[u8; 32]) -> Self
fn from_be_array_mod_order(bytes: &[u8; 32]) -> Self
Interprets
bytes as big-endian encoding of an integer, returns this
integer modulo curve (prime) orderSource§fn from_le_array_mod_order(bytes: &[u8; 32]) -> Self
fn from_le_array_mod_order(bytes: &[u8; 32]) -> Self
Interprets
bytes as little-endian encoding of an integer, returns this
integer modulo curve (prime) orderSource§impl<E: CurveArithmetic + Curve> Reduce<64> for RustCryptoScalar<E>
impl<E: CurveArithmetic + Curve> Reduce<64> for RustCryptoScalar<E>
Source§fn from_be_array_mod_order(bytes: &[u8; 64]) -> Self
fn from_be_array_mod_order(bytes: &[u8; 64]) -> Self
Interprets
bytes as big-endian encoding of an integer, returns this
integer modulo curve (prime) orderSource§fn from_le_array_mod_order(bytes: &[u8; 64]) -> Self
fn from_le_array_mod_order(bytes: &[u8; 64]) -> Self
Interprets
bytes as little-endian encoding of an integer, returns this
integer modulo curve (prime) orderSource§impl<E: CurveArithmetic> Samplable for RustCryptoScalar<E>
impl<E: CurveArithmetic> Samplable for RustCryptoScalar<E>
Source§impl<E: CurveArithmetic> Zero for RustCryptoScalar<E>
impl<E: CurveArithmetic> Zero for RustCryptoScalar<E>
impl<E: CurveArithmetic> Copy for RustCryptoScalar<E>
impl<E> DefaultIsZeroes for RustCryptoScalar<E>
impl<E> Eq for RustCryptoScalar<E>
Auto Trait Implementations§
impl<E> Freeze for RustCryptoScalar<E>
impl<E> RefUnwindSafe for RustCryptoScalar<E>
impl<E> Send for RustCryptoScalar<E>
impl<E> Sync for RustCryptoScalar<E>
impl<E> Unpin for RustCryptoScalar<E>
impl<E> UnwindSafe for RustCryptoScalar<E>
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