^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Shared descriptors for ahash algorithms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright 2017 NXP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _CAAMHASH_DESC_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _CAAMHASH_DESC_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /* length of descriptors text */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define DESC_AHASH_BASE (3 * CAAM_CMD_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define DESC_AHASH_UPDATE_LEN (6 * CAAM_CMD_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define DESC_AHASH_UPDATE_FIRST_LEN (DESC_AHASH_BASE + 4 * CAAM_CMD_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define DESC_AHASH_FINAL_LEN (DESC_AHASH_BASE + 5 * CAAM_CMD_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define DESC_AHASH_DIGEST_LEN (DESC_AHASH_BASE + 4 * CAAM_CMD_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static inline bool is_xcbc_aes(u32 algtype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) return (algtype & (OP_ALG_ALGSEL_MASK | OP_ALG_AAI_MASK)) ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) (OP_ALG_ALGSEL_AES | OP_ALG_AAI_XCBC_MAC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) void cnstr_shdsc_ahash(u32 * const desc, struct alginfo *adata, u32 state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int digestsize, int ctx_len, bool import_ctx, int era);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) void cnstr_shdsc_sk_hash(u32 * const desc, struct alginfo *adata, u32 state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) int digestsize, int ctx_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #endif /* _CAAMHASH_DESC_H_ */