blob: 5bc0fd0b7dc78a47f48807ea592a85c1913b75e8 [file] [log] [blame]
developerec4ebe42022-04-12 11:17:45 +08001--- a/drivers/crypto/inside-secure/safexcel.h
2+++ b/drivers/crypto/inside-secure/safexcel.h
3@@ -722,6 +722,9 @@ enum safexcel_eip_version {
4 /* Priority we use for advertising our algorithms */
5 #define SAFEXCEL_CRA_PRIORITY 300
6
7+/* System cache line size */
8+#define SYSTEM_CACHELINE_SIZE 64
9+
10 /* SM3 digest result for zero length message */
11 #define EIP197_SM3_ZEROM_HASH "\x1A\xB2\x1D\x83\x55\xCF\xA1\x7F" \
12 "\x8E\x61\x19\x48\x31\xE8\x1A\x8F" \
13--- a/drivers/crypto/inside-secure/safexcel_hash.c
14+++ b/drivers/crypto/inside-secure/safexcel_hash.c
15@@ -57,9 +57,9 @@ struct safexcel_ahash_req {
16 u8 block_sz; /* block size, only set once */
17 u8 digest_sz; /* output digest size, only set once */
18 __le32 state[SHA3_512_BLOCK_SIZE /
19- sizeof(__le32)] __aligned(sizeof(__le32));
20+ sizeof(__le32)] __aligned(SYSTEM_CACHELINE_SIZE);
21
22- u64 len;
23+ u64 len __aligned(SYSTEM_CACHELINE_SIZE);
24 u64 processed;
25
26 u8 cache[HASH_CACHE_SIZE] __aligned(sizeof(u32));