[][src]Type Definition zerocaf::scalar::Scalar

type Scalar = Scalar;

A Scalar represents an element of the field generated by the prime of the sub-group: 2^249 - 15145038707218910765482344729778085401.

This is a type alias for one of the Scalar types in the backend module.

Methods

impl Scalar[src]

pub fn random<T>(rand: &mut T) -> Scalar where
    T: Rng + CryptoRng
[src]

Generate a valid Scalar choosen uniformly using user- provided rng.

By rng we mean any Rng that implements: Rng + CryptoRng.

Trait Implementations

impl ConstantTimeEq for Scalar[src]

fn ct_eq(&self, other: &Scalar) -> Choice[src]

Test equality between two Scalars. Since the internal representation is not canonical, the field elements are normalized to wire format before comparison.

impl Eq for Scalar[src]

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

type Output = RistrettoPoint

The resulting type after applying the * operator.

fn mul(self, point: &'b RistrettoPoint) -> RistrettoPoint[src]

Scalar multiplication: compute self * Scalar. This implementation uses the algorithm: add_and_doubling which is the standard one for this operations and also adds less constraints on R1CS.

Hankerson, Darrel; Vanstone, Scott; Menezes, Alfred (2004). Guide to Elliptic Curve Cryptography. Springer Professional Computing. New York: Springer-Verlag.

impl Mul<RistrettoPoint> for Scalar[src]

type Output = RistrettoPoint

The resulting type after applying the * operator.

fn mul(self, point: RistrettoPoint) -> RistrettoPoint[src]

Scalar multiplication: compute self * Scalar. This implementation uses the algorithm: add_and_doubling which is the standard one for this operations and also adds less constraints on R1CS.

Hankerson, Darrel; Vanstone, Scott; Menezes, Alfred (2004). Guide to Elliptic Curve Cryptography. Springer Professional Computing. New York: Springer-Verlag.

impl PartialEq<Scalar> for Scalar[src]