Skip to content

Commit 0fa57df

Browse files
committed
allow building against latest ltm
1 parent dcebb52 commit 0fa57df

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/math/ltm_desc.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#ifdef LTM_DESC
1414

1515
#include <tommath.h>
16+
#if !defined(PRIVATE_MP_WARRAY) && !defined(BN_MP_PRIME_IS_PRIME_C)
17+
#include <stdbool.h>
18+
#endif
1619

1720
static const struct {
1821
mp_err mpi_code;
@@ -447,11 +450,16 @@ static int exptmod(void *a, void *b, void *c, void *d)
447450
static int isprime(void *a, int b, int *c)
448451
{
449452
int err;
453+
#if defined(PRIVATE_MP_WARRAY) || defined(BN_MP_PRIME_IS_PRIME_C)
454+
int res;
455+
#else
456+
bool res;
457+
#endif
450458
LTC_ARGCHK(a != NULL);
451459
LTC_ARGCHK(c != NULL);
452460
b = mp_prime_rabin_miller_trials(mp_count_bits(a));
453-
err = mpi_to_ltc_error(mp_prime_is_prime(a, b, c));
454-
*c = (*c == MP_YES) ? LTC_MP_YES : LTC_MP_NO;
461+
err = mpi_to_ltc_error(mp_prime_is_prime(a, b, &res));
462+
*c = res ? LTC_MP_YES : LTC_MP_NO;
455463
return err;
456464
}
457465

0 commit comments

Comments
 (0)