From: Chris Duncan Date: Wed, 21 Oct 2026 13:46:19 +0000 (-0700) Subject: Adders are more available than shifters. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=be39dce303b7acfa0f575340d9c4426e701f10e4;p=nano25519.git Adders are more available than shifters. --- diff --git a/src/assembly/ed25519/fe.ts b/src/assembly/ed25519/fe.ts index 416fc3a..dc03480 100644 --- a/src/assembly/ed25519/fe.ts +++ b/src/assembly/ed25519/fe.ts @@ -562,11 +562,11 @@ export function fe_mul_dual (h_a: FieldElement, f_a: FieldElement, g_a: FieldEle const g89: v128 = v128.shuffle(g_a_89xx, g_b_89xx, 0, 4, 1, 5) // factor of 19 for wrap from h9 to h0 - const g01_19: v128 = v128.add(g01, v128.add(v128.shl(g01, 1), v128.shl(g01, 4))) - const g23_19: v128 = v128.add(g23, v128.add(v128.shl(g23, 1), v128.shl(g23, 4))) - const g45_19: v128 = v128.add(g45, v128.add(v128.shl(g45, 1), v128.shl(g45, 4))) - const g67_19: v128 = v128.add(g67, v128.add(v128.shl(g67, 1), v128.shl(g67, 4))) - const g89_19: v128 = v128.add(g89, v128.add(v128.shl(g89, 1), v128.shl(g89, 4))) + const g01_19: v128 = v128.add(g01, v128.add(v128.add(g01, g01), v128.shl(g01, 4))) + const g23_19: v128 = v128.add(g23, v128.add(v128.add(g23, g23), v128.shl(g23, 4))) + const g45_19: v128 = v128.add(g45, v128.add(v128.add(g45, g45), v128.shl(g45, 4))) + const g67_19: v128 = v128.add(g67, v128.add(v128.add(g67, g67), v128.shl(g67, 4))) + const g89_19: v128 = v128.add(g89, v128.add(v128.add(g89, g89), v128.shl(g89, 4))) // f[0] let h0: v128 = v128.extmul_low(f0, g01)