diff options
author | Niels Möller <nisse@lysator.liu.se> | 2020-11-01 10:22:48 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2020-11-01 10:22:48 +0100 |
commit | 172448b05931e791ce3470b45afe8de4cdffaaad (patch) | |
tree | cd7d238a5ba07568c71619a9bb7819e107cfe205 /ecc-ecdsa-sign.c | |
parent | 98402b3b32b346a568c0d0d8e56a64f27116250c (diff) | |
download | nettle-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-ecdsa-sign.c')
-rw-r--r-- | ecc-ecdsa-sign.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ecc-ecdsa-sign.c b/ecc-ecdsa-sign.c index d675bd9b..e79a636a 100644 --- a/ecc-ecdsa-sign.c +++ b/ecc-ecdsa-sign.c @@ -88,9 +88,9 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc, /* Process hash digest */ ecc_hash (&ecc->q, hp, length, digest); - ecc_mod_mul (&ecc->q, tp, zp, rp); + ecc_mod_mul (&ecc->q, tp, zp, rp, tp); ecc_mod_add (&ecc->q, hp, hp, tp); - ecc_mod_mul (&ecc->q, tp, hp, kinv); + ecc_mod_mul (&ecc->q, tp, hp, kinv, tp); mpn_copyi (sp, tp, ecc->p.size); #undef P |