Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7ff2591 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge "rootcanal/ec: Use pow for consistency" into main

parents d9f72a10 c4c087b5
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -377,11 +377,10 @@ where
                    let h = &u2 - &u1;
                    let r = &s2 - &s1;

                    let h2 = (&h * &h) % p;
                    let h3 = (&h * &h2) % p;
                    let u1h2 = (&u1 * &h2) % p;
                    let h3 = h.pow(3) % p;
                    let u1h2 = (u1 * h.pow(2)) % p;
                    let x3 = r.pow(2) - &h3 - 2 * &u1h2;
                    let y3 = r * (&u1h2 - &x3) - s1 * &h3;
                    let y3 = r * (u1h2 - &x3) - s1 * h3;
                    let z3 = h * z1 * z2;

                    Point::new(x3 % p, y3 % p, z3 % p)