Skip to content

Commit

Permalink
refactor: Implement partial review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
einar-taiko committed Aug 30, 2023
1 parent 95ce8c3 commit 93ef06b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/derive/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,21 @@ macro_rules! new_curve_impl {
let zz1 = p.zz;
let zzz1 = p.zzz;

// curve constants
const A: $base = $name_jac_ext::curve_constant_a();
debug_assert_eq!(A, $base::zero());

// intermediates
let u = y1.double();
let v = u.square();
let w = u*v;
let s = x1 * v;
let x1_sqr = x1.square();

// For the curves we use, the curve constant `a` is always zero,
// so we can leave out the last term.
let m = (x1_sqr.double()+x1_sqr); // + a*zz1.square();
// was: let m = x1_sqr.double()+x1_sqr + A*zz1.square();
let m = x1_sqr.double()+x1_sqr;

// p+p
let x3 = m.square() - s.double();
Expand Down

0 comments on commit 93ef06b

Please sign in to comment.