Skip to content

Commit

Permalink
Fix alignment issues in Kyber (#236)
Browse files Browse the repository at this point in the history
* Add .vscode to gitignore

* Add alignment to arrays used in Kyber to address #235
  • Loading branch information
rugo authored Jun 7, 2022
1 parent 0b50e72 commit 26f810d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__/
bin/
bin-host/
compile_commands.json
.vscode
4 changes: 2 additions & 2 deletions crypto_kem/kyber768/m4fspeed/ntt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const int16_t zetas[64] =
3221, 3021, 996, 991, 958, 1869, 1522, 1628
};

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

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

0 comments on commit 26f810d

Please sign in to comment.