From d294dc363e2a55c4d7e0151d58491cf4fed37d31 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 21 Jun 2016 19:35:25 -0700 Subject: [PATCH] Fix scan-build warning with "redundant redeclaration of 'fp_isprime'". Changed "fp_isprime" and "fp_isprime_ex" to local static only. Also made "fp_gcd", "fp_lcm", and "fp_randprime" static functions. --- wolfcrypt/src/tfm.c | 9 +++++---- wolfssl/wolfcrypt/tfm.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index dbd1d734b..7fe0c43dc 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -2548,10 +2548,11 @@ int mp_mod_d(fp_int *a, fp_digit b, fp_digit *c) #ifdef WOLFSSL_KEY_GEN -void fp_gcd(fp_int *a, fp_int *b, fp_int *c); -void fp_lcm(fp_int *a, fp_int *b, fp_int *c); -int fp_isprime(fp_int *a); -int fp_randprime(fp_int* N, int len, WC_RNG* rng, void* heap); +static void fp_gcd(fp_int *a, fp_int *b, fp_int *c); +static void fp_lcm(fp_int *a, fp_int *b, fp_int *c); +static int fp_isprime_ex(fp_int *a, int t); +static int fp_isprime(fp_int *a); +static int fp_randprime(fp_int* N, int len, WC_RNG* rng, void* heap); int mp_gcd(fp_int *a, fp_int *b, fp_int *c) { diff --git a/wolfssl/wolfcrypt/tfm.h b/wolfssl/wolfcrypt/tfm.h index 94efa2416..db0965d06 100644 --- a/wolfssl/wolfcrypt/tfm.h +++ b/wolfssl/wolfcrypt/tfm.h @@ -518,9 +518,9 @@ int fp_exptmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d); #define FP_PRIME_SIZE 256 /* 256 trial divisions + 8 Miller-Rabins, returns FP_YES if probable prime */ -int fp_isprime(fp_int *a); +/*int fp_isprime(fp_int *a);*/ /* extended version of fp_isprime, do 't' Miller-Rabins instead of only 8 */ -int fp_isprime_ex(fp_int *a, int t); +/*int fp_isprime_ex(fp_int *a, int t);*/ /* Primality generation flags */ /*#define TFM_PRIME_BBS 0x0001 */ /* BBS style prime */