* [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V
@ 2025-04-08 11:19 Radu Nicolau
2025-04-08 11:19 ` [PATCH 2/5] examples/l2fwd-crypto: " Radu Nicolau
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Radu Nicolau @ 2025-04-08 11:19 UTC (permalink / raw)
To: Kai Ji, Pablo de Lara; +Cc: dev, Radu Nicolau
Add support for SNOW-V and SNOW-V AEAD algorithms to
crypto/ipsec_mb PMD.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
doc/guides/cryptodevs/aesni_mb.rst | 2 +
drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 70 +++++++++++++++++++--
drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 52 +++++++++++++++
3 files changed, 120 insertions(+), 4 deletions(-)
diff --git a/doc/guides/cryptodevs/aesni_mb.rst b/doc/guides/cryptodevs/aesni_mb.rst
index 8d7e221e79..383c4a55ce 100644
--- a/doc/guides/cryptodevs/aesni_mb.rst
+++ b/doc/guides/cryptodevs/aesni_mb.rst
@@ -39,6 +39,7 @@ Cipher algorithms:
* RTE_CRYPTO_CIPHER_SM4_CBC
* RTE_CRYPTO_CIPHER_SM4_ECB
* RTE_CRYPTO_CIPHER_SM4_CTR
+* RTE_CRYPTO_CIPHER_SNOW_V
Hash algorithms:
@@ -68,6 +69,7 @@ AEAD algorithms:
* RTE_CRYPTO_AEAD_AES_GCM
* RTE_CRYPTO_AEAD_CHACHA20_POLY1305
* RTE_CRYPTO_AEAD_SM4_GCM
+* RTE_CRYPTO_AEAD_SNOW_V
Protocol offloads:
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index a6c3f09b6f..87155305bb 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -20,7 +20,8 @@ is_aead_algo(IMB_HASH_ALG hash_alg, IMB_CIPHER_MODE cipher_mode)
{
return (hash_alg == IMB_AUTH_CHACHA20_POLY1305 ||
hash_alg == IMB_AUTH_AES_CCM ||
- cipher_mode == IMB_CIPHER_GCM
+ cipher_mode == IMB_CIPHER_GCM ||
+ cipher_mode == IMB_CIPHER_SNOW_V_AEAD
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
|| cipher_mode == IMB_CIPHER_SM4_GCM
#endif
@@ -353,6 +354,7 @@ aesni_mb_set_session_cipher_parameters(const IMB_MGR *mb_mgr,
uint8_t is_zuc = 0;
uint8_t is_snow3g = 0;
uint8_t is_kasumi = 0;
+ uint8_t is_snow_v = 0;
#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
uint8_t is_sm4 = 0;
#endif
@@ -416,6 +418,10 @@ aesni_mb_set_session_cipher_parameters(const IMB_MGR *mb_mgr,
sess->template_job.cipher_mode = IMB_CIPHER_SNOW3G_UEA2_BITLEN;
is_snow3g = 1;
break;
+ case RTE_CRYPTO_CIPHER_SNOW_V:
+ sess->template_job.cipher_mode = IMB_CIPHER_SNOW_V;
+ is_snow_v = 1;
+ break;
case RTE_CRYPTO_CIPHER_KASUMI_F8:
sess->template_job.cipher_mode = IMB_CIPHER_KASUMI_UEA1_BITLEN;
is_kasumi = 1;
@@ -576,6 +582,17 @@ aesni_mb_set_session_cipher_parameters(const IMB_MGR *mb_mgr,
&sess->cipher.pKeySched_kasumi_cipher);
sess->template_job.enc_keys = &sess->cipher.pKeySched_kasumi_cipher;
sess->template_job.dec_keys = &sess->cipher.pKeySched_kasumi_cipher;
+ } else if (is_snow_v) {
+ if (xform->cipher.key.length != 32) {
+ IPSEC_MB_LOG(ERR, "Invalid cipher key length");
+ return -EINVAL;
+ }
+ sess->template_job.key_len_in_bytes = 32;
+ sess->template_job.iv_len_in_bytes = 16;
+ memcpy(sess->cipher.snow_v_cipher_key, xform->cipher.key.data,
+ xform->cipher.key.length);
+ sess->template_job.enc_keys = sess->cipher.snow_v_cipher_key;
+ sess->template_job.dec_keys = sess->cipher.snow_v_cipher_key;
#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
} else if (is_sm4) {
sess->template_job.key_len_in_bytes = IMB_KEY_128_BYTES;
@@ -724,6 +741,26 @@ aesni_mb_set_session_aead_parameters(IMB_MGR *mb_mgr,
return -EINVAL;
}
break;
+ case RTE_CRYPTO_AEAD_SNOW_V:
+ sess->template_job.cipher_mode = IMB_CIPHER_SNOW_V_AEAD;
+ sess->template_job.hash_alg = IMB_AUTH_SNOW_V_AEAD;
+ sess->template_job.u.SNOW_V_AEAD.aad_len_in_bytes =
+ xform->aead.aad_length;
+
+ if (xform->aead.key.length != 32) {
+ IPSEC_MB_LOG(ERR, "Invalid key length");
+ return -EINVAL;
+ }
+ sess->template_job.key_len_in_bytes = 32;
+ memcpy(sess->cipher.snow_v_cipher_key, xform->cipher.key.data,
+ xform->cipher.key.length);
+ sess->template_job.enc_keys = sess->cipher.snow_v_cipher_key;
+ sess->template_job.dec_keys = sess->cipher.snow_v_cipher_key;
+ if (sess->auth.req_digest_len != 16) {
+ IPSEC_MB_LOG(ERR, "Invalid digest size");
+ return -EINVAL;
+ }
+ break;
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
case RTE_CRYPTO_AEAD_SM4_GCM:
sess->template_job.cipher_mode = IMB_CIPHER_SM4_GCM;
@@ -1058,6 +1095,10 @@ set_cpu_mb_job_params(IMB_JOB *job, struct aesni_mb_session *session,
job->u.CHACHA20_POLY1305.aad = aad->va;
break;
+ case IMB_AUTH_SNOW_V_AEAD:
+ job->u.SNOW_V_AEAD.aad = aad->va;
+ break;
+
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
case IMB_AUTH_SM4_GCM:
job->u.GCM.aad = aad->va;
@@ -1440,7 +1481,8 @@ aesni_mb_digest_appended_in_src(struct rte_crypto_op *op, IMB_JOB *job,
if (job->cipher_mode == IMB_CIPHER_ZUC_EEA3 ||
job->cipher_mode == IMB_CIPHER_SNOW3G_UEA2_BITLEN ||
- job->cipher_mode == IMB_CIPHER_KASUMI_UEA1_BITLEN) {
+ job->cipher_mode == IMB_CIPHER_KASUMI_UEA1_BITLEN ||
+ job->cipher_mode == IMB_CIPHER_SNOW_V) {
cipher_size = (op->sym->cipher.data.offset >> 3) +
(op->sym->cipher.data.length >> 3);
} else {
@@ -1586,6 +1628,9 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
imb_set_session(mb_mgr, job);
}
break;
+ case IMB_AUTH_SNOW_V_AEAD:
+ job->u.SNOW_V_AEAD.aad = op->sym->aead.aad.data;
+ break;
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
case IMB_AUTH_SM4_GCM:
job->u.GCM.aad = op->sym->aead.aad.data;
@@ -1606,6 +1651,8 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
m_offset = 0;
else if (cipher_mode == IMB_CIPHER_KASUMI_UEA1_BITLEN)
m_offset = 0;
+ else if (cipher_mode == IMB_CIPHER_SNOW_V)
+ m_offset = 0;
/* Set digest output location */
if (job->hash_alg != IMB_AUTH_NULL &&
@@ -1719,6 +1766,14 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
job->iv = rte_crypto_op_ctod_offset(op, uint8_t *,
session->iv.offset);
break;
+ case IMB_AUTH_SNOW_V_AEAD:
+ job->hash_start_src_offset_in_bytes =
+ op->sym->aead.data.offset;
+ job->msg_len_to_hash_in_bytes =
+ op->sym->aead.data.length;
+ job->iv = rte_crypto_op_ctod_offset(op, uint8_t *,
+ session->iv.offset);
+ break;
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
case IMB_AUTH_SM4_GCM:
job->hash_start_src_offset_in_bytes = 0;
@@ -1747,8 +1802,9 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
}
switch (job->cipher_mode) {
- /* ZUC requires length and offset in bytes */
+ /* ZUC and SNOW V requires length and offset in bytes */
case IMB_CIPHER_ZUC_EEA3:
+ case IMB_CIPHER_SNOW_V:
job->cipher_start_src_offset_in_bytes =
op->sym->cipher.data.offset >> 3;
job->msg_len_to_cipher_in_bytes =
@@ -1778,6 +1834,11 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,
job->msg_len_to_cipher_in_bytes = 0;
job->cipher_start_src_offset_in_bytes = 0;
break;
+ case IMB_CIPHER_SNOW_V_AEAD:
+ job->cipher_start_src_offset_in_bytes =
+ op->sym->aead.data.offset;
+ job->msg_len_to_cipher_in_bytes = op->sym->aead.data.length;
+ break;
#if IMB_VERSION(1, 5, 0) < IMB_VERSION_NUM
case IMB_CIPHER_SM4_GCM:
job->msg_len_to_cipher_in_bytes = op->sym->aead.data.length;
@@ -2034,7 +2095,8 @@ post_process_mb_job(struct ipsec_mb_qp *qp, IMB_JOB *job)
int unencrypted_bytes = 0;
if (job->cipher_mode == IMB_CIPHER_SNOW3G_UEA2_BITLEN ||
job->cipher_mode == IMB_CIPHER_KASUMI_UEA1_BITLEN ||
- job->cipher_mode == IMB_CIPHER_ZUC_EEA3) {
+ job->cipher_mode == IMB_CIPHER_ZUC_EEA3 ||
+ job->cipher_mode == IMB_CIPHER_SNOW_V) {
cipher_size = (op->sym->cipher.data.offset >> 3) +
(op->sym->cipher.data.length >> 3);
} else {
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 66e8e732ff..6f2eb27ba3 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -725,6 +725,56 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
}, }
}, }
},
+ { /* SNOW V */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+ {.cipher = {
+ .algo = RTE_CRYPTO_CIPHER_SNOW_V,
+ .block_size = 16,
+ .key_size = {
+ .min = 32,
+ .max = 32,
+ .increment = 0
+ },
+ .iv_size = {
+ .min = 16,
+ .max = 16,
+ .increment = 0
+ }
+ }, }
+ }, }
+ },
+ { /* SNOW V AEAD */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,
+ {.aead = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .block_size = 64,
+ .key_size = {
+ .min = 32,
+ .max = 32,
+ .increment = 0
+ },
+ .digest_size = {
+ .min = 16,
+ .max = 16,
+ .increment = 0
+ },
+ .aad_size = {
+ .min = 0,
+ .max = 1024,
+ .increment = 1
+ },
+ .iv_size = {
+ .min = 16,
+ .max = 16,
+ .increment = 0
+ },
+ }, }
+ }, }
+ },
#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
{ /* SM3 */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
@@ -1028,6 +1078,8 @@ struct __rte_cache_aligned aesni_mb_session {
/* *< Expanded GCM key */
uint8_t zuc_cipher_key[32];
/* *< ZUC cipher key */
+ uint8_t snow_v_cipher_key[32];
+ /* *< SNOW V cipher key */
snow3g_key_schedule_t pKeySched_snow3g_cipher;
/* *< SNOW3G scheduled cipher key */
kasumi_key_sched_t pKeySched_kasumi_cipher;
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/5] examples/l2fwd-crypto: add support for SNOW-V
2025-04-08 11:19 [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V Radu Nicolau
@ 2025-04-08 11:19 ` Radu Nicolau
2025-04-08 11:19 ` [PATCH 3/5] tests: add unit tests and test vectors " Radu Nicolau
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Radu Nicolau @ 2025-04-08 11:19 UTC (permalink / raw)
To: Akhil Goyal, Fan Zhang; +Cc: dev, kai.ji, Radu Nicolau
Update l2fwd-crypto to be able to correctly handle SNOW-V
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
examples/l2fwd-crypto/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index a441312f55..f1a6ca8899 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -508,7 +508,8 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
/* For wireless algorithms, offset/length must be in bits */
if (cparams->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
cparams->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
- cparams->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3) {
+ cparams->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3 ||
+ cparams->cipher_algo == RTE_CRYPTO_CIPHER_SNOW_V) {
op->sym->cipher.data.offset = ipdata_offset << 3;
op->sym->cipher.data.length = data_len << 3;
} else {
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/5] tests: add unit tests and test vectors for SNOW-V
2025-04-08 11:19 [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V Radu Nicolau
2025-04-08 11:19 ` [PATCH 2/5] examples/l2fwd-crypto: " Radu Nicolau
@ 2025-04-08 11:19 ` Radu Nicolau
2025-04-08 11:19 ` [PATCH 4/5] app/crypto-perf: add support " Radu Nicolau
2025-04-08 11:19 ` [PATCH 5/5] app/eventdev: update eventdev app " Radu Nicolau
3 siblings, 0 replies; 5+ messages in thread
From: Radu Nicolau @ 2025-04-08 11:19 UTC (permalink / raw)
To: Akhil Goyal, Fan Zhang; +Cc: dev, kai.ji, Radu Nicolau
Add unit tests and test vectors for SNOW-V and SNOW-V AEAD.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
app/test/test_cryptodev.c | 337 ++++++++++++++++++
app/test/test_cryptodev_aead_test_vectors.h | 285 +++++++++++++++
app/test/test_cryptodev_snow_v_test_vectors.h | 213 +++++++++++
3 files changed, 835 insertions(+)
create mode 100644 app/test/test_cryptodev_snow_v_test_vectors.h
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 31a4905a97..f15933d57b 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -43,6 +43,7 @@
#include "test_cryptodev_kasumi_hash_test_vectors.h"
#include "test_cryptodev_snow3g_test_vectors.h"
#include "test_cryptodev_snow3g_hash_test_vectors.h"
+#include "test_cryptodev_snow_v_test_vectors.h"
#include "test_cryptodev_zuc_test_vectors.h"
#include "test_cryptodev_aead_test_vectors.h"
#include "test_cryptodev_hmac_test_vectors.h"
@@ -1205,6 +1206,60 @@ snow3g_testsuite_setup(void)
return 0;
}
+static int
+snow_v_testsuite_setup(void)
+{
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_cryptodev_info dev_info;
+ const enum rte_crypto_cipher_algorithm ciphers[] = {
+ RTE_CRYPTO_CIPHER_SNOW_V,
+ };
+
+ rte_cryptodev_info_get(dev_id, &dev_info);
+
+ if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO)) {
+ RTE_LOG(INFO, USER1, "Feature flag requirements for SNOW V "
+ "testsuite not met\n");
+ return TEST_SKIPPED;
+ }
+
+ if (check_cipher_capabilities_supported(ciphers, RTE_DIM(ciphers)) != 0) {
+ RTE_LOG(INFO, USER1, "Capability requirements for SNOW V "
+ "testsuite not met\n");
+ return TEST_SKIPPED;
+ }
+
+ return 0;
+}
+
+static int
+snow_v_aead_testsuite_setup(void)
+{
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_cryptodev_info dev_info;
+ const enum rte_crypto_aead_algorithm aeads[] = {
+ RTE_CRYPTO_AEAD_SNOW_V,
+ };
+
+ rte_cryptodev_info_get(dev_id, &dev_info);
+
+ if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO)) {
+ RTE_LOG(INFO, USER1, "Feature flag requirements for SNOW V AEAD "
+ "testsuite not met\n");
+ return TEST_SKIPPED;
+ }
+
+ if (check_aead_capabilities_supported(aeads, RTE_DIM(aeads)) != 0) {
+ RTE_LOG(INFO, USER1, "Capability requirements for SNOW V AEAD "
+ "testsuite not met\n");
+ return TEST_SKIPPED;
+ }
+
+ return 0;
+}
+
static int
zuc_testsuite_setup(void)
{
@@ -8294,6 +8349,201 @@ test_zuc256_auth_cipher_verify_16b_tag_test_case_1(void)
&zuc256_auth_cipher_test_case_4, IN_PLACE, 1);
}
+static int
+test_snow_v_encryption(const struct snow_v_test_data *tdata,
+ uint8_t mode, uint8_t sgl_in, uint8_t sgl_out)
+{
+ struct crypto_testsuite_params *ts_params = &testsuite_params;
+ struct crypto_unittest_params *ut_params = &unittest_params;
+
+ int retval;
+ unsigned int plaintext_pad_len;
+ unsigned int plaintext_len;
+ uint8_t buffer[10000];
+ const uint8_t *ciphertext;
+
+ struct rte_cryptodev_info dev_info;
+
+ /* Verify the capabilities */
+ struct rte_cryptodev_sym_capability_idx cap_idx;
+ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+ cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;
+ if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+ &cap_idx) == NULL)
+ return TEST_SKIPPED;
+
+ if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
+ return TEST_SKIPPED;
+
+ if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+ return TEST_SKIPPED;
+
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+ uint64_t feat_flags = dev_info.feature_flags;
+
+ if (((sgl_in && sgl_out) && !(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT))
+ || ((!sgl_in && sgl_out) &&
+ !(feat_flags & RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT))
+ || ((sgl_in && !sgl_out) &&
+ !(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT))) {
+ printf("Device doesn't support out-of-place scatter gather type. "
+ "Test Skipped.\n");
+ return TEST_SKIPPED;
+ }
+
+ if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
+ (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
+ printf("Device does not support RAW data-path APIs.\n");
+ return -ENOTSUP;
+ }
+
+ /* Create SNOW V session */
+ retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
+ RTE_CRYPTO_CIPHER_OP_ENCRYPT,
+ RTE_CRYPTO_CIPHER_SNOW_V,
+ tdata->key.data, tdata->key.len,
+ tdata->cipher_iv.len);
+ if (retval < 0)
+ return retval;
+
+ plaintext_len = ceil_byte_length(tdata->plaintext.len);
+ /* Append data which is padded to a multiple of */
+ /* the algorithms block size */
+ plaintext_pad_len = RTE_ALIGN_CEIL(plaintext_len, 16);
+
+ if (sgl_in)
+ ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool,
+ plaintext_pad_len, 10, 0);
+ else {
+ ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+ rte_pktmbuf_append(ut_params->ibuf, plaintext_pad_len);
+ }
+ TEST_ASSERT_NOT_NULL(ut_params->ibuf,
+ "Failed to allocate input buffer in mempool");
+
+ if (mode == OUT_OF_PLACE) {
+ if (sgl_out)
+ ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool,
+ plaintext_pad_len, 3, 0);
+ else {
+ ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+ rte_pktmbuf_append(ut_params->obuf, plaintext_pad_len);
+ }
+ TEST_ASSERT_NOT_NULL(ut_params->obuf,
+ "Failed to allocate output buffer in mempool");
+ }
+
+ pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata->plaintext.data);
+
+ /* Create SNOW V operation */
+ if (mode == OUT_OF_PLACE) {
+ retval = create_wireless_algo_cipher_operation_oop(tdata->cipher_iv.data,
+ tdata->cipher_iv.len,
+ tdata->ciphertext.len,
+ 0);
+ if (retval < 0)
+ return retval;
+ } else {
+ retval = create_wireless_algo_cipher_operation(tdata->cipher_iv.data,
+ tdata->cipher_iv.len,
+ tdata->ciphertext.len,
+ 0);
+ if (retval < 0)
+ return retval;
+ }
+
+ if (global_api_test_type == CRYPTODEV_RAW_API_TEST) {
+ retval = process_sym_raw_dp_op(ts_params->valid_devs[0], 0, ut_params->op, 1, 0, 1,
+ tdata->cipher_iv.len);
+ if (retval != TEST_SUCCESS)
+ return retval;
+ } else
+ ut_params->op = process_crypto_request(ts_params->valid_devs[0],
+ ut_params->op);
+ TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
+
+ ut_params->obuf = ut_params->op->sym->m_dst;
+ if (ut_params->obuf)
+ ciphertext = rte_pktmbuf_read(ut_params->obuf, 0,
+ plaintext_len, buffer);
+ else
+ ciphertext = rte_pktmbuf_read(ut_params->ibuf, 0,
+ plaintext_len, buffer);
+
+ debug_hexdump(stdout, "ciphertext:", ciphertext, plaintext_len);
+
+ /* Validate obuf */
+ TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+ ciphertext,
+ tdata->ciphertext.data,
+ tdata->ciphertext.len,
+ "SNOW V Ciphertext data not as expected");
+
+ return 0;
+}
+
+static int
+test_snow_v_encryption_test_case_1(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_1, IN_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_1_oop(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_1, OUT_OF_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_1_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_1, IN_PLACE, 1, 1);
+}
+static int
+test_snow_v_encryption_test_case_1_oop_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_1, OUT_OF_PLACE, 1, 1);
+}
+static int
+test_snow_v_encryption_test_case_2(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_2, IN_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_2_oop(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_2, OUT_OF_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_2_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_2, IN_PLACE, 1, 1);
+}
+static int
+test_snow_v_encryption_test_case_2_oop_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_2, OUT_OF_PLACE, 1, 1);
+}
+static int
+test_snow_v_encryption_test_case_3(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_3, IN_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_3_oop(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_3, OUT_OF_PLACE, 0, 0);
+}
+static int
+test_snow_v_encryption_test_case_3_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_3, IN_PLACE, 1, 1);
+}
+static int
+test_snow_v_encryption_test_case_3_oop_sgl(void)
+{
+ return test_snow_v_encryption(&snow_v_test_case_3, OUT_OF_PLACE, 1, 1);
+}
+
static int
test_mixed_check_if_unsupported(const struct mixed_cipher_auth_test_data *tdata)
{
@@ -17652,6 +17902,36 @@ test_SM4_GCM_case_15(void)
return test_authenticated_encryption(&sm4_gcm_case_15);
}
+static int
+test_snow_v_aead_test_case_1(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_1);
+}
+static int
+test_snow_v_aead_test_case_2(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_2);
+}
+static int
+test_snow_v_aead_test_case_3(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_3);
+}
+static int
+test_snow_v_aead_test_case_4(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_4);
+}
+static int
+test_snow_v_aead_test_case_5(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_5);
+}
+static int
+test_snow_v_aead_test_case_6(void)
+{
+ return test_authenticated_encryption(&snow_v_aead_case_6);
+}
#ifdef RTE_CRYPTO_SCHEDULER
/* global AESNI worker IDs for the scheduler test */
@@ -19300,6 +19580,60 @@ static struct unit_test_suite cryptodev_snow3g_testsuite = {
}
};
+static struct unit_test_suite cryptodev_snow_v_testsuite = {
+ .suite_name = "SNOW V Test Suite",
+ .setup = snow_v_testsuite_setup,
+ .unit_test_cases = {
+ /** SNOW V encrypt only */
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_1),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_1_oop),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_1_sgl),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_1_oop_sgl),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_2),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_2_oop),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_2_sgl),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_2_oop_sgl),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_3),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_3_oop),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_3_sgl),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_encryption_test_case_3_oop_sgl),
+ TEST_CASES_END()
+ }
+};
+
+static struct unit_test_suite cryptodev_snow_v_aead_testsuite = {
+ .suite_name = "SNOW V AEAD Test Suite",
+ .setup = snow_v_aead_testsuite_setup,
+ .unit_test_cases = {
+ /** SNOW V AEAD Tests */
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_1),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_2),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_3),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_4),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_5),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ test_snow_v_aead_test_case_6),
+ TEST_CASES_END()
+ }
+};
+
static struct unit_test_suite cryptodev_zuc_testsuite = {
.suite_name = "ZUC Test Suite",
.setup = zuc_testsuite_setup,
@@ -19820,6 +20154,8 @@ run_cryptodev_testsuite(const char *pmd_name)
&cryptodev_aes_gcm_auth_testsuite,
&cryptodev_aes_gmac_auth_testsuite,
&cryptodev_snow3g_testsuite,
+ &cryptodev_snow_v_testsuite,
+ &cryptodev_snow_v_aead_testsuite,
&cryptodev_chacha20_poly1305_testsuite,
&cryptodev_zuc_testsuite,
&cryptodev_hmac_md5_auth_testsuite,
@@ -19839,6 +20175,7 @@ run_cryptodev_testsuite(const char *pmd_name)
&dtls12_record_proto_testsuite,
&tls13_record_proto_testsuite,
#endif
+
&end_testsuite
};
static struct unit_test_suite ts = {
diff --git a/app/test/test_cryptodev_aead_test_vectors.h b/app/test/test_cryptodev_aead_test_vectors.h
index 73bedaf557..e1c7740e16 100644
--- a/app/test/test_cryptodev_aead_test_vectors.h
+++ b/app/test/test_cryptodev_aead_test_vectors.h
@@ -4828,4 +4828,289 @@ static const struct aead_test_data sm4_gcm_case_15 = {
}
};
+
+
+/*
+ * SNOW-V AEAD test vector 1
+ */
+static const struct aead_test_data snow_v_aead_case_1 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = 0,
+ .len = 0
+ },
+ .plaintext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .ciphertext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .auth_tag = {
+ .data = {
+ 0x02, 0x9a, 0x62, 0x4c, 0xda, 0xa4, 0xd4, 0x6c, 0xb9,
+ 0xa0, 0xef, 0x40, 0x46, 0x95, 0x6c, 0x9f
+ },
+ .len = 16
+ }
+};
+
+
+/*
+ * SNOW-V AEAD test vector 2
+ */
+static const struct aead_test_data snow_v_aead_case_2 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a,
+ 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = 0,
+ .len = 0
+ },
+ .plaintext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .ciphertext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .auth_tag = {
+ .data = {
+ 0xfc, 0x7c, 0xac, 0x57, 0x4c, 0x49, 0xfe, 0xae,
+ 0x61, 0x50, 0x31, 0x5b, 0x96, 0x85, 0x42, 0x4c
+ },
+ .len = 16
+ }
+};
+
+/*
+ * SNOW-V AEAD test vector 3
+ */
+static uint8_t snow_v_aad_3[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66
+};
+static const struct aead_test_data snow_v_aead_case_3 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = snow_v_aad_3,
+ .len = 16
+ },
+ .plaintext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .ciphertext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .auth_tag = {
+ .data = {
+ 0x5a, 0x5a, 0xa5, 0xfb, 0xd6, 0x35, 0xef, 0x1a,
+ 0xe1, 0x29, 0x61, 0x42, 0x03, 0xe1, 0x03, 0x84
+ },
+ .len = 16
+ }
+};
+
+/*
+ * SNOW-V AEAD test vector 4
+ */
+static uint8_t snow_v_aad_4[] = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66
+};
+static const struct aead_test_data snow_v_aead_case_4 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a,
+ 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = snow_v_aad_4,
+ .len = 16
+ },
+ .plaintext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .ciphertext = {
+ .data = { 0 },
+ .len = 0
+ },
+ .auth_tag = {
+ .data = {
+ 0x25, 0x0e, 0xc8, 0xd7, 0x7a, 0x02, 0x2c, 0x08,
+ 0x7a, 0xdf, 0x08, 0xb6, 0x5a, 0xdc, 0xbb, 0x1a
+ },
+ .len = 16
+ }
+};
+
+/*
+ * SNOW-V AEAD test vector 5
+ */
+static uint8_t snow_v_aad_5[] = {
+ 0x41, 0x41, 0x44, 0x20, 0x74, 0x65, 0x73, 0x74,
+ 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x21
+};
+static const struct aead_test_data snow_v_aead_case_5 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a,
+ 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = snow_v_aad_5,
+ .len = 15
+ },
+ .plaintext = {
+ .data = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
+ 0x20, 0x53, 0x6e, 0x6f, 0x77, 0x56, 0x2d, 0x41,
+ 0x45, 0x41, 0x44, 0x20, 0x6d, 0x6f, 0x64, 0x65,
+ 0x21
+ },
+ .len = 33
+ },
+ .ciphertext = {
+ .data = {
+ 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef,
+ 0x82, 0x50, 0x27, 0x07, 0xe8, 0x7a, 0x32, 0xc1,
+ 0x52, 0xb0, 0xd0, 0x18, 0x18, 0xfd, 0x7f, 0x12,
+ 0x24, 0x3e, 0xb5, 0xa1, 0x56, 0x59, 0xe9, 0x1b,
+ 0x4c
+ },
+ .len = 33
+ },
+ .auth_tag = {
+ .data = {
+ 0x90, 0x7e, 0xa6, 0xa5, 0xb7, 0x3a, 0x51, 0xde,
+ 0x74, 0x7c, 0x3e, 0x9a, 0xd9, 0xee, 0x02, 0x9b
+ },
+ .len = 16
+ }
+};
+
+/*
+ * SNOW-V AEAD test vector 6
+ */
+static const struct aead_test_data snow_v_aead_case_6 = {
+ .algo = RTE_CRYPTO_AEAD_SNOW_V,
+ .key = {
+ .data = {
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a,
+ 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa
+ },
+ .len = 32
+ },
+ .iv = {
+ .data = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ .len = 16
+ },
+ .aad = {
+ .data = 0,
+ .len = 0
+ },
+ .plaintext = {
+ .data = {
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39},
+ .len = 10
+ },
+ .ciphertext = {
+ .data = {
+ 0xdd, 0x7e, 0x01, 0xb2, 0xb4, 0x24, 0xa2, 0xef,
+ 0x82, 0x50
+ },
+ .len = 10
+ },
+ .auth_tag = {
+ .data = {
+ 0xdd, 0xfe, 0x4e, 0x31, 0xe7, 0xbf, 0xe6, 0x90,
+ 0x23, 0x31, 0xec, 0x5c, 0xe3, 0x19, 0xd9, 0x0d
+ },
+ .len = 16
+ }
+};
+
+
#endif /* TEST_CRYPTODEV_AEAD_TEST_VECTORS_H_ */
diff --git a/app/test/test_cryptodev_snow_v_test_vectors.h b/app/test/test_cryptodev_snow_v_test_vectors.h
new file mode 100644
index 0000000000..030cccb989
--- /dev/null
+++ b/app/test/test_cryptodev_snow_v_test_vectors.h
@@ -0,0 +1,213 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2015-2025 Intel Corporation
+ */
+
+#ifndef TEST_CRYPTODEV_SNOW_V_TEST_VECTORS_H_
+#define TEST_CRYPTODEV_SNOW_V_TEST_VECTORS_H_
+
+struct snow_v_test_data {
+ struct {
+ uint8_t data[64];
+ unsigned int len;
+ } key;
+
+ struct {
+ alignas(16) uint8_t data[64];
+ unsigned int len;
+ } cipher_iv;
+
+ struct {
+ uint8_t data[1024];
+ unsigned int len; /* length must be in Bits */
+ } plaintext;
+
+ struct {
+ uint8_t data[1024];
+ unsigned int len; /* length must be in Bits */
+ } ciphertext;
+};
+
+struct snow_v_test_data snow_v_test_case_1 = {
+ .key = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 32
+ },
+ .cipher_iv = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 16
+ },
+ .plaintext = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 1024
+ },
+ .ciphertext = {
+ .data = {
+ 0x69, 0xca, 0x6d, 0xaf, 0x9a, 0xe3, 0xb7, 0x2d,
+ 0xb1, 0x34, 0xa8, 0x5a, 0x83, 0x7e, 0x41, 0x9d,
+ 0xec, 0x08, 0xaa, 0xd3, 0x9d, 0x7b, 0x0f, 0x00,
+ 0x9b, 0x60, 0xb2, 0x8c, 0x53, 0x43, 0x00, 0xed,
+ 0x84, 0xab, 0xf5, 0x94, 0xfb, 0x08, 0xa7, 0xf1,
+ 0xf3, 0xa2, 0xdf, 0x18, 0xe6, 0x17, 0x68, 0x3b,
+ 0x48, 0x1f, 0xa3, 0x78, 0x07, 0x9d, 0xcf, 0x04,
+ 0xdb, 0x53, 0xb5, 0xd6, 0x29, 0xa9, 0xeb, 0x9d,
+ 0x03, 0x1c, 0x15, 0x9d, 0xcc, 0xd0, 0xa5, 0x0c,
+ 0x4d, 0x5d, 0xbf, 0x51, 0x15, 0xd8, 0x70, 0x39,
+ 0xc0, 0xd0, 0x3c, 0xa1, 0x37, 0x0c, 0x19, 0x40,
+ 0x03, 0x47, 0xa0, 0xb4, 0xd2, 0xe9, 0xdb, 0xe5,
+ 0xcb, 0xca, 0x60, 0x82, 0x14, 0xa2, 0x65, 0x82,
+ 0xcf, 0x68, 0x09, 0x16, 0xb3, 0x45, 0x13, 0x21,
+ 0x95, 0x4f, 0xdf, 0x30, 0x84, 0xaf, 0x02, 0xf6,
+ 0xa8, 0xe2, 0x48, 0x1d, 0xe6, 0xbf, 0x82, 0x79
+ },
+ .len = 1024
+ },
+};
+
+struct snow_v_test_data snow_v_test_case_2 = {
+ .key = {
+ .data = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ },
+ .len = 32
+ },
+ .cipher_iv = {
+ .data = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ },
+ .len = 16
+ },
+ .plaintext = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 1024
+ },
+ .ciphertext = {
+ .data = {
+ 0x30, 0x76, 0x09, 0xfb, 0x10, 0x10, 0x12, 0x54,
+ 0x4b, 0xc1, 0x75, 0xe3, 0x17, 0xfb, 0x25, 0xff,
+ 0x33, 0x0d, 0x0d, 0xe2, 0x5a, 0xf6, 0xaa, 0xd1,
+ 0x05, 0x05, 0xb8, 0x9b, 0x1e, 0x09, 0xa8, 0xec,
+ 0xdd, 0x46, 0x72, 0xcc, 0xbb, 0x98, 0xc7, 0xf2,
+ 0xc4, 0xe2, 0x4a, 0xf5, 0x27, 0x28, 0x36, 0xc8,
+ 0x7c, 0xc7, 0x3a, 0x81, 0x76, 0xb3, 0x9c, 0xe9,
+ 0x30, 0x3b, 0x3e, 0x76, 0x4e, 0x9b, 0xe3, 0xe7,
+ 0x48, 0xf7, 0x65, 0x1a, 0x7c, 0x7e, 0x81, 0x3f,
+ 0xd5, 0x24, 0x90, 0x23, 0x1e, 0x56, 0xf7, 0xc1,
+ 0x44, 0xe4, 0x38, 0xe7, 0x77, 0x11, 0xa6, 0xb0,
+ 0xba, 0xfb, 0x60, 0x45, 0x0c, 0x62, 0xd7, 0xd9,
+ 0xb9, 0x24, 0x1d, 0x12, 0x44, 0xfc, 0xb4, 0x9d,
+ 0xa1, 0xe5, 0x2b, 0x80, 0x13, 0xde, 0xcd, 0xd4,
+ 0x86, 0x04, 0xff, 0xfc, 0x62, 0x67, 0x6e, 0x70,
+ 0x3b, 0x3a, 0xb8, 0x49, 0xcb, 0xa6, 0xea, 0x09
+ },
+ .len = 1024
+ },
+};
+
+struct snow_v_test_data snow_v_test_case_3 = {
+ .key = {
+ .data = {
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a,
+ 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa
+ },
+ .len = 32
+ },
+ .cipher_iv = {
+ .data = {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ .len = 16
+ },
+ .plaintext = {
+ .data = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ .len = 1024
+ },
+ .ciphertext = {
+ .data = {
+ 0xaa, 0x81, 0xea, 0xfb, 0x8b, 0x86, 0x16, 0xce,
+ 0x3e, 0x5c, 0xe2, 0x22, 0x24, 0x61, 0xc5, 0x0a,
+ 0x6a, 0xb4, 0x48, 0x77, 0x56, 0xde, 0x4b, 0xd3,
+ 0x1c, 0x90, 0x4f, 0x3d, 0x97, 0x8a, 0xfe, 0x56,
+ 0x33, 0x4f, 0x10, 0xdd, 0xdf, 0x2b, 0x95, 0x31,
+ 0x76, 0x9a, 0x71, 0x05, 0x0b, 0xe4, 0x38, 0x5f,
+ 0xc2, 0xb6, 0x19, 0x2c, 0x7a, 0x85, 0x7b, 0xe8,
+ 0xb4, 0xfc, 0x28, 0xb7, 0x09, 0xf0, 0x8f, 0x11,
+ 0xf2, 0x06, 0x49, 0xe2, 0xee, 0xf2, 0x49, 0x80,
+ 0xf8, 0x6c, 0x4c, 0x11, 0x36, 0x41, 0xfe, 0xd2,
+ 0xf3, 0xf6, 0xfa, 0x2b, 0x91, 0x95, 0x12, 0x06,
+ 0xb8, 0x01, 0xdb, 0x15, 0x46, 0x65, 0x17, 0xa6,
+ 0x33, 0x0a, 0xdd, 0xa6, 0xb3, 0x5b, 0x26, 0x5e,
+ 0xfd, 0x72, 0x2e, 0x86, 0x77, 0xb4, 0x8b, 0xfc,
+ 0x15, 0xb4, 0x41, 0x18, 0xde, 0x52, 0xd0, 0x73,
+ 0xb0, 0xad, 0x0f, 0xe7, 0x59, 0x4d, 0x62, 0x91
+ },
+ .len = 1024
+ },
+};
+
+#endif /* TEST_CRYPTODEV_SNOW_V_TEST_VECTORS_H_ */
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/5] app/crypto-perf: add support for SNOW-V
2025-04-08 11:19 [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V Radu Nicolau
2025-04-08 11:19 ` [PATCH 2/5] examples/l2fwd-crypto: " Radu Nicolau
2025-04-08 11:19 ` [PATCH 3/5] tests: add unit tests and test vectors " Radu Nicolau
@ 2025-04-08 11:19 ` Radu Nicolau
2025-04-08 11:19 ` [PATCH 5/5] app/eventdev: update eventdev app " Radu Nicolau
3 siblings, 0 replies; 5+ messages in thread
From: Radu Nicolau @ 2025-04-08 11:19 UTC (permalink / raw)
To: Kai Ji; +Cc: dev, Radu Nicolau
Add suport for SNOW-V and SNOW-V AEAD algorithms.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
app/test-crypto-perf/cperf_ops.c | 6 ++++--
doc/guides/tools/cryptoperf.rst | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 37d06f1dea..f8c5bd6a4e 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -474,7 +474,8 @@ cperf_set_ops_cipher(struct rte_crypto_op **ops,
if (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
- options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3)
+ options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3 ||
+ options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW_V)
sym_op->cipher.data.length <<= 3;
sym_op->cipher.data.offset = 0;
@@ -633,7 +634,8 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,
if (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
- options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3)
+ options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3 ||
+ options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW_V)
sym_op->cipher.data.length <<= 3;
sym_op->cipher.data.offset = 0;
diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst
index 017e8ef934..72774e04cd 100644
--- a/doc/guides/tools/cryptoperf.rst
+++ b/doc/guides/tools/cryptoperf.rst
@@ -223,6 +223,7 @@ The following are the application command-line options:
kasumi-f8
snow3g-uea2
zuc-eea3
+ snow-v
* ``--cipher-op <mode>``
@@ -287,6 +288,7 @@ The following are the application command-line options:
aes-ccm
aes-gcm
+ snow-v-aead
* ``--aead-op <mode>``
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/5] app/eventdev: update eventdev app for SNOW-V
2025-04-08 11:19 [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V Radu Nicolau
` (2 preceding siblings ...)
2025-04-08 11:19 ` [PATCH 4/5] app/crypto-perf: add support " Radu Nicolau
@ 2025-04-08 11:19 ` Radu Nicolau
3 siblings, 0 replies; 5+ messages in thread
From: Radu Nicolau @ 2025-04-08 11:19 UTC (permalink / raw)
To: Jerin Jacob; +Cc: dev, kai.ji, Radu Nicolau
Update eventdev app to handle SNOW-V correctly.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
app/test-eventdev/evt_options.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index 323d1e724d..7903b5959c 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -224,7 +224,8 @@ cipher_alg_is_bit_mode(enum rte_crypto_cipher_algorithm alg)
{
return (alg == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
alg == RTE_CRYPTO_CIPHER_ZUC_EEA3 ||
- alg == RTE_CRYPTO_CIPHER_KASUMI_F8);
+ alg == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
+ alg == RTE_CRYPTO_CIPHER_SNOW_V);
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-08 11:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 11:19 [PATCH 1/5] crypto/ipsec_mb: add support for SNOW-V Radu Nicolau
2025-04-08 11:19 ` [PATCH 2/5] examples/l2fwd-crypto: " Radu Nicolau
2025-04-08 11:19 ` [PATCH 3/5] tests: add unit tests and test vectors " Radu Nicolau
2025-04-08 11:19 ` [PATCH 4/5] app/crypto-perf: add support " Radu Nicolau
2025-04-08 11:19 ` [PATCH 5/5] app/eventdev: update eventdev app " Radu Nicolau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).