From 1b2fadc9e7fdc4324e4041438cb552e303294da6 Mon Sep 17 00:00:00 2001 From: Tiago Oliveira Date: Wed, 7 Feb 2024 01:38:49 +0100 Subject: [PATCH] mlkem: poly.jinc update from https://github.com/formosa-crypto/hakyber/pull/15 --- src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc b/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc index ee751dad..2f0b7901 100644 --- a/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc +++ b/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc @@ -54,7 +54,7 @@ fn _poly_basemul(reg ptr u16[MLKEM_N] rp, reg const ptr u16[MLKEM_N] ap bp) -> r reg u16 b0; reg u16 b1; reg u16 t; - reg ptr u16[128] zetasp; + reg ptr u16[64] zetasp; reg u64 zetasctr; reg u64 i; @@ -62,14 +62,14 @@ fn _poly_basemul(reg ptr u16[MLKEM_N] rp, reg const ptr u16[MLKEM_N] ap bp) -> r srp = rp; - zetasctr = 64; i = 0; - while(i < MLKEM_N) + while(i < MLKEM_N - 3) { - zetasp = jzetas; - zeta = zetasp[(int)zetasctr]; - zetasctr += 1; + zetasp = jzetas[64:64]; + zetasctr = i; + zetasctr >>= 2; + zeta = zetasp[zetasctr]; a0 = ap[(int)i]; b0 = bp[(int)i];