summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/fsl/fsl_hash.h
diff options
context:
space:
mode:
authorgaurav rana <gaurav.rana@freescale.com>2015-02-20 12:51:46 +0530
committerYork Sun <yorksun@freescale.com>2015-02-25 13:20:02 -0800
commit94e3c8c4fd7bfe395fa467973cd647551d6d98c7 (patch)
treeb591415085fa8629245dcd2183f2dc50f550ccc1 /drivers/crypto/fsl/fsl_hash.h
parent7ee8c4795d0ab0f1cd25496bfbcdedb184ef5a8d (diff)
downloadtalos-obmc-uboot-94e3c8c4fd7bfe395fa467973cd647551d6d98c7.tar.gz
talos-obmc-uboot-94e3c8c4fd7bfe395fa467973cd647551d6d98c7.zip
crypto/fsl - Add progressive hashing support using hardware acceleration.
Currently only normal hashing is supported using hardware acceleration. Added support for progressive hashing using hardware. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com> CC: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'drivers/crypto/fsl/fsl_hash.h')
-rw-r--r--drivers/crypto/fsl/fsl_hash.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/crypto/fsl/fsl_hash.h b/drivers/crypto/fsl/fsl_hash.h
new file mode 100644
index 0000000000..f5be651d7a
--- /dev/null
+++ b/drivers/crypto/fsl/fsl_hash.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ */
+
+#ifndef _SHA_H
+#define _SHA_H
+
+#include <fsl_sec.h>
+#include <hash.h>
+#include "jr.h"
+
+/* We support at most 32 Scatter/Gather Entries.*/
+#define MAX_SG_32 32
+
+/*
+ * Hash context contains the following fields
+ * @sha_desc: Sha Descriptor
+ * @sg_num: number of entries in sg table
+ * @len: total length of buffer
+ * @sg_tbl: sg entry table
+ * @hash: index to the hash calculated
+ */
+struct sha_ctx {
+ uint32_t sha_desc[64];
+ uint32_t sg_num;
+ uint32_t len;
+ struct sg_entry sg_tbl[MAX_SG_32];
+ u8 hash[HASH_MAX_DIGEST_SIZE];
+};
+
+#endif
OpenPOWER on IntegriCloud