From a3c1beaa383e5c839970d5732994dfa8b214ef4b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 25 Sep 2018 19:34:47 +0200 Subject: curve25519-arm: disable on big-endian The qhasm was only written for little-endian systems, and we don't want disaster to ensue. --- src/crypto/zinc/curve25519/curve25519-arm-glue.h | 4 ++-- src/crypto/zinc/curve25519/curve25519-arm.S | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.h b/src/crypto/zinc/curve25519/curve25519-arm-glue.h index 9211bca..7969fec 100644 --- a/src/crypto/zinc/curve25519/curve25519-arm-glue.h +++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.h @@ -7,7 +7,7 @@ #include #include -#if defined(CONFIG_KERNEL_MODE_NEON) +#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(CONFIG_CPU_BIG_ENDIAN) asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_KEY_SIZE], const u8 secret[CURVE25519_KEY_SIZE], const u8 basepoint[CURVE25519_KEY_SIZE]); @@ -24,7 +24,7 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_KEY_SIZE], const u8 secret[CURVE25519_KEY_SIZE], const u8 basepoint[CURVE25519_KEY_SIZE]) { -#if defined(CONFIG_KERNEL_MODE_NEON) +#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(CONFIG_CPU_BIG_ENDIAN) if (curve25519_use_neon && may_use_simd()) { kernel_neon_begin(); curve25519_neon(mypublic, secret, basepoint); diff --git a/src/crypto/zinc/curve25519/curve25519-arm.S b/src/crypto/zinc/curve25519/curve25519-arm.S index db6570c..7cbf6bf 100644 --- a/src/crypto/zinc/curve25519/curve25519-arm.S +++ b/src/crypto/zinc/curve25519/curve25519-arm.S @@ -7,7 +7,7 @@ * but has subsequently been manually reworked for use in kernel space. */ -#ifdef CONFIG_KERNEL_MODE_NEON +#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(__ARMEB__) #include .text -- cgit v1.2.3-59-g8ed1b