Skip to content

Commit

Permalink
Another fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Nov 26, 2024
1 parent 7cbe375 commit 000b019
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/fpx/relic_fp16_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void fp16_mul_dxs_basic(fp16_t c, const fp16_t a, const fp16_t b) {
fp4_sub(t1[1], t1[1], t1[0]);
fp4_mul_art(t1[0], t1[0]);
} else {
#if EP_ADD == BASIC
/* t0 = a_0 * b_0. */
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
Expand All @@ -113,6 +114,12 @@ void fp16_mul_dxs_basic(fp16_t c, const fp16_t a, const fp16_t b) {
}
}
}
#else
/* t0 = a_0 * b_0. */
for (int i = 0; i < 2; i++) {
fp4_mul(t0[i], a[0][i], b[0][0]);
}
#endif
/* t1 = a_1 * b_1. */
fp8_mul(t1, a[1], b[1]);
}
Expand Down Expand Up @@ -266,6 +273,7 @@ void fp16_mul_dxs_lazyr(fp16_t c, const fp16_t a, const fp16_t b) {
dv_copy(u1[0][1][0], u2[0][0][0], 2 * RLC_FP_DIGS);
dv_copy(u1[0][1][1], u2[0][0][1], 2 * RLC_FP_DIGS);
} else {
#if EP_ADD == BASIC
/* u0 = a_0 * b_0. */
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
Expand All @@ -274,6 +282,12 @@ void fp16_mul_dxs_lazyr(fp16_t c, const fp16_t a, const fp16_t b) {
}
}
}
#else
/* u0 = a_0 * b_0. */
for (int i = 0; i < 2; i++) {
fp4_mul_unr(u0[i], a[0][i], b[0][0]);
}
#endif
/* u1 = a_1 * b_1. */
fp8_mul_unr(u1, a[1], b[1]);
}
Expand Down

0 comments on commit 000b019

Please sign in to comment.