summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/arch/alpha/bn_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/arch/alpha/bn_arch.h')
-rw-r--r--src/lib/libcrypto/bn/arch/alpha/bn_arch.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/arch/alpha/bn_arch.h b/src/lib/libcrypto/bn/arch/alpha/bn_arch.h
index 136adf0e97..9bc00911ab 100644
--- a/src/lib/libcrypto/bn/arch/alpha/bn_arch.h
+++ b/src/lib/libcrypto/bn/arch/alpha/bn_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_arch.h,v 1.1 2023/01/20 10:04:33 jsing Exp $ */ 1/* $OpenBSD: bn_arch.h,v 1.2 2023/01/31 05:57:08 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -20,5 +20,25 @@
20 20
21#ifndef OPENSSL_NO_ASM 21#ifndef OPENSSL_NO_ASM
22 22
23#if 0 /* Needs testing and enabling. */
24#if defined(__GNUC__)
25#define HAVE_BN_UMUL_HILO
26
27static inline void
28bn_umul_hilo(BN_ULONG a, BN_ULONG b, BN_ULONG *out_h, BN_ULONG *out_l)
29{
30 BN_ULONG h, l;
31
32 /* Unsigned multiplication using a umulh/mulq pair. */
33 __asm__ ("umulh %2, %3, %0; mulq %2, %3, %1"
34 : "=r"(h), "=r"(l)
35 : "r"(a), "r"(b));
36
37 *out_h = h;
38 *out_l = l;
39}
40#endif /* __GNUC__ */
41#endif
42
23#endif 43#endif
24#endif 44#endif