Skip to content

Commit 6d62448

Browse files
committed
Moved init of "bn" down a bit
1 parent 10ba728 commit 6d62448

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mp_log.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ mp_err mp_log(const mp_int *a, const mp_int *b, int *lb)
6565
return MP_OKAY;
6666
}
6767

68-
if ((err = mp_init(&bn)) != MP_OKAY) {
69-
return err;
70-
}
71-
7268
/* floor(log_2(x)) for cut-off */
7369
fla = mp_count_bits(a) - 1;
7470
flb = mp_count_bits(b) - 1;
@@ -97,6 +93,10 @@ mp_err mp_log(const mp_int *a, const mp_int *b, int *lb)
9793
goto LTM_ERR;
9894
}
9995

96+
if ((err = mp_init(&bn)) != MP_OKAY) {
97+
return err;
98+
}
99+
100100
/* Check result. Result is wrong by 2(two) at most. */
101101
if ((err = mp_expt_n(b, n, &bn)) != MP_OKAY) {
102102
/* If the approximation overshot we can give it another try */

0 commit comments

Comments
 (0)