Merge pull request #3343 from ejohnstown/test-ecc521

Test ECC-521 Only
This commit is contained in:
David Garske
2020-09-28 14:06:42 -07:00
committed by GitHub
2 changed files with 13 additions and 10 deletions

View File

@@ -5236,6 +5236,8 @@ void bench_ntruKeyGen(void)
#define BENCH_ECC_SIZE 48 #define BENCH_ECC_SIZE 48
#elif defined(HAVE_ECC224) #elif defined(HAVE_ECC224)
#define BENCH_ECC_SIZE 28 #define BENCH_ECC_SIZE 28
#elif defined(HAVE_ECC521)
#define BENCH_ECC_SIZE 66
#else #else
#error No ECC keygen size defined for benchmark #error No ECC keygen size defined for benchmark
#endif #endif

View File

@@ -10503,7 +10503,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
static const char* dsaKey = CERT_ROOT "dsa2048.der"; static const char* dsaKey = CERT_ROOT "dsa2048.der";
#endif #endif
#endif /* !USE_CERT_BUFFER_* */ #endif /* !USE_CERT_BUFFER_* */
#if !defined(USE_CERT_BUFFERS_256) #if !defined(USE_CERT_BUFFERS_256) && !defined(NO_ECC256)
#ifdef HAVE_ECC #ifdef HAVE_ECC
/* cert files to be used in rsa cert gen test, check if RSA enabled */ /* cert files to be used in rsa cert gen test, check if RSA enabled */
#ifdef HAVE_ECC_KEY_IMPORT #ifdef HAVE_ECC_KEY_IMPORT
@@ -18239,6 +18239,8 @@ static int x963kdf_test(void)
#define ECC_KEYGEN_SIZE 48 #define ECC_KEYGEN_SIZE 48
#elif defined(HAVE_ECC224) #elif defined(HAVE_ECC224)
#define ECC_KEYGEN_SIZE 28 #define ECC_KEYGEN_SIZE 28
#elif defined(HAVE_ECC521)
#define ECC_KEYGEN_SIZE 66
#else #else
#error No ECC keygen size defined for test #error No ECC keygen size defined for test
#endif #endif
@@ -18796,9 +18798,6 @@ static int ecc_test_make_pub(WC_RNG* rng)
#ifdef HAVE_ECC_VERIFY #ifdef HAVE_ECC_VERIFY
int verify = 0; int verify = 0;
#endif #endif
#ifndef USE_CERT_BUFFERS_256
XFILE file;
#endif
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
if ((key == NULL) || if ((key == NULL) ||
@@ -18822,13 +18821,15 @@ static int ecc_test_make_pub(WC_RNG* rng)
XMEMCPY(tmp, ecc_key_der_256, (size_t)sizeof_ecc_key_der_256); XMEMCPY(tmp, ecc_key_der_256, (size_t)sizeof_ecc_key_der_256);
tmpSz = (size_t)sizeof_ecc_key_der_256; tmpSz = (size_t)sizeof_ecc_key_der_256;
#else #else
file = XFOPEN(eccKeyDerFile, "rb"); {
if (!file) { XFILE file = XFOPEN(eccKeyDerFile, "rb");
ERROR_OUT(-9617, done); if (!file) {
} ERROR_OUT(-9617, done);
}
tmpSz = (word32)XFREAD(tmp, 1, ECC_BUFSIZE, file); tmpSz = (word32)XFREAD(tmp, 1, ECC_BUFSIZE, file);
XFCLOSE(file); XFCLOSE(file);
}
#endif /* USE_CERT_BUFFERS_256 */ #endif /* USE_CERT_BUFFERS_256 */
/* import private only then test with */ /* import private only then test with */