Skip to content

Commit

Permalink
mlkem: poly.jinc update from formosa-crypto/formosa-mlkem#20
Browse files Browse the repository at this point in the history
  • Loading branch information
tfaoliveira committed Feb 9, 2024
1 parent b33e80e commit e9f1d69
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ fn _poly_getnoise(reg ptr u16[MLKEM_N] rp, reg ptr u8[MLKEM_SYMBYTES] seed, reg
reg u64 outlen;
reg u8 c,a,b;
reg u16 t;
reg u64 i j;
reg u64 i;
inline int k;

stack ptr u16[MLKEM_N] srp;
Expand All @@ -439,9 +439,8 @@ fn _poly_getnoise(reg ptr u16[MLKEM_N] rp, reg ptr u8[MLKEM_SYMBYTES] seed, reg
rp = srp;

i = 0;
j = 0;
while (i < 128) {
c = buf[(int)i];
c = buf[i];
a = c;
a &= 0x55;

Expand All @@ -456,18 +455,16 @@ fn _poly_getnoise(reg ptr u16[MLKEM_N] rp, reg ptr u8[MLKEM_SYMBYTES] seed, reg
b &= 0x3;
a -= b;
t = (16s)a;
rp[(int)j] = t;
rp[2 * i] = t;
a = c;
a >>= 4;
a &= 0x3;
b = c >> 6;
b &= 0x3;
a -= b;
t = (16s)a;
j += 1;
rp[(int)j] = t;
rp[2 * i + 1] = t;
i += 1;
j += 1;
}

return rp;
Expand Down

0 comments on commit e9f1d69

Please sign in to comment.