mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
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).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user