summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/bn/arch/aarch64/bn_arch.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h b/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h
index 9d61bc9114..b382d1a860 100644
--- a/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h
+++ b/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_arch.h,v 1.5 2023/02/17 05:46:57 jsing Exp $ */ 1/* $OpenBSD: bn_arch.h,v 1.6 2023/02/25 15:39:40 bcook Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -31,7 +31,9 @@ bn_addw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0)
31{ 31{
32 BN_ULONG carry, r0; 32 BN_ULONG carry, r0;
33 33
34 __asm__ ("adds %1, %2, %3; cset %0, cs" 34 __asm__ (
35 "adds %1, %2, %3 \n"
36 "cset %0, cs"
35 : "=r"(carry), "=r"(r0) 37 : "=r"(carry), "=r"(r0)
36 : "r"(a), "r"(b) 38 : "r"(a), "r"(b)
37 : "cc"); 39 : "cc");
@@ -48,7 +50,9 @@ bn_mulw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0)
48 BN_ULONG r1, r0; 50 BN_ULONG r1, r0;
49 51
50 /* Unsigned multiplication using a umulh/mul pair. */ 52 /* Unsigned multiplication using a umulh/mul pair. */
51 __asm__ ("umulh %0, %2, %3; mul %1, %2, %3" 53 __asm__ (
54 "umulh %0, %2, %3 \n"
55 "mul %1, %2, %3"
52 : "=&r"(r1), "=r"(r0) 56 : "=&r"(r1), "=r"(r0)
53 : "r"(a), "r"(b)); 57 : "r"(a), "r"(b));
54 58
@@ -63,7 +67,9 @@ bn_subw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_borrow, BN_ULONG *out_r0)
63{ 67{
64 BN_ULONG borrow, r0; 68 BN_ULONG borrow, r0;
65 69
66 __asm__ ("subs %1, %2, %3; cset %0, cc" 70 __asm__ (
71 "subs %1, %2, %3 \n"
72 "cset %0, cc"
67 : "=r"(borrow), "=r"(r0) 73 : "=r"(borrow), "=r"(r0)
68 : "r"(a), "r"(b) 74 : "r"(a), "r"(b)
69 : "cc"); 75 : "cc");