Skip to contentSkip to conversation

test/crypto: add test vectors for more ML-KEM and ML-DSA variants

PATCH Applied Radu Nicolau 4 participants 7 messages Sep 17 – Oct 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/crypto: add test vectors for more ML-KEM and ML-DSA variants

Add test vectors for ML-KEM-768 and ML-KEM-1024 algorithms. Add test vectors for ML-DSA-65 and ML-DSA-87 algorithms. Increase ML test buffer sizes to accommodate larger buffers.

---
 app/test/test_cryptodev_asym.c                |   23 +-
 app/test/test_cryptodev_ml_dsa_test_vectors.h | 5876 +++++++++++++++++
 app/test/test_cryptodev_ml_kem_test_vectors.h | 2706 +++++++-
 3 files changed, 8593 insertions(+), 12 deletions(-)
app/test/test_cryptodev_asym.c +12 -11
index 7b8afe5f92..5893805802 100644
@@ -35,6 +35,7 @@
 #ifndef TEST_DATA_SIZE
 	#define TEST_DATA_SIZE 4096
 #endif
+#define ML_TEST_DATA_SIZE 8192
 #define ASYM_TEST_MSG_LEN 256
 #define TEST_VECTOR_SIZE 256
 #define DEQ_TIMEOUT 10000
@@ -3910,8 +3911,8 @@ mlkem_keygen(const void *test_data)
 	const struct crypto_testsuite_mlkem_params *vector = test_data;
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
-	uint8_t ek[TEST_DATA_SIZE] = {0};
-	uint8_t dk[TEST_DATA_SIZE] = {0};
+	uint8_t ek[ML_TEST_DATA_SIZE] = {0};
+	uint8_t dk[ML_TEST_DATA_SIZE] = {0};
 
 	xform.mlkem.type = vector->type;
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ML_KEM;
@@ -3969,9 +3970,9 @@ mlkem_encap(const void *test_data)
 	const struct crypto_testsuite_mlkem_params *vector = test_data;
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
-	uint8_t cipher[TEST_DATA_SIZE] = {0};
-	uint8_t skcopy[TEST_DATA_SIZE] = {0};
-	uint8_t sk[TEST_DATA_SIZE] = {0};
+	uint8_t cipher[ML_TEST_DATA_SIZE] = {0};
+	uint8_t skcopy[ML_TEST_DATA_SIZE] = {0};
+	uint8_t sk[ML_TEST_DATA_SIZE] = {0};
 	size_t cipher_len;
 
 	xform.mlkem.type = vector->type;
@@ -4093,8 +4094,8 @@ mlkem_decap(const void *test_data)
 	const struct crypto_testsuite_mlkem_params *vector = test_data;
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
-	uint8_t cipher[TEST_DATA_SIZE] = {0};
-	uint8_t sk[TEST_DATA_SIZE] = {0};
+	uint8_t cipher[ML_TEST_DATA_SIZE] = {0};
+	uint8_t sk[ML_TEST_DATA_SIZE] = {0};
 	size_t cipher_len;
 
 	xform.mlkem.type = vector->type;
@@ -4172,8 +4173,8 @@ mldsa_keygen(const void *test_data)
 	const struct crypto_testsuite_mldsa_params *vector = test_data;
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
-	uint8_t privkey[TEST_DATA_SIZE] = {0};
-	uint8_t pubkey[TEST_DATA_SIZE] = {0};
+	uint8_t privkey[ML_TEST_DATA_SIZE] = {0};
+	uint8_t pubkey[ML_TEST_DATA_SIZE] = {0};
 
 	xform.mldsa.type = vector->type;
 	xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ML_DSA;
@@ -4231,7 +4232,7 @@ mldsa_sign(const void *test_data)
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
 	struct rte_cryptodev_info dev_info;
-	uint8_t sign[TEST_DATA_SIZE] = {0};
+	uint8_t sign[ML_TEST_DATA_SIZE] = {0};
 	size_t sign_len;
 
 	xform.mldsa.type = vector->type;
@@ -4356,7 +4357,7 @@ mldsa_verify(const void *test_data)
 	const uint8_t dev_id = params->valid_devs[0];
 	struct rte_crypto_asym_xform xform = {0};
 	struct rte_cryptodev_info dev_info;
-	uint8_t sign[TEST_DATA_SIZE] = {0};
+	uint8_t sign[ML_TEST_DATA_SIZE] = {0};
 	size_t sign_len;
 
 	xform.mldsa.type = vector->type;
app/test/test_cryptodev_ml_dsa_test_vectors.h +5876 -0

2,935 lines not on this page · raw message

app/test/test_cryptodev_ml_kem_test_vectors.h +2705 -1

2,706 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.52.0

Part of the diff is not shown here. View the raw message.

#2 lore raw
Quoted 5 lines · Gowrishankar Muthukrishnan

Hi,

There is a series already proposed for extending the autotest :

Quoted 8 lines

https://patches.dpdk.org/project/dpdk/list/?series=39137

Can you please check if that helps ?.

Regards,

Gowrishankar M

Hi, I will have a look at all the patches, they look indeed that the already cover what I did – I will pull mine down.

Thanks,
Radu

#3 lore raw
Quoted 12 lines · Radu Nicolau
Quoted 9 lines · Gowrishankar Muthukrishnan

Hi,

There is a series already proposed for extending the autotest :

https://patches.dpdk.org/project/dpdk/list/?series=39137

Can you please check if that helps ?.

Quoted 9 lines
Quoted 4 lines

Regards,

Gowrishankar M

Hi, I will have a look at all the patches, they look indeed that the already cover what I did – I will pull mine down.

Thanks,
Radu

Hi,

I tried to test the patchsets - the one for cryptoperf cannot be merged, and the one for the test app doesn't have all the test cases (e.g. there is no mldsa_65_verify(deterministic) test case).

#4 lore raw
Quoted 33 lines · Radu Nicolau
Quoted 9 lines · Gowrishankar Muthukrishnan

Hi,

There is a series already proposed for extending the autotest:
[DPDK patch series 39137]

Can you please check if that helps?

Regards,
Gowrishankar M

Hi,
I will have a look at all the patches, they look indeed that they already cover what I did, so I will pull mine down.

Thanks,
Radu

Hi,

I tried to test the patchsets. The one for cryptoperf cannot be merged, and the one for the test app doesn't have all the test cases (e.g. there is no mldsa_65_verify(deterministic) test case).

Quoted 8 lines

Hi,
Thanks for looking into the patches I'll fix the cryptoperf patchset for the merge issue and any comments on it and send the v2 patch-set. For the remaining test-cases, I have patch-sets ready, I'll send another v1 patchset right away.

Thanks,
Pratik

#5 lore raw
Quoted 8 lines

Hi,
Thanks for looking into the patches I'll fix the cryptoperf patchset for the merge issue and any comments on it and send the v2 patch-set. For the remaining test-cases, I have patch-sets ready, I'll send another v1 patchset right away.

Thanks,
Pratik

Hi Radu,

Sending ack here:

Thanks,

Pratik Senapati