crypto/dpaa2_sec: support ZUC ciphering/integrity

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
Hemant Agrawal 2019-09-30 20:11:00 +05:30 committed by Akhil Goyal
parent 680f73272a
commit b69ee13859
3 changed files with 70 additions and 2 deletions

View File

@ -26,6 +26,7 @@ AES CTR (192) = Y
AES CTR (256) = Y
3DES CBC = Y
SNOW3G UEA2 = Y
ZUC EEA3 = Y
;
; Supported authentication algorithms of the 'dpaa2_sec' crypto driver.
@ -38,6 +39,7 @@ SHA256 HMAC = Y
SHA384 HMAC = Y
SHA512 HMAC = Y
SNOW3G UIA2 = Y
ZUC EIA3 = Y
;
; Supported AEAD algorithms of the 'dpaa2_sec' crypto driver.

View File

@ -1072,6 +1072,9 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op,
if (sess->auth_alg == RTE_CRYPTO_AUTH_SNOW3G_UIA2) {
iv_ptr = conv_to_snow_f9_iv(iv_ptr);
sge->length = 12;
} else if (sess->auth_alg == RTE_CRYPTO_AUTH_ZUC_EIA3) {
iv_ptr = conv_to_zuc_eia_iv(iv_ptr);
sge->length = 8;
} else {
sge->length = sess->iv.length;
}
@ -1897,8 +1900,14 @@ dpaa2_sec_cipher_init(struct rte_cryptodev *dev,
&cipherdata,
session->dir);
break;
case RTE_CRYPTO_CIPHER_KASUMI_F8:
case RTE_CRYPTO_CIPHER_ZUC_EEA3:
cipherdata.algtype = OP_ALG_ALGSEL_ZUCE;
session->cipher_alg = RTE_CRYPTO_CIPHER_ZUC_EEA3;
bufsize = cnstr_shdsc_zuce(priv->flc_desc[0].desc, 1, 0,
&cipherdata,
session->dir);
break;
case RTE_CRYPTO_CIPHER_KASUMI_F8:
case RTE_CRYPTO_CIPHER_AES_F8:
case RTE_CRYPTO_CIPHER_AES_ECB:
case RTE_CRYPTO_CIPHER_3DES_ECB:
@ -2045,8 +2054,18 @@ dpaa2_sec_auth_init(struct rte_cryptodev *dev,
!session->dir,
session->digest_length);
break;
case RTE_CRYPTO_AUTH_KASUMI_F9:
case RTE_CRYPTO_AUTH_ZUC_EIA3:
authdata.algtype = OP_ALG_ALGSEL_ZUCA;
authdata.algmode = OP_ALG_AAI_F9;
session->auth_alg = RTE_CRYPTO_AUTH_ZUC_EIA3;
session->iv.offset = xform->auth.iv.offset;
session->iv.length = xform->auth.iv.length;
bufsize = cnstr_shdsc_zuca(priv->flc_desc[DESC_INITFINAL].desc,
1, 0, &authdata,
!session->dir,
session->digest_length);
break;
case RTE_CRYPTO_AUTH_KASUMI_F9:
case RTE_CRYPTO_AUTH_NULL:
case RTE_CRYPTO_AUTH_SHA1:
case RTE_CRYPTO_AUTH_SHA256:
@ -2357,6 +2376,7 @@ dpaa2_sec_aead_chain_init(struct rte_cryptodev *dev,
session->cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR;
break;
case RTE_CRYPTO_CIPHER_SNOW3G_UEA2:
case RTE_CRYPTO_CIPHER_ZUC_EEA3:
case RTE_CRYPTO_CIPHER_NULL:
case RTE_CRYPTO_CIPHER_3DES_ECB:
case RTE_CRYPTO_CIPHER_AES_ECB:
@ -2651,6 +2671,7 @@ dpaa2_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform,
cipherdata->algtype = OP_PCL_IPSEC_NULL;
break;
case RTE_CRYPTO_CIPHER_SNOW3G_UEA2:
case RTE_CRYPTO_CIPHER_ZUC_EEA3:
case RTE_CRYPTO_CIPHER_3DES_ECB:
case RTE_CRYPTO_CIPHER_AES_ECB:
case RTE_CRYPTO_CIPHER_KASUMI_F8:

View File

@ -456,6 +456,51 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
}, }
}, }
},
{ /* ZUC (EEA3) */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
{.cipher = {
.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
.block_size = 16,
.key_size = {
.min = 16,
.max = 16,
.increment = 0
},
.iv_size = {
.min = 16,
.max = 16,
.increment = 0
}
}, }
}, }
},
{ /* ZUC (EIA3) */
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
{.sym = {
.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
{.auth = {
.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
.block_size = 16,
.key_size = {
.min = 16,
.max = 16,
.increment = 0
},
.digest_size = {
.min = 4,
.max = 4,
.increment = 0
},
.iv_size = {
.min = 16,
.max = 16,
.increment = 0
}
}, }
}, }
},
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};