mirror of https://github.com/OpenIPC/firmware.git
46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
diff -drupN a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
|
|
--- a/arch/arm64/crypto/sha2-ce-glue.c 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/arch/arm64/crypto/sha2-ce-glue.c 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -17,9 +17,6 @@
|
|
#include <linux/crypto.h>
|
|
#include <linux/module.h>
|
|
|
|
-#define ASM_EXPORT(sym, val) \
|
|
- asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
|
|
-
|
|
MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
|
|
MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
|
|
MODULE_LICENSE("GPL v2");
|
|
@@ -31,6 +28,19 @@ struct sha256_ce_state {
|
|
|
|
asmlinkage void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src,
|
|
int blocks);
|
|
+#ifdef CONFIG_CFI_CLANG
|
|
+static inline void __cfi_sha2_ce_transform(struct sha256_state *sst,
|
|
+ u8 const *src, int blocks)
|
|
+{
|
|
+ sha2_ce_transform((struct sha256_ce_state *)sst, src, blocks);
|
|
+}
|
|
+#define sha2_ce_transform __cfi_sha2_ce_transform
|
|
+#endif
|
|
+
|
|
+const u32 sha256_ce_offsetof_count = offsetof(struct sha256_ce_state,
|
|
+ sst.count);
|
|
+const u32 sha256_ce_offsetof_finalize = offsetof(struct sha256_ce_state,
|
|
+ finalize);
|
|
|
|
static int sha256_ce_update(struct shash_desc *desc, const u8 *data,
|
|
unsigned int len)
|
|
@@ -52,11 +62,6 @@ static int sha256_ce_finup(struct shash_
|
|
struct sha256_ce_state *sctx = shash_desc_ctx(desc);
|
|
bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE);
|
|
|
|
- ASM_EXPORT(sha256_ce_offsetof_count,
|
|
- offsetof(struct sha256_ce_state, sst.count));
|
|
- ASM_EXPORT(sha256_ce_offsetof_finalize,
|
|
- offsetof(struct sha256_ce_state, finalize));
|
|
-
|
|
/*
|
|
* Allow the asm code to perform the finalization if there is no
|
|
* partial data and the input is a round multiple of the block size.
|