summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/arch/i386')
-rw-r--r--src/lib/libcrypto/bn/arch/i386/bn_arch.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/arch/i386/bn_arch.h b/src/lib/libcrypto/bn/arch/i386/bn_arch.h
index e2b4957efc..268c51e41a 100644
--- a/src/lib/libcrypto/bn/arch/i386/bn_arch.h
+++ b/src/lib/libcrypto/bn/arch/i386/bn_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_arch.h,v 1.7 2023/01/28 16:33:34 jsing Exp $ */ 1/* $OpenBSD: bn_arch.h,v 1.8 2023/01/31 05:53:49 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -60,5 +60,27 @@ bn_div_rem_words_inline(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q,
60} 60}
61#endif /* __GNUC__ */ 61#endif /* __GNUC__ */
62 62
63#if defined(__GNUC__)
64#define HAVE_BN_UMUL_HILO
65
66static inline void
67bn_umul_hilo(BN_ULONG a, BN_ULONG b, BN_ULONG *out_h, BN_ULONG *out_l)
68{
69 BN_ULONG h, l;
70
71 /*
72 * Unsigned multiplication of %eax, with the double word result being
73 * stored in %edx:%eax.
74 */
75 __asm__ ("mull %3"
76 : "=d"(h), "=a"(l)
77 : "a"(a), "rm"(b)
78 : "cc");
79
80 *out_h = h;
81 *out_l = l;
82}
83#endif /* __GNUC__ */
84
63#endif 85#endif
64#endif 86#endif