forked from wolfSSL/wolfssl
fix github issue #35, allow user to pick ecc curves with ECC_USER_CURVES and separate HAVE_ECCxxx defines
This commit is contained in:
@ -50,14 +50,32 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ECC112
|
|
||||||
#define ECC128
|
/* p256 curve on by default whether user curves or not */
|
||||||
#define ECC160
|
#if defined(HAVE_ECC112) || defined(HAVE_ALL_CURVES)
|
||||||
#define ECC192
|
#define ECC112
|
||||||
#define ECC224
|
#endif
|
||||||
#define ECC256
|
#if defined(HAVE_ECC128) || defined(HAVE_ALL_CURVES)
|
||||||
#define ECC384
|
#define ECC128
|
||||||
#define ECC521
|
#endif
|
||||||
|
#if defined(HAVE_ECC160) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC160
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC192
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC224
|
||||||
|
#endif
|
||||||
|
#if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC256
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC384
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)
|
||||||
|
#define ECC521
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4882,6 +4882,7 @@ int ecc_test(void)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -1017;
|
return -1017;
|
||||||
|
|
||||||
|
#if (defined(HAVE_ECC192) && defined(HAVE_ECC224)) || defined(HAVE_ALL_CURVES)
|
||||||
{
|
{
|
||||||
/* test raw ECC key import */
|
/* test raw ECC key import */
|
||||||
Sha sha;
|
Sha sha;
|
||||||
@ -4964,6 +4965,7 @@ int ecc_test(void)
|
|||||||
return -1023 - i;
|
return -1023 - i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* defined(HAVE_ECC192) && defined(HAVE_ECC256) */
|
||||||
|
|
||||||
|
|
||||||
#ifdef WOLFSSL_KEY_GEN
|
#ifdef WOLFSSL_KEY_GEN
|
||||||
|
@ -740,6 +740,14 @@
|
|||||||
#pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
|
#pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* user can specify what curves they want with ECC_USER_CURVES otherwise
|
||||||
|
* all curves are on by default for now */
|
||||||
|
#ifndef ECC_USER_CURVES
|
||||||
|
#ifndef HAVE_ALL_CURVES
|
||||||
|
#define HAVE_ALL_CURVES
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Place any other flags or defines here */
|
/* Place any other flags or defines here */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user