mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-08 21:00:40 +00:00
cleaner name per Henry’s suggestion
This commit is contained in:
parent
ca2926ac89
commit
9836d6622c
3 changed files with 4 additions and 4 deletions
|
|
@ -94,7 +94,7 @@ impl VartimeMultiscalarMul for Pippenger {
|
||||||
// (scanning the whole set per digit position).
|
// (scanning the whole set per digit position).
|
||||||
let scalars = scalars
|
let scalars = scalars
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|s| s.borrow().to_pippenger_radix(w).0);
|
.map(|s| s.borrow().to_radix_2w(w).0);
|
||||||
|
|
||||||
let points = points
|
let points = points
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ impl VartimeMultiscalarMul for Pippenger {
|
||||||
// (scanning the whole collection per each digit position).
|
// (scanning the whole collection per each digit position).
|
||||||
let scalars = scalars
|
let scalars = scalars
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|s| s.borrow().to_pippenger_radix(w).0);
|
.map(|s| s.borrow().to_radix_2w(w).0);
|
||||||
|
|
||||||
let points = points
|
let points = points
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
||||||
|
|
@ -979,7 +979,7 @@ impl Scalar {
|
||||||
/// $$
|
/// $$
|
||||||
/// with \\(-2\^w/2 \leq a_i < 2\^w/2\\) for \\(0 \leq i < (n-1)\\) and \\(-2\^w/2 \leq a_{n-1} \leq 2\^w/2\\).
|
/// with \\(-2\^w/2 \leq a_i < 2\^w/2\\) for \\(0 \leq i < (n-1)\\) and \\(-2\^w/2 \leq a_{n-1} \leq 2\^w/2\\).
|
||||||
///
|
///
|
||||||
pub(crate) fn to_pippenger_radix(&self, w: usize) -> ([i8; 43], usize) {
|
pub(crate) fn to_radix_2w(&self, w: usize) -> ([i8; 43], usize) {
|
||||||
debug_assert!(w >= 6);
|
debug_assert!(w >= 6);
|
||||||
debug_assert!(w <= 8);
|
debug_assert!(w <= 8);
|
||||||
|
|
||||||
|
|
@ -1519,7 +1519,7 @@ mod test {
|
||||||
// from the produced representation precisely.
|
// from the produced representation precisely.
|
||||||
for w in 6..9 {
|
for w in 6..9 {
|
||||||
for scalar in (2..100).map(|s| Scalar::from(s as u64).invert() ).chain(iter::once(-Scalar::one())) {
|
for scalar in (2..100).map(|s| Scalar::from(s as u64).invert() ).chain(iter::once(-Scalar::one())) {
|
||||||
let (digits, digits_count) = scalar.to_pippenger_radix(w);
|
let (digits, digits_count) = scalar.to_radix_2w(w);
|
||||||
|
|
||||||
let radix = Scalar::from((1<<w) as u64);
|
let radix = Scalar::from((1<<w) as u64);
|
||||||
let mut term = Scalar::one();
|
let mut term = Scalar::one();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue