summaryrefslogtreecommitdiff
path: root/lib/nettle/ecc/override/ecc-mod-arith.c.diff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nettle/ecc/override/ecc-mod-arith.c.diff')
-rw-r--r--lib/nettle/ecc/override/ecc-mod-arith.c.diff19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/nettle/ecc/override/ecc-mod-arith.c.diff b/lib/nettle/ecc/override/ecc-mod-arith.c.diff
new file mode 100644
index 0000000000..17b2592e30
--- /dev/null
+++ b/lib/nettle/ecc/override/ecc-mod-arith.c.diff
@@ -0,0 +1,19 @@
+diff --git a/ecc-mod-arith.c b/ecc-mod-arith.c
+index f2e47f67..959eae1c 100644
+--- a/ecc-mod-arith.c
++++ b/ecc-mod-arith.c
+@@ -125,3 +125,14 @@ ecc_mod_sqr (const struct ecc_modulo *m, mp_limb_t *rp,
+ mpn_sqr (rp, ap, m->size);
+ m->reduce (m, rp);
+ }
++
++void
++ecc_mod_mul_canonical (const struct ecc_modulo *m, mp_limb_t *rp,
++ const mp_limb_t *ap, const mp_limb_t *bp)
++{
++ mp_limb_t cy;
++ ecc_mod_mul(m, rp, ap, bp);
++
++ cy = mpn_sub_n (rp + m->size, rp, m->m, m->size);
++ cnd_copy (!cy, rp, rp + m->size, m->size);
++}