From bb8569c01597338148800210de5aa2b512f783c6 Mon Sep 17 00:00:00 2001 From: Tiago Oliveira Date: Fri, 9 Feb 2024 16:02:37 +0000 Subject: [PATCH] mlkem: scheduling for https://github.com/formosa-crypto/hakyber/pull/23 --- src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc b/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc index 171a5ddb..fade03c8 100644 --- a/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc +++ b/src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc @@ -141,7 +141,6 @@ fn __poly_reduce(reg ptr u16[MLKEM_N] rp) -> reg ptr u16[MLKEM_N] 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; @@ -150,15 +149,13 @@ fn _poly_compress(reg u64 rp, reg ptr u16[MLKEM_N] a) -> reg ptr u16[MLKEM_N] i = 0; while(i < 128) { - t = a[2 * i]; - d0 = (32u)t; + d0 = (32u) a[2 * i]; + d1 = (32u) a[2 * i + 1]; d0 <<= 4; d0 += 1665; d0 *= 80635; d0 >>= 28; d0 &= 0xf; - t = a[2 * i + 1]; - d1 = (32u)t; d1 <<= 4; d1 += 1665; d1 *= 80635; @@ -174,7 +171,6 @@ fn _poly_compress(reg u64 rp, reg ptr u16[MLKEM_N] a) -> reg ptr u16[MLKEM_N] fn _i_poly_compress(reg ptr u8[MLKEM_POLYCOMPRESSEDBYTES] rp, reg ptr u16[MLKEM_N] a) -> reg ptr u8[MLKEM_POLYCOMPRESSEDBYTES], reg ptr u16[MLKEM_N] { - reg u16 t; reg u32 d0, d1; reg u64 i; @@ -183,15 +179,13 @@ fn _i_poly_compress(reg ptr u8[MLKEM_POLYCOMPRESSEDBYTES] rp, reg ptr u16[MLKEM_ i = 0; while(i < 128) { - t = a[2 * i]; - d0 = (32u)t; + d0 = (32u) a[2 * i]; + d1 = (32u) a[2 * i + 1]; d0 <<= 4; d0 += 1665; d0 *= 80635; d0 >>= 28; d0 &= 0xf; - t = a[2 * i + 1]; - d1 = (32u)t; d1 <<= 4; d1 += 1665; d1 *= 80635;