curve25519-arm: simply call setend

Probably not good if this runs on a v8 CPU.
This commit is contained in:
Jason A. Donenfeld 2018-10-08 18:06:37 +02:00
parent 875ed1aa66
commit 3882caadbd
2 changed files with 5 additions and 3 deletions

View File

@ -26,8 +26,7 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_KEY_SIZE],
bool used_arch = false;
simd_get(&simd_context);
if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
!IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) && curve25519_use_neon &&
if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && curve25519_use_neon &&
simd_use(&simd_context)) {
curve25519_neon(mypublic, secret, basepoint);
used_arch = true;

View File

@ -7,8 +7,9 @@
* manually reworked for use in kernel space.
*/
#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(__ARMEB__)
#if defined(CONFIG_KERNEL_MODE_NEON)
#include <linux/linkage.h>
#include <asm/assembler.h>
.text
.fpu neon
@ -18,6 +19,7 @@
ENTRY(curve25519_neon)
push {r4-r11, lr}
mov ip, sp
ARM_BE8(setend le)
sub r3, sp, #704
and r3, r3, #0xfffffff0
mov sp, r3
@ -2058,6 +2060,7 @@ ENTRY(curve25519_neon)
str r8, [r0, #24]
str r1, [r0, #28]
movw r0, #0
ARM_BE8(setend be)
mov sp, ip
pop {r4-r11, pc}
ENDPROC(curve25519_neon)