Skip to contentSkip to conversation

app/test: validate shorter private key in ECDSA P521 test

PATCH Applied Gowrishankar Muthukrishnan 2 participants 2 messages Aug 10, 2023 – Oct 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test: validate shorter private key in ECDSA P521 test

Update test vector of ECDSA P521 curve for validating private key of length shorter than prime length. As prime length of this test is not aligned by 8 bytes, this new test vector could test any alignment issue along with the sign validation.

---
 app/test/test_cryptodev_asym.c               |   6 +
 app/test/test_cryptodev_ecdsa_test_vectors.h | 120 ++++++++++++++++++-
 2 files changed, 125 insertions(+), 1 deletion(-)
app/test/test_cryptodev_asym.c +6 -0
index 0ef2642fdd..ef050f8b72 100644
@@ -1477,6 +1477,9 @@ test_ecdsa_sign_verify(enum curve curve_id)
 	case SECP521R1:
 		input_params = ecdsa_param_secp521r1;
 		break;
+	case SECP521R1_UA:
+		input_params = ecdsa_param_secp521r1_ua;
+		break;
 	default:
 		RTE_LOG(ERR, USER1,
 				"line %u FAILED: %s", __LINE__,
@@ -1792,6 +1795,9 @@ test_ecpm_all_curve(void)
 	const char *msg;
 
 	for (curve_id = SECP192R1; curve_id < END_OF_CURVE_LIST; curve_id++) {
+		if (curve_id == SECP521R1_UA)
+			continue;
+
 		status = test_ecpm(curve_id);
 		if (status == TEST_SUCCESS) {
 			msg = "succeeded";
app/test/test_cryptodev_ecdsa_test_vectors.h +119 -1

136 lines not on this page · raw message

Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 8 lines

Subject: [PATCH] app/test: validate shorter private key in ECDSA P521 test

Update test vector of ECDSA P521 curve for validating private key of length shorter than prime length. As prime length of this test is not aligned by 8 bytes, this new test vector could test any alignment issue along with the sign validation.

Applied to dpdk-next-crypto
Thanks.