Merge pull request #150 from fperrad/20190122_lint

some linting
This commit is contained in:
Steffen Jaeckel 2019-01-23 10:05:30 +01:00 committed by GitHub
commit 35936e02ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
}
#ifdef MP_8BIT
/* The search in the loop above was exhaustive in this case */
if (a->used == 1 && PRIME_SIZE >= 31) {
if ((a->used == 1) && (PRIME_SIZE >= 31)) {
return MP_OKAY;
}
#endif
@ -126,7 +126,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
*/
#if defined (MP_8BIT) || defined (LTM_USE_FROBENIUS_TEST)
err = mp_prime_frobenius_underwood(a, &res);
if (err != MP_OKAY && err != MP_ITER) {
if ((err != MP_OKAY) && (err != MP_ITER)) {
goto LBL_B;
}
if (res == MP_NO) {
@ -296,7 +296,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
* One 8-bit digit is too small, so concatenate two if the size of
* unsigned int allows for it.
*/
if ((sizeof(unsigned int) * CHAR_BIT)/2 >= (sizeof(mp_digit) * CHAR_BIT)) {
if (((sizeof(unsigned int) * CHAR_BIT)/2) >= (sizeof(mp_digit) * CHAR_BIT)) {
if ((err = mp_rand(&b, 1)) != MP_OKAY) {
goto LBL_B;
}
@ -305,7 +305,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
fips_rand &= mask;
}
#endif
if (fips_rand > ((unsigned int) INT_MAX - DIGIT_BIT)) {
if (fips_rand > (unsigned int)(INT_MAX - DIGIT_BIT)) {
len = INT_MAX / DIGIT_BIT;
} else {
len = (((int)fips_rand + DIGIT_BIT) / DIGIT_BIT);