Trait cry::primitive::scalar::ScalarNumber [−][src]
pub trait ScalarNumber: FromBytesRef + Bytes + Debug + Clone {
const SIZE: usize;
fn zero() -> Self;
fn one() -> Self;
fn invert(&self) -> Self;
fn reduce(&self) -> Self;
fn neg(&self) -> Self;
fn add(&self, _rhs: &Self) -> Self;
fn mul(&self, _rhs: &Self) -> Self;
fn sub(&self, _rhs: &Self) -> Self
where
Self: Sized,
{ ... }
}
Expand description
Scalar operator for this curve on finite finite $G_p$
Associated Constants
Required methods
Reduce a scalar by $p$ in $G_p$
Because scalar’s range in bytes always bigger than $p$,
to get a vaild scalar on $G_p$, use reduce
method.