1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
8 #include "cpt_mcode_defines.h"
11 * This file defines functions that are interfaces to microcode spec.
15 static __rte_always_inline int
16 cpt_is_algo_supported(struct rte_crypto_sym_xform *xform)
19 * Microcode only supports the following combination.
20 * Encryption followed by authentication
21 * Authentication followed by decryption
24 if ((xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) &&
25 (xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) &&
26 (xform->next->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)) {
27 /* Unsupported as of now by microcode */
28 CPT_LOG_DP_ERR("Unsupported combination");
31 if ((xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) &&
32 (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) &&
33 (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_DECRYPT)) {
34 /* For GMAC auth there is no cipher operation */
35 if (xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM ||
36 xform->next->auth.algo !=
37 RTE_CRYPTO_AUTH_AES_GMAC) {
38 /* Unsupported as of now by microcode */
39 CPT_LOG_DP_ERR("Unsupported combination");
47 #endif /*_CPT_UCODE_H_ */