diff options
Diffstat (limited to 'src/lib/libcrypto/bn/arch/riscv64/bn_arch.h')
-rw-r--r-- | src/lib/libcrypto/bn/arch/riscv64/bn_arch.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/arch/riscv64/bn_arch.h b/src/lib/libcrypto/bn/arch/riscv64/bn_arch.h index 36cf3a4f66..354774cde3 100644 --- a/src/lib/libcrypto/bn/arch/riscv64/bn_arch.h +++ b/src/lib/libcrypto/bn/arch/riscv64/bn_arch.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_arch.h,v 1.3 2023/02/04 11:48:55 jsing Exp $ */ | 1 | /* $OpenBSD: bn_arch.h,v 1.4 2023/02/16 10:41:03 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -22,12 +22,12 @@ | |||
22 | 22 | ||
23 | #if 0 /* Needs testing and enabling. */ | 23 | #if 0 /* Needs testing and enabling. */ |
24 | #if defined(__GNUC__) | 24 | #if defined(__GNUC__) |
25 | #define HAVE_BN_UMUL_HILO | 25 | #define HAVE_BN_MULW |
26 | 26 | ||
27 | static inline void | 27 | static inline void |
28 | bn_umul_hilo(BN_ULONG a, BN_ULONG b, BN_ULONG *out_h, BN_ULONG *out_l) | 28 | bn_mulw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0) |
29 | { | 29 | { |
30 | BN_ULONG h, l; | 30 | BN_ULONG r1, r0; |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Unsigned multiplication using a mulh/mul pair. Note that the order | 33 | * Unsigned multiplication using a mulh/mul pair. Note that the order |
@@ -35,11 +35,11 @@ bn_umul_hilo(BN_ULONG a, BN_ULONG b, BN_ULONG *out_h, BN_ULONG *out_l) | |||
35 | * into a single operation. | 35 | * into a single operation. |
36 | */ | 36 | */ |
37 | __asm__ ("mulh %0, %2, %3; mul %1, %2, %3" | 37 | __asm__ ("mulh %0, %2, %3; mul %1, %2, %3" |
38 | : "=&r"(h), "=r"(l) | 38 | : "=&r"(r1), "=r"(r0) |
39 | : "r"(a), "r"(b)); | 39 | : "r"(a), "r"(b)); |
40 | 40 | ||
41 | *out_h = h; | 41 | *out_r1 = r1; |
42 | *out_l = l; | 42 | *out_r0 = r0; |
43 | } | 43 | } |
44 | #endif /* __GNUC__ */ | 44 | #endif /* __GNUC__ */ |
45 | #endif | 45 | #endif |