From d31d15e8ae63f16e08e7ad21faf9792877a2211a Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 10 Sep 2024 18:51:43 -0300 Subject: [PATCH] fix --- vlib/crypto/ed25519/internal/edwards25519/element.v | 2 +- vlib/crypto/ed25519/internal/edwards25519/extra.v | 2 +- vlib/crypto/ed25519/internal/edwards25519/point.v | 8 ++++---- vlib/crypto/ed25519/internal/edwards25519/table.v | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vlib/crypto/ed25519/internal/edwards25519/element.v b/vlib/crypto/ed25519/internal/edwards25519/element.v index 5f88a936df8fdc..3197e5edacfa33 100644 --- a/vlib/crypto/ed25519/internal/edwards25519/element.v +++ b/vlib/crypto/ed25519/internal/edwards25519/element.v @@ -538,7 +538,7 @@ pub fn (mut v Element) pow_22523(x Element) Element { for i := 1; i < 100; i++ { // 2^200 - 2^100 t2.square(t2) } - t1.multiply(t2, &t1) // 2^200 - 1 + t1.multiply(t2, t1) // 2^200 - 1 t1.square(t1) // 2^201 - 2 for i := 1; i < 50; i++ { // 2^250 - 2^50 t1.square(t1) diff --git a/vlib/crypto/ed25519/internal/edwards25519/extra.v b/vlib/crypto/ed25519/internal/edwards25519/extra.v index 4f171caa6c74b2..c68445f0453cca 100644 --- a/vlib/crypto/ed25519/internal/edwards25519/extra.v +++ b/vlib/crypto/ed25519/internal/edwards25519/extra.v @@ -108,7 +108,7 @@ fn (mut v Point) bytes_montgomery_generic(mut buf [32]u8) []u8 { mut u := Element{} y.multiply(v.y, y.invert(v.z)) // y = Y / Z - recip.invert(recip.subtract(fe_one, &y)) // r = 1/(1 - y) + recip.invert(recip.subtract(fe_one, y)) // r = 1/(1 - y) u.multiply(u.add(fe_one, y), recip) // u = (1 + y)*r return copy_field_element(mut buf, mut u) diff --git a/vlib/crypto/ed25519/internal/edwards25519/point.v b/vlib/crypto/ed25519/internal/edwards25519/point.v index 3b1f0775308da3..4661ed8c9b791e 100644 --- a/vlib/crypto/ed25519/internal/edwards25519/point.v +++ b/vlib/crypto/ed25519/internal/edwards25519/point.v @@ -353,8 +353,8 @@ fn (mut v ProjectiveP1) sub(p Point, q ProjectiveCached) ProjectiveP1 { ypx.add(p.y, p.x) ymx.subtract(p.y, p.x) - pp.multiply(&ypx, q.ymx) // flipped sign - mm.multiply(&ymx, q.ypx) // flipped sign + pp.multiply(ypx, q.ymx) // flipped sign + mm.multiply(ymx, q.ypx) // flipped sign tt2d.multiply(p.t, q.t2d) zz2.multiply(p.z, q.z) @@ -378,8 +378,8 @@ fn (mut v ProjectiveP1) add_affine(p Point, q AffineCached) ProjectiveP1 { ypx.add(p.y, p.x) ymx.subtract(p.y, p.x) - pp.multiply(&ypx, q.ypx) - mm.multiply(&ymx, q.ymx) + pp.multiply(ypx, q.ypx) + mm.multiply(ymx, q.ymx) tt2d.multiply(p.t, q.t2d) z2.add(p.z, p.z) diff --git a/vlib/crypto/ed25519/internal/edwards25519/table.v b/vlib/crypto/ed25519/internal/edwards25519/table.v index 8709b1f441667f..7131c2569de371 100644 --- a/vlib/crypto/ed25519/internal/edwards25519/table.v +++ b/vlib/crypto/ed25519/internal/edwards25519/table.v @@ -94,7 +94,7 @@ fn (mut v ProjLookupTable) select_into(mut dest ProjectiveCached, x i8) { for j := 1; j <= 8; j++ { // Set dest = j*Q if |x| = j cond := subtle.constant_time_byte_eq(xabs, u8(j)) - dest.selected(&v.points[j - 1], dest, cond) + dest.selected(v.points[j - 1], dest, cond) } // Now dest = |x|*Q, conditionally negate to get x*Q dest.cond_neg(int(xmask & 1))