From bf1aef4fbcb994823dd7b42de2c31c4525ad3b0b Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 26 Oct 2026 13:03:56 -0700 Subject: [PATCH] High bits of h are zero after carry, so scrap the extra lanes. --- src/assembly/ed25519/fep.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assembly/ed25519/fep.ts b/src/assembly/ed25519/fep.ts index 0238494..6b0d10c 100644 --- a/src/assembly/ed25519/fep.ts +++ b/src/assembly/ed25519/fep.ts @@ -994,11 +994,11 @@ export function fep_mul_lane (h: FieldElementPair, f: FieldElementPair, g: Field h1 += carry0 // reduce i64x2 to i32x4 now that high bits are zero and low bits fit into i32 - h01 = i32x4(h0, 0, h1, 0) - h23 = i32x4(h2, 0, h3, 0) - h45 = i32x4(h4, 0, h5, 0) - h67 = i32x4(h6, 0, h7, 0) - h89 = i32x4(h8, 0, h9, 0) + h01 = i64x2(h0, h1) + h23 = i64x2(h2, h3) + h45 = i64x2(h4, h5) + h67 = i64x2(h6, h7) + h89 = i64x2(h8, h9) // assign results to output v128.store(changetype(h), v128.shuffle(h01, f01, 0, 5, 2, 7), 0 << 4) // h0, f0, h1, f1 -- 2.52.0