Lines Matching refs:xform
265 get_crypto_chain_order(const struct rte_crypto_sym_xform *xform) in get_crypto_chain_order() argument
269 if (unlikely(xform == NULL)) in get_crypto_chain_order()
272 switch (xform->type) { in get_crypto_chain_order()
274 if (xform->next == NULL) { in get_crypto_chain_order()
276 } else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { in get_crypto_chain_order()
277 if (xform->auth.op == RTE_CRYPTO_AUTH_OP_VERIFY && in get_crypto_chain_order()
278 xform->next->cipher.op == in get_crypto_chain_order()
283 xform->auth.op, xform->next->cipher.op); in get_crypto_chain_order()
288 if (xform->next == NULL) { in get_crypto_chain_order()
290 } else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { in get_crypto_chain_order()
291 if (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT && in get_crypto_chain_order()
292 xform->next->auth.op == in get_crypto_chain_order()
297 xform->cipher.op, xform->next->auth.op); in get_crypto_chain_order()
362 crypto_key_is_valid(struct rte_crypto_cipher_xform *xform, in crypto_key_is_valid() argument
365 if (unlikely(xform->key.length > sizeof(fctx->crypto.key))) { in crypto_key_is_valid()
367 xform->key.length); in crypto_key_is_valid()
375 configure_cipher_ctx(struct rte_crypto_cipher_xform *xform, in configure_cipher_ctx() argument
383 type = get_flexi_cipher_type(xform->algo, &cipher_is_aes); in configure_cipher_ctx()
387 aes_keylen = flexi_aes_keylen(xform->key.length, cipher_is_aes); in configure_cipher_ctx()
391 if (unlikely(!cipher_is_aes && !crypto_key_is_valid(xform, fctx))) in configure_cipher_ctx()
394 if (unlikely(xform->iv.length > MAX_IV_LEN)) in configure_cipher_ctx()
403 memcpy(fctx->crypto.key, xform->key.data, xform->key.length); in configure_cipher_ctx()
406 ctx->req_op = (xform->op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ? in configure_cipher_ctx()
408 ctx->iv.offset = xform->iv.offset; in configure_cipher_ctx()
409 ctx->iv.length = xform->iv.length; in configure_cipher_ctx()
456 configure_auth_ctx(struct rte_crypto_auth_xform *xform, in configure_auth_ctx() argument
462 type = get_flexi_auth_type(xform->algo); in configure_auth_ctx()
466 if (unlikely(!auth_key_is_valid(xform->key.data, xform->key.length, in configure_auth_ctx()
470 ctx->digest_length = xform->digest_length; in configure_auth_ctx()
475 fctx->w0.mac_len = xform->digest_length; in configure_auth_ctx()
478 memcpy(fctx->auth.opad, xform->key.data, xform->key.length); in configure_auth_ctx()
483 configure_aead_ctx(struct rte_crypto_aead_xform *xform, in configure_aead_ctx() argument
489 if (unlikely(xform->aad_length > FLEXI_CRYPTO_MAX_AAD_LEN)) { in configure_aead_ctx()
491 xform->aad_length); in configure_aead_ctx()
495 if (unlikely(xform->algo != RTE_CRYPTO_AEAD_AES_GCM)) in configure_aead_ctx()
498 aes_keylen = flexi_aes_keylen(xform->key.length, true); in configure_aead_ctx()
502 if (unlikely(!auth_key_is_valid(xform->key.data, xform->key.length, in configure_aead_ctx()
506 if (unlikely(xform->iv.length > MAX_IV_LEN)) in configure_aead_ctx()
515 fctx->w0.mac_len = xform->digest_length; in configure_aead_ctx()
518 memcpy(fctx->crypto.key, xform->key.data, xform->key.length); in configure_aead_ctx()
520 memcpy(fctx->auth.opad, xform->key.data, xform->key.length); in configure_aead_ctx()
523 ctx->req_op = (xform->op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ? in configure_aead_ctx()
525 ctx->iv.offset = xform->iv.offset; in configure_aead_ctx()
526 ctx->iv.length = xform->iv.length; in configure_aead_ctx()
527 ctx->digest_length = xform->digest_length; in configure_aead_ctx()
528 ctx->aad_length = xform->aad_length; in configure_aead_ctx()
534 struct rte_crypto_sym_xform *xform, in nitrox_sym_dev_sess_configure() argument
551 ctx->nitrox_chain = get_crypto_chain_order(xform); in nitrox_sym_dev_sess_configure()
554 cipher_xform = &xform->cipher; in nitrox_sym_dev_sess_configure()
557 cipher_xform = &xform->cipher; in nitrox_sym_dev_sess_configure()
558 auth_xform = &xform->next->auth; in nitrox_sym_dev_sess_configure()
561 auth_xform = &xform->auth; in nitrox_sym_dev_sess_configure()
562 cipher_xform = &xform->next->cipher; in nitrox_sym_dev_sess_configure()
565 aead_xform = &xform->aead; in nitrox_sym_dev_sess_configure()