From 172448b05931e791ce3470b45afe8de4cdffaaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Sun, 1 Nov 2020 10:22:48 +0100 Subject: Separate result area for ecc_mod_mul and ecc_mod_sqr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- eddsa-sign.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eddsa-sign.c') diff --git a/eddsa-sign.c b/eddsa-sign.c index f8bdf255..c1a23cd7 100644 --- a/eddsa-sign.c +++ b/eddsa-sign.c @@ -91,7 +91,7 @@ _eddsa_sign (const struct ecc_curve *ecc, eddsa->digest (ctx, 2*nbytes, hash); _eddsa_hash (&ecc->q, hp, 2*nbytes, hash); - ecc_mod_mul (&ecc->q, sp, hp, k2); + ecc_mod_mul (&ecc->q, sp, hp, k2, sp); ecc_mod_add (&ecc->q, sp, sp, rp); /* FIXME: Can be plain add */ if (ecc->p.bit_size == 255) { -- cgit v1.2.1