Rename double_scalar_mult_basepoint to double_scalar_mul_basepoint for consistency

This commit is contained in:
Henry de Valence 2018-03-22 11:39:47 -07:00
parent 296cd16463
commit 70eee5208a
2 changed files with 8 additions and 8 deletions

View file

@ -550,7 +550,7 @@ pub mod vartime {
/// with x positive). /// with x positive).
/// ///
/// This is the same as calling the iterator-based function, but slightly faster. /// This is the same as calling the iterator-based function, but slightly faster.
pub fn double_scalar_mult_basepoint(a: &Scalar, pub fn double_scalar_mul_basepoint(a: &Scalar,
A: &edwards::EdwardsPoint, A: &edwards::EdwardsPoint,
b: &Scalar) -> edwards::EdwardsPoint { b: &Scalar) -> edwards::EdwardsPoint {
let a_naf = a.non_adjacent_form(); let a_naf = a.non_adjacent_form();
@ -1019,7 +1019,7 @@ mod bench {
let s2 = Scalar::random(&mut csprng); let s2 = Scalar::random(&mut csprng);
let P = &s1 * &constants::ED25519_BASEPOINT_TABLE; let P = &s1 * &constants::ED25519_BASEPOINT_TABLE;
b.iter(|| vartime::double_scalar_mult_basepoint(&s2, &P, &s1) ); b.iter(|| vartime::double_scalar_mul_basepoint(&s2, &P, &s1) );
} }
#[bench] #[bench]

View file

@ -994,7 +994,7 @@ pub mod vartime {
/// \\(aA+bB\\), where \\(B\\) is the Ed25519 basepoint (i.e., \\(B = (x,4/5)\\) /// \\(aA+bB\\), where \\(B\\) is the Ed25519 basepoint (i.e., \\(B = (x,4/5)\\)
/// with x positive). /// with x positive).
#[cfg(feature="precomputed_tables")] #[cfg(feature="precomputed_tables")]
pub fn double_scalar_mult_basepoint( pub fn double_scalar_mul_basepoint(
a: &Scalar, a: &Scalar,
A: &EdwardsPoint, A: &EdwardsPoint,
b: &Scalar, b: &Scalar,
@ -1003,7 +1003,7 @@ pub mod vartime {
#[cfg(all(feature="nightly", all(feature="avx2_backend", target_feature="avx2")))] { #[cfg(all(feature="nightly", all(feature="avx2_backend", target_feature="avx2")))] {
use backend::avx2::edwards as edwards_avx2; use backend::avx2::edwards as edwards_avx2;
edwards_avx2::vartime::double_scalar_mult_basepoint(a, A, b) edwards_avx2::vartime::double_scalar_mul_basepoint(a, A, b)
} }
// Otherwise, proceed as normal: // Otherwise, proceed as normal:
#[cfg(not(all(feature="nightly", all(feature="avx2_backend", target_feature="avx2"))))] { #[cfg(not(all(feature="nightly", all(feature="avx2_backend", target_feature="avx2"))))] {
@ -1356,9 +1356,9 @@ mod test {
/// Test double_scalar_mult_vartime vs ed25519.py /// Test double_scalar_mult_vartime vs ed25519.py
#[test] #[test]
#[cfg(feature="precomputed_tables")] #[cfg(feature="precomputed_tables")]
fn double_scalar_mult_basepoint_vs_ed25519py() { fn double_scalar_mul_basepoint_vs_ed25519py() {
let A = A_TIMES_BASEPOINT.decompress().unwrap(); let A = A_TIMES_BASEPOINT.decompress().unwrap();
let result = vartime::double_scalar_mult_basepoint(&A_SCALAR, &A, &B_SCALAR); let result = vartime::double_scalar_mul_basepoint(&A_SCALAR, &A, &B_SCALAR);
assert_eq!(result.compress(), DOUBLE_SCALAR_MULT_RESULT); assert_eq!(result.compress(), DOUBLE_SCALAR_MULT_RESULT);
} }
@ -1535,9 +1535,9 @@ mod bench {
use super::{Bencher, OsRng}; use super::{Bencher, OsRng};
#[bench] #[bench]
fn bench_double_scalar_mult_basepoint(b: &mut Bencher) { fn bench_double_scalar_mul_basepoint(b: &mut Bencher) {
let A = A_TIMES_BASEPOINT.decompress().unwrap(); let A = A_TIMES_BASEPOINT.decompress().unwrap();
b.iter(|| vartime::double_scalar_mult_basepoint(&A_SCALAR, &A, &B_SCALAR)); b.iter(|| vartime::double_scalar_mul_basepoint(&A_SCALAR, &A, &B_SCALAR));
} }
#[bench] #[bench]