summaryrefslogtreecommitdiff
path: root/ecc-gost-gc512a.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2020-10-30 15:01:39 +0100
committerNiels Möller <nisse@lysator.liu.se>2020-10-30 20:22:40 +0100
commitf4f5625edb7d899972431b838ac19ced9288f68a (patch)
treebc18e9bd95b9f940bc6d4229e012c063562e8c9e /ecc-gost-gc512a.c
parentcbf217b15f66a73041e6fe1a108453efd0297d27 (diff)
downloadnettle-f4f5625edb7d899972431b838ac19ced9288f68a.tar.gz
Add separate result argument to all mod functions.
* ecc-internal.h (typedef ecc_mod_func): Add separate result argument. Updated all C implementations and callers.
Diffstat (limited to 'ecc-gost-gc512a.c')
-rw-r--r--ecc-gost-gc512a.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ecc-gost-gc512a.c b/ecc-gost-gc512a.c
index 398762c3..0f6e9b6d 100644
--- a/ecc-gost-gc512a.c
+++ b/ecc-gost-gc512a.c
@@ -43,14 +43,14 @@
#include "ecc-gost-gc512a.h"
static void
-ecc_gost_gc512a_modp (const struct ecc_modulo *m, mp_limb_t *rp)
+ecc_gost_gc512a_modp (const struct ecc_modulo *m, mp_limb_t *rp, mp_limb_t *xp)
{
mp_size_t mn = m->size;
mp_limb_t hi;
- hi = mpn_addmul_1(rp, rp + mn, mn, 0x239);
- hi = sec_add_1 (rp, rp, mn, hi * 0x239);
- hi = sec_add_1 (rp, rp, mn, hi * 0x239);
+ hi = mpn_addmul_1(xp, xp + mn, mn, 0x239);
+ hi = sec_add_1 (xp, xp, mn, hi * 0x239);
+ hi = sec_add_1 (rp, xp, mn, hi * 0x239);
assert(hi == 0);
}