ECC without Shamir has issues testing all zero's digest, so disable this test if not using Shamir method. Fixed comment about "NO_ECC_SECP".

This commit is contained in:
David Garske
2016-07-19 14:34:32 -07:00
parent 7a419ba6d8
commit 5e2502fa95
2 changed files with 3 additions and 2 deletions

View File

@ -47,7 +47,7 @@ Possible ECC enable options:
/*
ECC Curve Types:
* NO_ECC_SECP Disables SECP curves default: on
* NO_ECC_SECP Disables SECP curves default: off (not defined)
* HAVE_ECC_SECPR2 Enables SECP R2 curves default: off
* HAVE_ECC_SECPR3 Enables SECP R3 curves default: off
* HAVE_ECC_BRAINPOOL Enables Brainpool curves default: off

View File

@ -6822,11 +6822,11 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
#endif /* HAVE_ECC_KEY_EXPORT */
#ifdef HAVE_ECC_SIGN
#ifdef ECC_SHAMIR
/* test DSA sign hash with zeros */
for (i = 0; i < (int)sizeof(digest); i++) {
digest[i] = 0;
}
digest[i-1] = 1; /* Set last digit to non-zero value */
x = sizeof(sig);
ret = wc_ecc_sign_hash(digest, sizeof(digest), sig, &x, rng, &userA);
@ -6844,6 +6844,7 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
ERROR_OUT(-1016, done);
}
#endif /* HAVE_ECC_VERIFY */
#endif /* ECC_SHAMIR */
/* test DSA sign hash with sequence (0,1,2,3,4,...) */
for (i = 0; i < (int)sizeof(digest); i++) {