From b33e80e4ab3e2d6fca8c8ab42a317d254e948f8b Mon Sep 17 00:00:00 2001 From: Tiago Oliveira Date: Fri, 9 Feb 2024 13:37:40 +0100 Subject: [PATCH] mlkem: poly.jinc update from https://github.com/formosa-crypto/hakyber/pull/21 --- src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc | 9 +++------ 1 file changed, 3 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 62ac2a65..ca421d99 100644 --- a/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc +++ b/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc @@ -144,23 +144,21 @@ fn _poly_compress(reg u64 rp, reg ptr u16[MLKEM_N] a) -> reg ptr u16[MLKEM_N] { reg u16 t; reg u32 d0, d1; - reg u64 i j; + reg u64 i; a = _poly_csubq(a); i = 0; - j = 0; while(i < 128) { - t = a[(int)j]; + t = a[2 * i]; d0 = (32u)t; d0 <<= 4; d0 += 1665; d0 *= 80635; d0 >>= 28; d0 &= 0xf; - j += 1; - t = a[(int)j]; + t = a[2 * i + 1]; d1 = (32u)t; d1 <<= 4; d1 += 1665; @@ -171,7 +169,6 @@ fn _poly_compress(reg u64 rp, reg ptr u16[MLKEM_N] a) -> reg ptr u16[MLKEM_N] d0 |= d1; (u8)[rp+i] = d0; i += 1; - j += 1; } return a; }