diff --git a/code/jasmin/mlkem_avx2/kem.jinc b/code/jasmin/mlkem_avx2/kem.jinc index 96df10f0..7be45bb2 100644 --- a/code/jasmin/mlkem_avx2/kem.jinc +++ b/code/jasmin/mlkem_avx2/kem.jinc @@ -25,10 +25,12 @@ fn __crypto_kem_keypair_jazz(reg u64 pkp, reg u64 skp, reg ptr u8[MLKEM_SYMBYTES for i=0 to MLKEM_INDCPA_PUBLICKEYBYTES/8 { - (u64)[skp + 8 * i] = (u64)[pkp + 8 * i]; + t64 = (u64)[pkp + 8*i]; + (u64)[skp] = t64; + skp += 8; } - s_skp += MLKEM_POLYVECBYTES + MLKEM_INDCPA_PUBLICKEYBYTES; + s_skp = skp; pkp = s_pkp; t64 = MLKEM_PUBLICKEYBYTES; @@ -37,7 +39,9 @@ fn __crypto_kem_keypair_jazz(reg u64 pkp, reg u64 skp, reg ptr u8[MLKEM_SYMBYTES for i=0 to 4 { - (u64)[skp + 8 * i] = h_pk[u64 i]; + t64 = h_pk[u64 i]; + (u64)[skp] = t64; + skp += 8; } randomnessp = s_randomnessp; @@ -45,7 +49,9 @@ fn __crypto_kem_keypair_jazz(reg u64 pkp, reg u64 skp, reg ptr u8[MLKEM_SYMBYTES for i=0 to MLKEM_SYMBYTES/8 { - (u64)[skp + 8 * i + 32] = randomnessp2[u64 i]; + t64 = randomnessp2[u64 i]; + (u64)[skp] = t64; + skp += 8; } }