summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/bn/arch/aarch64/bn_arch.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h b/src/lib/libcrypto/bn/arch/aarch64/bn_arch.h
index aa780e09e9..66de3682d4 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.11 2023/06/17 15:40:46 jsing Exp $ */ 1/* $OpenBSD: bn_arch.h,v 1.12 2023/06/21 07:56:43 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -24,6 +24,20 @@
24 24
25#if defined(__GNUC__) 25#if defined(__GNUC__)
26 26
27#define HAVE_BN_CLZW
28
29static inline int
30bn_clzw(BN_ULONG w)
31{
32 BN_ULONG n;
33
34 __asm__ ("clz %[n], %[w]"
35 : [n]"=r"(n)
36 : [w]"r"(w));
37
38 return n;
39}
40
27#define HAVE_BN_ADDW 41#define HAVE_BN_ADDW
28 42
29static inline void 43static inline void