summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/caamhash_desc.h
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2018-09-12 11:59:35 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-21 13:24:51 +0800
commit0efa7579f3de1907acd16a358b0ade214b020d77 (patch)
tree61d6afcd2eb9665247e7ae935c97657094bd150d /drivers/crypto/caam/caamhash_desc.h
parent226853ac3ebee425300b9a692c9cd5f9e2e72571 (diff)
downloadlinux-stable-0efa7579f3de1907acd16a358b0ade214b020d77.tar.gz
linux-stable-0efa7579f3de1907acd16a358b0ade214b020d77.tar.bz2
linux-stable-0efa7579f3de1907acd16a358b0ade214b020d77.zip
crypto: caam - export ahash shared descriptor generation
caam/qi2 driver will support ahash algorithms, thus move ahash descriptors generation in a shared location. Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/caamhash_desc.h')
-rw-r--r--drivers/crypto/caam/caamhash_desc.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamhash_desc.h b/drivers/crypto/caam/caamhash_desc.h
new file mode 100644
index 000000000000..631fc1ac312c
--- /dev/null
+++ b/drivers/crypto/caam/caamhash_desc.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Shared descriptors for ahash algorithms
+ *
+ * Copyright 2017 NXP
+ */
+
+#ifndef _CAAMHASH_DESC_H_
+#define _CAAMHASH_DESC_H_
+
+/* length of descriptors text */
+#define DESC_AHASH_BASE (3 * CAAM_CMD_SZ)
+#define DESC_AHASH_UPDATE_LEN (6 * CAAM_CMD_SZ)
+#define DESC_AHASH_UPDATE_FIRST_LEN (DESC_AHASH_BASE + 4 * CAAM_CMD_SZ)
+#define DESC_AHASH_FINAL_LEN (DESC_AHASH_BASE + 5 * CAAM_CMD_SZ)
+#define DESC_AHASH_DIGEST_LEN (DESC_AHASH_BASE + 4 * CAAM_CMD_SZ)
+
+void cnstr_shdsc_ahash(u32 * const desc, struct alginfo *adata, u32 state,
+ int digestsize, int ctx_len, bool import_ctx, int era);
+
+#endif /* _CAAMHASH_DESC_H_ */