mirror of https://github.com/wolfSSL/wolfssl.git
wolfssl/wolfcrypt/ecc.h and wolfcrypt/src/ecc.c: refactor ecc_sets and ecc_sets_count using accessor functions, to fix linker relocation errors in Fedora packaging test.
parent
510d6a07bf
commit
212708e3b4
|
@ -856,6 +856,14 @@ enum {
|
||||||
/* This holds the key settings.
|
/* This holds the key settings.
|
||||||
***MUST*** be organized by size from smallest to largest. */
|
***MUST*** be organized by size from smallest to largest. */
|
||||||
|
|
||||||
|
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0)
|
||||||
|
#undef ecc_sets
|
||||||
|
#undef ecc_sets_count
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0)
|
||||||
|
static
|
||||||
|
#endif
|
||||||
const ecc_set_type ecc_sets[] = {
|
const ecc_set_type ecc_sets[] = {
|
||||||
#ifdef ECC112
|
#ifdef ECC112
|
||||||
#ifndef NO_ECC_SECP
|
#ifndef NO_ECC_SECP
|
||||||
|
@ -1399,8 +1407,17 @@ const ecc_set_type ecc_sets[] = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#define ECC_SET_COUNT (sizeof(ecc_sets)/sizeof(ecc_set_type))
|
#define ECC_SET_COUNT (sizeof(ecc_sets)/sizeof(ecc_set_type))
|
||||||
|
#if !defined(HAVE_FIPS) || FIPS_VERSION3_GE(6,0,0)
|
||||||
|
static
|
||||||
|
#endif
|
||||||
const size_t ecc_sets_count = ECC_SET_COUNT - 1;
|
const size_t ecc_sets_count = ECC_SET_COUNT - 1;
|
||||||
|
|
||||||
|
const ecc_set_type *wc_ecc_get_sets(void) {
|
||||||
|
return ecc_sets;
|
||||||
|
}
|
||||||
|
size_t wc_ecc_get_sets_count(void) {
|
||||||
|
return ecc_sets_count;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OID_ENCODING
|
#ifdef HAVE_OID_ENCODING
|
||||||
/* encoded OID cache */
|
/* encoded OID cache */
|
||||||
|
|
|
@ -34481,7 +34481,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ecc_test_buffers(void)
|
||||||
} while (ret == WC_NO_ERR_TRACE(WC_PENDING_E));
|
} while (ret == WC_NO_ERR_TRACE(WC_PENDING_E));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), done);
|
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), done);
|
||||||
TEST_SLEEP();
|
TEST_SLEEP();
|
||||||
|
|
||||||
XMEMSET(plain, 0, sizeof(plain));
|
XMEMSET(plain, 0, sizeof(plain));
|
||||||
|
|
||||||
|
|
|
@ -641,8 +641,15 @@ WOLFSSL_ABI WOLFSSL_API void wc_ecc_key_free(ecc_key* key);
|
||||||
|
|
||||||
|
|
||||||
/* ECC predefined curve sets */
|
/* ECC predefined curve sets */
|
||||||
extern const ecc_set_type ecc_sets[];
|
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
|
||||||
extern const size_t ecc_sets_count;
|
extern const ecc_set_type ecc_sets[];
|
||||||
|
extern const size_t ecc_sets_count;
|
||||||
|
#else
|
||||||
|
WOLFSSL_API const ecc_set_type *wc_ecc_get_sets(void);
|
||||||
|
WOLFSSL_API size_t wc_ecc_get_sets_count(void);
|
||||||
|
#define ecc_sets wc_ecc_get_sets()
|
||||||
|
#define ecc_sets_count wc_ecc_get_sets_count()
|
||||||
|
#endif
|
||||||
|
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
const char* wc_ecc_get_name(int curve_id);
|
const char* wc_ecc_get_name(int curve_id);
|
||||||
|
@ -763,7 +770,7 @@ WOLFSSL_API
|
||||||
int wc_ecc_set_flags(ecc_key* key, word32 flags);
|
int wc_ecc_set_flags(ecc_key* key, word32 flags);
|
||||||
WOLFSSL_ABI WOLFSSL_API
|
WOLFSSL_ABI WOLFSSL_API
|
||||||
void wc_ecc_fp_free(void);
|
void wc_ecc_fp_free(void);
|
||||||
WOLFSSL_LOCAL
|
WOLFSSL_API
|
||||||
void wc_ecc_fp_init(void);
|
void wc_ecc_fp_init(void);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
|
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
|
||||||
|
|
Loading…
Reference in New Issue