From 2de52c766655b47735709957e212e821e6e99626 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 26 Nov 2019 15:44:30 -0800 Subject: [PATCH] Maintenance: Prime When returning a result from mp_prime_is_prime for normal math, the result should be MP_YES or MP_NO, not a bare number (1 or 0). --- wolfcrypt/src/integer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index fad07663e..4f87ab2e0 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -4716,14 +4716,14 @@ int mp_prime_is_prime (mp_int * a, int t, int *result) } if (mp_isone(a)) { - *result = 0; + *result = MP_NO; return MP_OKAY; } /* is the input equal to one of the primes in the table? */ for (ix = 0; ix < PRIME_SIZE; ix++) { if (mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) { - *result = 1; + *result = MP_YES; return MP_OKAY; } }