aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/poly1305
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/zinc/poly1305')
-rw-r--r--src/crypto/zinc/poly1305/poly1305-arm-glue.h13
-rw-r--r--src/crypto/zinc/poly1305/poly1305-arm.S2
-rw-r--r--src/crypto/zinc/poly1305/poly1305-arm64.S2
3 files changed, 7 insertions, 10 deletions
diff --git a/src/crypto/zinc/poly1305/poly1305-arm-glue.h b/src/crypto/zinc/poly1305/poly1305-arm-glue.h
index fb7be17..ddeb58a 100644
--- a/src/crypto/zinc/poly1305/poly1305-arm-glue.h
+++ b/src/crypto/zinc/poly1305/poly1305-arm-glue.h
@@ -6,16 +6,11 @@
#include <asm/hwcap.h>
#include <asm/neon.h>
-#define ARM_USE_NEON (defined(CONFIG_KERNEL_MODE_NEON) && \
- (defined(CONFIG_ARM64) || \
- (defined(__LINUX_ARM_ARCH__) && \
- __LINUX_ARM_ARCH__ == 7)))
-
asmlinkage void poly1305_init_arm(void *ctx, const u8 key[16]);
asmlinkage void poly1305_blocks_arm(void *ctx, const u8 *inp, const size_t len,
const u32 padbit);
asmlinkage void poly1305_emit_arm(void *ctx, u8 mac[16], const u32 nonce[4]);
-#if ARM_USE_NEON
+#if defined(CONFIG_KERNEL_MODE_NEON)
asmlinkage void poly1305_blocks_neon(void *ctx, const u8 *inp, const size_t len,
const u32 padbit);
asmlinkage void poly1305_emit_neon(void *ctx, u8 mac[16], const u32 nonce[4]);
@@ -57,7 +52,7 @@ struct poly1305_arch_internal {
};
#endif
-#if ARM_USE_NEON
+#if defined(CONFIG_KERNEL_MODE_NEON)
static void convert_to_base2_64(void *ctx)
{
struct poly1305_arch_internal *state = ctx;
@@ -95,7 +90,7 @@ static inline bool poly1305_blocks_arch(void *ctx, const u8 *inp,
const size_t len, const u32 padbit,
simd_context_t *simd_context)
{
-#if ARM_USE_NEON
+#if defined(CONFIG_KERNEL_MODE_NEON)
if (poly1305_use_neon && simd_use(simd_context)) {
poly1305_blocks_neon(ctx, inp, len, padbit);
return true;
@@ -111,7 +106,7 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE],
const u32 nonce[4],
simd_context_t *simd_context)
{
-#if ARM_USE_NEON
+#if defined(CONFIG_KERNEL_MODE_NEON)
if (poly1305_use_neon && simd_use(simd_context)) {
poly1305_emit_neon(ctx, mac, nonce);
return true;
diff --git a/src/crypto/zinc/poly1305/poly1305-arm.S b/src/crypto/zinc/poly1305/poly1305-arm.S
index 84c96c3..4a0e9d4 100644
--- a/src/crypto/zinc/poly1305/poly1305-arm.S
+++ b/src/crypto/zinc/poly1305/poly1305-arm.S
@@ -339,7 +339,7 @@ ENTRY(poly1305_emit_arm)
ENDPROC(poly1305_emit_arm)
-#if __LINUX_ARM_ARCH__ >= 7
+#ifdef CONFIG_KERNEL_MODE_NEON
.fpu neon
.align 5
diff --git a/src/crypto/zinc/poly1305/poly1305-arm64.S b/src/crypto/zinc/poly1305/poly1305-arm64.S
index 4ccd3d5..84a6544 100644
--- a/src/crypto/zinc/poly1305/poly1305-arm64.S
+++ b/src/crypto/zinc/poly1305/poly1305-arm64.S
@@ -186,6 +186,7 @@ __poly1305_splat:
ret
+#ifdef CONFIG_KERNEL_MODE_NEON
.align 5
ENTRY(poly1305_blocks_neon)
ldr x17,[x0,#24]
@@ -820,3 +821,4 @@ ENDPROC(poly1305_emit_neon)
.align 5
.Lzeros:
.long 0,0,0,0,0,0,0,0
+#endif