forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/arm/crypto/poly1305-glue.c
....@@ -12,6 +12,7 @@
1212 #include <crypto/algapi.h>
1313 #include <crypto/internal/hash.h>
1414 #include <crypto/internal/poly1305.h>
15
+#include <crypto/internal/simd.h>
1516 #include <linux/cpufeature.h>
1617 #include <linux/crypto.h>
1718 #include <linux/jump_label.h>
....@@ -28,7 +29,7 @@
2829
2930 static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
3031
31
-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
32
+void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
3233 {
3334 poly1305_init_arm(&dctx->h, key);
3435 dctx->s[0] = get_unaligned_le32(key + 16);
....@@ -125,7 +126,7 @@
125126 unsigned int srclen)
126127 {
127128 struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
128
- bool do_neon = may_use_simd() && srclen > 128;
129
+ bool do_neon = crypto_simd_usable() && srclen > 128;
129130
130131 if (static_branch_likely(&have_neon) && do_neon)
131132 kernel_neon_begin();
....@@ -139,7 +140,7 @@
139140 unsigned int nbytes)
140141 {
141142 bool do_neon = IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
142
- may_use_simd();
143
+ crypto_simd_usable();
143144
144145 if (unlikely(dctx->buflen)) {
145146 u32 bytes = min(nbytes, POLY1305_BLOCK_SIZE - dctx->buflen);