Skip to content

Commit 9d04b28

Browse files
author
Christoph Zurnieden
committed
added check if startvalue == 1
1 parent c306afd commit 9d04b28

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

mp_root_n.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ mp_err mp_root_n(const mp_int *a, int b, mp_int *c)
222222

223223
/* 2^k, the start-value */
224224
if ((err = s_mp_fp_exp2(&t2, &t2)) != MP_OKAY) goto LBL_ERR;
225+
if (mp_isone(&t2)) {
226+
if ((err = mp_incr(&t2)) != MP_OKAY) goto LBL_ERR;
227+
}
225228
do {
226229

227230
/* t1 = t2 */

0 commit comments

Comments
 (0)