Skip to content

Commit

Permalink
HQC trim excessive stack allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
jschanck committed Apr 1, 2021
1 parent a55f514 commit 9c4e109
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
*/
-void vect_mul(uint64_t *o, const uint64_t *a1, const uint64_t *a2) {
+void vect_mul(uint64_t *o, const aligned_vec_t *a1, const aligned_vec_t *a2) {
+ __m256i a1_times_a2[2 * PARAM_N_MULT + 1] = {0};
+ __m256i a1_times_a2[CEIL_DIVIDE(2 * PARAM_N_MULT + 1, 256)] = {0};
karat_mult9(a1_times_a2, a1, a2);
reduce(o, a1_times_a2);
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
*/
-void vect_mul(uint64_t *o, const uint64_t *a1, const uint64_t *a2) {
+void vect_mul(uint64_t *o, const aligned_vec_t *a1, const aligned_vec_t *a2) {
+ __m256i a1_times_a2[2 * PARAM_N_MULT + 1] = {0};
+ __m256i a1_times_a2[CEIL_DIVIDE(2 * PARAM_N_MULT + 1, 256)] = {0};
karat_mult9(a1_times_a2, a1, a2);
reduce(o, a1_times_a2);
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
-void vect_mul(uint64_t *o, const uint64_t *a1, const uint64_t *a2) {
- toom_3_mult(a1_times_a2, a1, a2);
+void vect_mul(uint64_t *o, const aligned_vec_t *a1, const aligned_vec_t *a2) {
+ __m256i a1_times_a2[VEC_N_256_SIZE_64 << 1] = {0};
+ __m256i a1_times_a2[CEIL_DIVIDE(2*PARAM_N_MULT + 1,256)] = {0};
+ toom_3_mult((uint64_t *)a1_times_a2, a1, a2);
reduce(o, a1_times_a2);
-
Expand Down

0 comments on commit 9c4e109

Please sign in to comment.