summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_reduce_2k_l.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-22 19:32:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-22 19:32:11 (GMT)
commitf8876cc390ecf388114f426db15e641a5adb20fc (patch)
tree81798f8180e5b22906f264758362a8b4bf54f979 /libtommath/bn_mp_reduce_2k_l.c
parent5753c7a42b638962406f9f7f822e48561e7a6253 (diff)
downloadtcl-f8876cc390ecf388114f426db15e641a5adb20fc.zip
tcl-f8876cc390ecf388114f426db15e641a5adb20fc.tar.gz
tcl-f8876cc390ecf388114f426db15e641a5adb20fc.tar.bz2
Update libtommath to latest "develop" branch
Diffstat (limited to 'libtommath/bn_mp_reduce_2k_l.c')
-rw-r--r--libtommath/bn_mp_reduce_2k_l.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libtommath/bn_mp_reduce_2k_l.c b/libtommath/bn_mp_reduce_2k_l.c
index 23381bf..cbdfad7 100644
--- a/libtommath/bn_mp_reduce_2k_l.c
+++ b/libtommath/bn_mp_reduce_2k_l.c
@@ -1,4 +1,4 @@
-#include <tommath_private.h>
+#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
- *
- * Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* reduces a modulo n where n is of the form 2**p - d
@@ -32,27 +30,27 @@ int mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d)
top:
/* q = a/2**p, a = a mod 2**p */
if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) {
- goto ERR;
+ goto LBL_ERR;
}
/* q = q * d */
if ((res = mp_mul(&q, d, &q)) != MP_OKAY) {
- goto ERR;
+ goto LBL_ERR;
}
/* a = a + q */
if ((res = s_mp_add(a, &q, a)) != MP_OKAY) {
- goto ERR;
+ goto LBL_ERR;
}
if (mp_cmp_mag(a, n) != MP_LT) {
if ((res = s_mp_sub(a, n, a)) != MP_OKAY) {
- goto ERR;
+ goto LBL_ERR;
}
goto top;
}
-ERR:
+LBL_ERR:
mp_clear(&q);
return res;
}