summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/bn/bn_div.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index e60fb84062..e8f17fff03 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.34 2023/01/28 16:33:34 jsing Exp $ */ 1/* $OpenBSD: bn_div.c,v 1.35 2023/01/28 16:58:24 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -156,12 +156,17 @@ bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
156 */ 156 */
157#ifndef HAVE_BN_DIV_REM_WORDS 157#ifndef HAVE_BN_DIV_REM_WORDS
158#ifndef HAVE_BN_DIV_REM_WORDS_INLINE 158#ifndef HAVE_BN_DIV_REM_WORDS_INLINE
159static inline 159static inline void
160bn_div_rem_words_inline(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q, 160bn_div_rem_words_inline(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q,
161 BN_ULONG *out_r) 161 BN_ULONG *out_r)
162{ 162{
163 *q = bn_div_words(h, l, d); 163 BN_ULONG q, r;
164 *r = (l - q * d) & BN_MASK2; 164
165 q = bn_div_words(h, l, d);
166 r = (l - q * d) & BN_MASK2;
167
168 *out_q = q;
169 *out_r = r;
165} 170}
166#endif 171#endif
167 172