Skip to content

Commit

Permalink
Speedup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Aug 14, 2024
1 parent 454d055 commit 12cf3d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/epx/relic_ep4_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ static void ep4_mul_gls_imp(ep4_t r, const ep4_t p, const bn_t k) {
}
ep4_tab(t[0], q, RLC_WIDTH);

if (ep_curve_is_pairf() == EP_K16) {
if (ep_curve_is_pairf() == EP_K16 || ep_curve_is_pairf() == EP_N16) {
/* Minimize use of endomorphism when it's expensive. */
for (size_t i = 1; i < 8; i++) {
ep4_psi(q, t[i - 1][0]);
if (bn_sign(_k[i]) == RLC_NEG) {
Expand Down
3 changes: 2 additions & 1 deletion src/pc/relic_pc_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ void gt_exp_gls_naf(gt_t c, const gt_t a, const bn_t b, size_t f) {
l = RLC_MAX(l, _l[i]);
}

if (ep_curve_is_pairf() == EP_K16 || ep_curve_embed() == 18) {
if (ep_curve_is_pairf() == EP_K16 || ep_curve_is_pairf() == EP_N16 ||
ep_curve_embed() == 18) {
gt_copy(t[0], a);
for (size_t i = 1; i < f; i++) {
gt_psi(t[i * RLC_GT_TABLE], t[(i - 1) * RLC_GT_TABLE]);
Expand Down

0 comments on commit 12cf3d6

Please sign in to comment.