From 52904b5c3e24df648c041b26b2d01dc8fab1c6ef Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Fri, 26 Jan 2018 13:39:11 -0800 Subject: [PATCH] Use math for multiscalar docs --- src/ristretto.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ristretto.rs b/src/ristretto.rs index 3a2b528..24516f8 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -1045,8 +1045,11 @@ define_mul_variants!(LHS = RistrettoPoint, RHS = Scalar, Output = RistrettoPoint define_mul_variants!(LHS = Scalar, RHS = RistrettoPoint, Output = RistrettoPoint); -/// Given a vector of (possibly secret) scalars and a vector of -/// (possibly secret) points, compute `c_1 P_1 + ... + c_n P_n`. +/// Given an iterator of (possibly secret) scalars and an iterator of +/// (possibly secret) points, compute +/// $$ +/// Q = c\_1 P\_1 + \cdots + c\_n P\_n. +/// $$ /// /// This function has the same behaviour as /// `vartime::multiscalar_mult` but is constant-time. @@ -1161,15 +1164,16 @@ pub mod vartime { //! Variable-time operations on ristretto points, useful for non-secret data. use super::*; - /// Given a vector of public scalars and a vector of (possibly secret) + /// Given an iterable of public scalars and an iterable of public /// points, compute - /// - /// c_1 P_1 + ... + c_n P_n. + /// $$ + /// Q = c\_1 P\_1 + \cdots + c\_n P\_n. + /// $$ /// /// # Input /// - /// A vector of `Scalar`s and a vector of `RistrettoPoints`. It is an - /// error to call this function with two vectors of different lengths. + /// A iterable of `Scalar`s and a iterable of `RistrettoPoints`. It is an + /// error to call this function with two iterators of different lengths. #[cfg(any(feature = "alloc", feature = "std"))] pub fn multiscalar_mult<'a, 'b, I, J>(scalars: I, points: J) -> RistrettoPoint where I: IntoIterator,