Browse Source

Fix dangling batch normalization for twisted Edwards curves (#102)

* push

debug

see if gens are broken

see if we can find why

test

copy

copy

normalize-batch

remove debug

remove debug

remove debug

make it similar

* consistency

* type

Co-authored-by: onewayfunc <onewayfunc@gmail.com>
master
Weikeng Chen 2 years ago
committed by GitHub
parent
commit
2416780e0f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/groups/curves/twisted_edwards/mod.rs

+ 2
- 2
src/groups/curves/twisted_edwards/mod.rs

@ -540,9 +540,9 @@ where
let zero: TEAffine<P> = TEProjective::zero().into_affine(); let zero: TEAffine<P> = TEProjective::zero().into_affine();
for (bits, multiples) in bits.chunks(2).zip(multiples.chunks(2)) { for (bits, multiples) in bits.chunks(2).zip(multiples.chunks(2)) {
if bits.len() == 2 { if bits.len() == 2 {
let mut table = [multiples[0], multiples[1], multiples[0] + multiples[1]];
let table_projective = [multiples[0], multiples[1], multiples[0] + multiples[1]];
TEProjective::normalize_batch(&mut table);
let table = TEProjective::normalize_batch(&table_projective);
let x_s = [zero.x, table[0].x, table[1].x, table[2].x]; let x_s = [zero.x, table[0].x, table[1].x, table[2].x];
let y_s = [zero.y, table[0].y, table[1].y, table[2].y]; let y_s = [zero.y, table[0].y, table[1].y, table[2].y];

Loading…
Cancel
Save