// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* * Shared descriptors for ahash algorithms * * Copyright 2017-2019 NXP */ #include "compat.h" #include "desc_constr.h" #include "caamhash_desc.h" /** * cnstr_shdsc_ahash - ahash shared descriptor * @desc: pointer to buffer used for descriptor construction * @adata: pointer to authentication transform definitions. * A split key is required for SEC Era < 6; the size of the split key * is specified in this case. * Valid algorithm values - one of OP_ALG_ALGSEL_{MD5, SHA1, SHA224, * SHA256, SHA384, SHA512}. * @state: algorithm state OP_ALG_AS_{INIT, FINALIZE, INITFINALIZE, UPDATE} * @digestsize: algorithm's digest size * @ctx_len: size of Context Register * @import_ctx: true if previous Context Register needs to be restored * must be true for ahash update and final * must be false for ahash first and digest * @era: SEC Era */ void cnstr_shdsc_ahash(u32 * const desc, struct alginfo *adata, u32 state, int digestsize, int ctx_len, bool import_ctx, int era) { … } EXPORT_SYMBOL(…); /** * cnstr_shdsc_sk_hash - shared descriptor for symmetric key cipher-based * hash algorithms * @desc: pointer to buffer used for descriptor construction * @adata: pointer to authentication transform definitions. * @state: algorithm state OP_ALG_AS_{INIT, FINALIZE, INITFINALIZE, UPDATE} * @digestsize: algorithm's digest size * @ctx_len: size of Context Register */ void cnstr_shdsc_sk_hash(u32 * const desc, struct alginfo *adata, u32 state, int digestsize, int ctx_len) { … } EXPORT_SYMBOL(…); MODULE_LICENSE(…) …; MODULE_DESCRIPTION(…) …; MODULE_AUTHOR(…) …;