summaryrefslogtreecommitdiff
path: root/ecc-eh-to-a.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2020-11-01 10:22:48 +0100
committerNiels Möller <nisse@lysator.liu.se>2020-11-01 10:22:48 +0100
commit172448b05931e791ce3470b45afe8de4cdffaaad (patch)
treecd7d238a5ba07568c71619a9bb7819e107cfe205 /ecc-eh-to-a.c
parent98402b3b32b346a568c0d0d8e56a64f27116250c (diff)
downloadnettle-172448b05931e791ce3470b45afe8de4cdffaaad.tar.gz
Separate result area for ecc_mod_mul and ecc_mod_sqr.
* ecc-mod-arith.c (ecc_mod_mul, ecc_mod_sqr): Separate argument for scratch area, reducing required size of result area. Update all callers to naïvely keep using result in scratch area. (ecc_mod_pow_2k, ecc_mod_pow_2k_mul): Simplified, also reducing required size of result area.
Diffstat (limited to 'ecc-eh-to-a.c')
-rw-r--r--ecc-eh-to-a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecc-eh-to-a.c b/ecc-eh-to-a.c
index 869e8ad5..ce71e93f 100644
--- a/ecc-eh-to-a.c
+++ b/ecc-eh-to-a.c
@@ -61,11 +61,11 @@ ecc_eh_to_a (const struct ecc_curve *ecc,
/* Needs 2*size + scratch for the invert call. */
ecc->p.invert (&ecc->p, izp, zp, tp + ecc->p.size);
- ecc_mod_mul (&ecc->p, tp, xp, izp);
+ ecc_mod_mul (&ecc->p, tp, xp, izp, tp);
cy = mpn_sub_n (r, tp, ecc->p.m, ecc->p.size);
cnd_copy (cy, r, tp, ecc->p.size);
- ecc_mod_mul (&ecc->p, tp, yp, izp);
+ ecc_mod_mul (&ecc->p, tp, yp, izp, tp);
cy = mpn_sub_n (r + ecc->p.size, tp, ecc->p.m, ecc->p.size);
cnd_copy (cy, r + ecc->p.size, tp, ecc->p.size);
}