From c99bd62b255636a91eccd08cbb94237cf363c55d Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Tue, 27 Mar 2018 15:10:04 -0700 Subject: [PATCH] Add example to RistrettoBasepointTable --- src/ristretto.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ristretto.rs b/src/ristretto.rs index 4f4a703..6cd7301 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -832,6 +832,16 @@ pub fn multiscalar_mul(scalars: I, points: J) -> RistrettoPoint /// A precomputed table of multiples of a basepoint, used to accelerate /// scalar multiplication. +/// +/// A precomputed table of multiples of the Ristretto basepoint is +/// available in the `constants` module: +/// ``` +/// use curve25519_dalek::constants; +/// use curve25519_dalek::scalar::Scalar; +/// +/// let a = Scalar::from_u64(87329482); +/// let P = &a * &constants::RISTRETTO_BASEPOINT_TABLE; +/// ``` #[derive(Clone)] pub struct RistrettoBasepointTable(pub(crate) EdwardsBasepointTable);