group: Take scalar by reference in CurveProjective::recommended_wnaf_for_scalar

This commit is contained in:
Jack Grigg
2020-03-26 19:00:46 +13:00
parent 97c21e0c1a
commit 6e53cf3c4c
4 changed files with 6 additions and 6 deletions

View File

@@ -82,7 +82,7 @@ pub trait CurveProjective:
/// Recommends a wNAF window table size given a scalar. Always returns a number
/// between 2 and 22, inclusive.
fn recommended_wnaf_for_scalar(scalar: <Self::Scalar as PrimeField>::Repr) -> usize;
fn recommended_wnaf_for_scalar(scalar: &<Self::Scalar as PrimeField>::Repr) -> usize;
/// Recommends a wNAF window size given the number of scalars you intend to multiply
/// a base by. Always returns a number between 2 and 22, inclusive.

View File

@@ -115,7 +115,7 @@ impl<G: CurveProjective> Wnaf<(), Vec<G>, Vec<i64>> {
scalar: <<G as CurveProjective>::Scalar as PrimeField>::Repr,
) -> Wnaf<usize, &mut Vec<G>, &[i64]> {
// Compute the appropriate window size for the scalar.
let window_size = G::recommended_wnaf_for_scalar(scalar);
let window_size = G::recommended_wnaf_for_scalar(&scalar);
// Compute the wNAF form of the scalar.
wnaf_form(&mut self.scalar, scalar, window_size);