Skip to content

Commit e9f1d69

Browse files
committed
mlkem: poly.jinc update from formosa-crypto/formosa-mlkem#20
1 parent b33e80e commit e9f1d69

File tree

1 file changed

+4
-7
lines changed
  • src/crypto_kem/mlkem/mlkem768/amd64/ref

1 file changed

+4
-7
lines changed

src/crypto_kem/mlkem/mlkem768/amd64/ref/poly.jinc

+4-7
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ fn _poly_getnoise(reg ptr u16[MLKEM_N] rp, reg ptr u8[MLKEM_SYMBYTES] seed, reg
420420
reg u64 outlen;
421421
reg u8 c,a,b;
422422
reg u16 t;
423-
reg u64 i j;
423+
reg u64 i;
424424
inline int k;
425425

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

441441
i = 0;
442-
j = 0;
443442
while (i < 128) {
444-
c = buf[(int)i];
443+
c = buf[i];
445444
a = c;
446445
a &= 0x55;
447446

@@ -456,18 +455,16 @@ fn _poly_getnoise(reg ptr u16[MLKEM_N] rp, reg ptr u8[MLKEM_SYMBYTES] seed, reg
456455
b &= 0x3;
457456
a -= b;
458457
t = (16s)a;
459-
rp[(int)j] = t;
458+
rp[2 * i] = t;
460459
a = c;
461460
a >>= 4;
462461
a &= 0x3;
463462
b = c >> 6;
464463
b &= 0x3;
465464
a -= b;
466465
t = (16s)a;
467-
j += 1;
468-
rp[(int)j] = t;
466+
rp[2 * i + 1] = t;
469467
i += 1;
470-
j += 1;
471468
}
472469

473470
return rp;

0 commit comments

Comments
 (0)