Skip to content

Commit 413b997

Browse files
committed
ecc_sign_determinisitic.c test for for deterministic ECDSA Prime Field for SECP256R1, SECP384R1, and SECP521R .gitignore addition and binary file exclusion.
1 parent 49bfb70 commit 413b997

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ pk/rsa-pss/sign.txt
224224
pk/rsa/rsa-nb
225225
pk/ecc/ecc_verify
226226
pk/ecc/ecc_sign
227+
pk/ecc/ecc_sign_determinisitc
227228
pk/ecc/ecc_pub
228229
pk/ecc/ecc_keys
229230

pk/ecc/ecc_sign_deterministic

-34.5 KB
Binary file not shown.

pk/ecc/ecc_sign_deterministic.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ int main()
466466
uint8_t sig[ECC_KEY_SIZE*2];
467467
uint32_t sigSz = 0;
468468

469-
#ifdef DEBUG_WOLFSSL
470-
wolfSSL_Debugging_ON();
471-
#endif
469+
#ifdef DEBUG_WOLFSSL
470+
wolfSSL_Debugging_ON();
471+
#endif
472472

473-
if (ECC_KEY_SIZE == 66)
474-
printf("Running NIST P-%d,SHA-%d Deterministic Sign Test\n", (ECC_KEY_SIZE*8)-7, DIGEST_SZ*8);
475-
else
476-
printf("Running NIST P-%d,SHA-%d Deterministic Sign Test\n", (ECC_KEY_SIZE*8), DIGEST_SZ*8);
473+
if (ECC_KEY_SIZE == 66)
474+
printf("Running NIST P-%d,SHA-%d Deterministic Sign Test\n", (ECC_KEY_SIZE*8)-7, DIGEST_SZ*8);
475+
else
476+
printf("Running NIST P-%d,SHA-%d Deterministic Sign Test\n", (ECC_KEY_SIZE*8), DIGEST_SZ*8);
477477

478478
memset(sig, 0, sizeof(sig));
479479

@@ -487,9 +487,6 @@ else
487487
print_hex(hash, sizeof(hash));
488488

489489
/* Sign hash using private key */
490-
/* Note: result of an ECC sign varies for each call even with same
491-
private key and hash. This is because a new random public key is
492-
used for each operation. */
493490
sigSz = sizeof(sig);
494491
ret = crypto_ecc_sign(
495492
kPrivKey, sizeof(kPrivKey), /* private key */

0 commit comments

Comments
 (0)