Skip to content

Commit 26f810d

Browse files
author
rugo
authoredJun 7, 2022
Fix alignment issues in Kyber (#236)
* Add .vscode to gitignore * Add alignment to arrays used in Kyber to address #235
1 parent 0b50e72 commit 26f810d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__/
99
bin/
1010
bin-host/
1111
compile_commands.json
12+
.vscode

‎crypto_kem/kyber768/m4fspeed/ntt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const int16_t zetas[64] =
1414
3221, 3021, 996, 991, 958, 1869, 1522, 1628
1515
};
1616

17-
const int16_t zetas_asm[128] = {
17+
const int16_t __attribute__((aligned (4))) zetas_asm[128] = {
1818
// 7 & 6 & 5 & 4 layers
1919
0, 2571, 2970, 1812, 1493, 1422, 287, 202, 3158, 622, 1577, 182, 962, 2127, 1855, 1468,
2020
// 1st loop of 3 & 2 & 1 layers
@@ -35,7 +35,7 @@ const int16_t zetas_asm[128] = {
3535
3124, 448, 2264, 3221, 3021, 996, 991, 1758, 677, 2054, 958, 1869, 1522, 1628
3636
};
3737

38-
const int16_t zetas_inv_CT_asm[256] =
38+
const int16_t __attribute__((aligned (4))) zetas_inv_CT_asm[256] =
3939
{
4040
// pad + LAYER 7+6+5+4
4141
0, 2285, 2285, 758, 2285, 1517, 758, 359, 2285, 3127, 1517, 1907, 758, 3042, 359, 1836,

0 commit comments

Comments
 (0)
Please sign in to comment.