crypto/qat: add aes-gcm J0 handling
PATCH 1/2 crypto/qat: add aes-gcm J0 handling
This patch adds J0 capability to Intel QuickAssist Technology driver
--- drivers/crypto/qat/qat_sym_capabilities.h | 8 ++++---- drivers/crypto/qat/qat_sym_session.c | 11 ++++++++--- drivers/crypto/qat/qat_sym_session.h | 5 +++++ 3 files changed, 17 insertions(+), 7 deletions(-)
drivers/crypto/qat/qat_sym_capabilities.h +4 -4
@@ -227,9 +227,9 @@ .increment = 1 \ }, \ .iv_size = { \ - .min = 12, \ + .min = 0, \ .max = 12, \ - .increment =0 \ + .increment =12 \ }, \ }, } \ }, } \
@@ -252,9 +252,9 @@ .increment = 4 \ }, \ .iv_size = { \ - .min = 12, \ + .min = 0, \ .max = 12, \ - .increment = 0 \ + .increment = 12 \ } \ }, } \ }, } \
drivers/crypto/qat/qat_sym_session.c +8 -3
@@ -653,6 +653,9 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,uint8_t key_length = auth_xform->key.length; session->aes_cmac =0 ; + session->auth_iv.offset = auth_xform->iv.offset; + session->auth_iv.length = auth_xform->iv.length; +switch (auth_xform->algo) {case RTE_CRYPTO_AUTH_SHA1_HMAC : session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_SHA1 ;
@@ -684,6 +687,8 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev, } session->qat_mode =ICP_QAT_HW_CIPHER_CTR_MODE ; session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ; +if (session->auth_iv.length ==0 ) + session->auth_iv.length =AES_GCM_J0_LEN ;break ;case RTE_CRYPTO_AUTH_SNOW3G_UIA2 :
@@ -723,9 +728,6 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,return -EINVAL ; } - session->auth_iv.offset = auth_xform->iv.offset; - session->auth_iv.length = auth_xform->iv.length; -if (auth_xform->algo ==RTE_CRYPTO_AUTH_AES_GMAC ) {if (auth_xform->op ==RTE_CRYPTO_AUTH_OP_GENERATE ) { session->qat_cmd =ICP_QAT_FW_LA_CMD_CIPHER_HASH ;
@@ -808,6 +810,9 @@ qat_sym_session_configure_aead(struct rte_cryptodev *dev, } session->qat_mode =ICP_QAT_HW_CIPHER_CTR_MODE ; session->qat_hash_alg =ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ; +if (session->cipher_iv.length ==0 ) + session->cipher_iv.length =AES_GCM_J0_LEN ; +break ;case RTE_CRYPTO_AEAD_AES_CCM : if (qat_sym_validate_aes_key(aead_xform->key.length,
drivers/crypto/qat/qat_sym_session.h +5 -0
@@ -20,6 +20,11 @@#define KASUMI_F8_KEY_MODIFIER_4_BYTES 0x55555555 +/* +* AES-GCM J0 length +*/ +#define AES_GCM_J0_LEN 16 +/* 3DES key sizes */ #define QAT_3DES_KEY_SZ_OPT1 24/* Keys are independent */ #define QAT_3DES_KEY_SZ_OPT2 16/* K3=K1 */
Signature · 1 line
2.1.0
PATCH 2/2 test: add crypto aes-gcm J0 test case
This patch adds crypto J0 test case to AES-GCM
--- app/test/test_cryptodev.c | 28 ++++++++++++++-- app/test/test_cryptodev.h | 1 + app/test/test_cryptodev_aead_test_vectors.h | 51 +++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 3 deletions(-)
app/test/test_cryptodev.c +25 -3
@@ -6885,9 +6885,15 @@ create_aead_operation(enum rte_crypto_aead_operation op,uint8_t *iv_ptr =rte_crypto_op_ctod_offset (ut_params->op, uint8_t *, IV_OFFSET); -rte_memcpy (iv_ptr, tdata->iv.data, tdata->iv.len); -debug_hexdump (stdout,"iv:" , iv_ptr, - tdata->iv.len); +if (tdata->iv.len ==0 ) { +rte_memcpy (iv_ptr, tdata->iv.data,AES_GCM_J0_LENGTH ); +debug_hexdump (stdout,"iv:" , iv_ptr, +AES_GCM_J0_LENGTH ); + }else { +rte_memcpy (iv_ptr, tdata->iv.data, tdata->iv.len); +debug_hexdump (stdout,"iv:" , iv_ptr, + tdata->iv.len); + } }/* Append plaintext/ciphertext */
@@ -7713,6 +7719,12 @@ test_AES_GCM_authenticated_encryption_test_case_8(void) }static int +test_AES_GCM_J0_authenticated_encryption_test_case_1 (void ) +{ +return test_authenticated_encryption (&gcm_J0_test_case_1); +} + +static int test_AES_GCM_auth_encryption_test_case_192_1 (void ) {return test_authenticated_encryption (&gcm_test_case_192_1);
@@ -8046,6 +8058,12 @@ test_AES_GCM_authenticated_decryption_test_case_8(void) }static int +test_AES_GCM_J0_authenticated_decryption_test_case_1 (void ) +{ +return test_authenticated_decryption (&gcm_J0_test_case_1); +} + +static int test_AES_GCM_auth_decryption_test_case_192_1 (void ) {return test_authenticated_decryption (&gcm_test_case_192_1);
@@ -11755,6 +11773,8 @@ static struct unit_test_suite cryptodev_testsuite = { test_AES_GCM_authenticated_encryption_test_case_7),TEST_CASE_ST (ut_setup, ut_teardown, test_AES_GCM_authenticated_encryption_test_case_8), +TEST_CASE_ST (ut_setup, ut_teardown, + test_AES_GCM_J0_authenticated_encryption_test_case_1),/** AES GCM Authenticated Decryption */ TEST_CASE_ST(ut_setup, ut_teardown,
@@ -11773,6 +11793,8 @@ static struct unit_test_suite cryptodev_testsuite = { test_AES_GCM_authenticated_decryption_test_case_7),TEST_CASE_ST (ut_setup, ut_teardown, test_AES_GCM_authenticated_decryption_test_case_8), +TEST_CASE_ST (ut_setup, ut_teardown, + test_AES_GCM_J0_authenticated_decryption_test_case_1),/** AES GCM Authenticated Encryption 192 bits key */ TEST_CASE_ST(ut_setup, ut_teardown,
app/test/test_cryptodev.h +1 -0
@@ -44,6 +44,7 @@#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512 (32)#define MAXIMUM_IV_LENGTH (16) +#define AES_GCM_J0_LENGTH (16)#define IV_OFFSET (sizeof(struct rte_crypto_op) + \ sizeof(struct rte_crypto_sym_op) + DEFAULT_NUM_XFORMS * \
app/test/test_cryptodev_aead_test_vectors.h +51 -0
57 lines not on this page · raw message
Signature · 1 line
2.1.0
Re: [dpdk-dev] [PATCH 2/2] test: add crypto aes-gcm J0 test case
Quoted 10 lines
-----Original Message-----
From: Kusztal, ArkadiuszX <[email protected]>
Sent: Friday, March 13, 2020 6:08 PM
To: [email protected]
Cc: [email protected]; Trahe, Fiona <[email protected]>; Kusztal, ArkadiuszX <[email protected]>
Subject: [PATCH 2/2] test: add crypto aes-gcm J0 test case
Quoted 3 lines
This patch adds crypto J0 test case to AES-GCM
Signed-off-by Arek Kusztal <[email protected]>
Akhil Goyal
AppliedRe: [dpdk-dev] [PATCH 2/2] test: add crypto aes-gcm J0 test case
Quoted 5 lines
Quoted 4 lines
This patch adds crypto J0 test case to AES-GCM
Signed-off-by Arek Kusztal <[email protected]>Acked-by Fiona Trahe <[email protected]>
Applied to dpdk-next-crypto
Thanks.
Quoted 10 lines
-----Original Message-----
From: Kusztal, ArkadiuszX <[email protected]>
Sent: Friday, March 13, 2020 6:08 PM
To: [email protected]
Cc: [email protected]; Trahe, Fiona <[email protected]>; Kusztal, ArkadiuszX <[email protected]>
Subject: [PATCH 1/2]crypto/qat: add aes-gcm J0 handling
Quoted 3 lines
This patch adds J0 capability to Intel QuickAssist Technology driver
Signed-off-by Arek Kusztal <[email protected]>
Akhil Goyal
AppliedQuoted 7 lines
Quoted 4 lines
This patch adds J0 capability to Intel QuickAssist Technology driver
Signed-off-by Arek Kusztal <[email protected]>Acked-by Fiona Trahe <[email protected]>
Applied to dpdk-next-crypto
Thanks.