summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/inside-secure/safexcel.h
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-05-29 14:13:44 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-06-22 17:03:00 +0200
commit25bc95510317dc7259299adb786f050617199b42 (patch)
tree119f0892148c65375d207fbda5463be037a84270 /drivers/crypto/inside-secure/safexcel.h
parentcrypto: inside-secure - use the error handler for invalidation requests (diff)
downloadlinux-25bc95510317dc7259299adb786f050617199b42.tar.xz
linux-25bc95510317dc7259299adb786f050617199b42.zip
crypto: inside-secure - improve the counter computation
A counter is given to the engine when finishing hash computation. It currently uses the blocksize while it counts the number of 64 bytes blocks given to the engine. This works well for all algorithms so far, as SHA1, SHA224 and SHA256 all have a blocksize of 64 bytes, but others algorithms such as SHA512 wouldn't work. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/inside-secure/safexcel.h')
-rw-r--r--drivers/crypto/inside-secure/safexcel.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/crypto/inside-secure/safexcel.h b/drivers/crypto/inside-secure/safexcel.h
index 8b3ee9b59f53..d2adedc23e9a 100644
--- a/drivers/crypto/inside-secure/safexcel.h
+++ b/drivers/crypto/inside-secure/safexcel.h
@@ -327,6 +327,11 @@ struct safexcel_context_record {
#define CONTEXT_CONTROL_COUNTER_MODE BIT(10)
#define CONTEXT_CONTROL_HASH_STORE BIT(19)
+/* The hash counter given to the engine in the context has a granularity of
+ * 64 bits.
+ */
+#define EIP197_COUNTER_BLOCK_SIZE 64
+
/* EIP197_CS_RAM_CTRL */
#define EIP197_TRC_ENABLE_0 BIT(4)
#define EIP197_TRC_ENABLE_1 BIT(5)