Skip to content

Commit

Permalink
mlkem: scheduling for formosa-crypto/formosa-mlkem#23
Browse files Browse the repository at this point in the history
  • Loading branch information
tfaoliveira committed Feb 9, 2024
1 parent dd63671 commit bb8569c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit bb8569c

Please sign in to comment.