diff options
| author | jsing <> | 2023-02-16 10:41:03 +0000 |
|---|---|---|
| committer | jsing <> | 2023-02-16 10:41:03 +0000 |
| commit | d3699a732b869a27d4edac40e74816362ea9be8a (patch) | |
| tree | 1567d4016a24536bb2e57960203cb4c640cd41e3 /src/lib/libcrypto/bn/arch/amd64 | |
| parent | 86621357e60f9e67b9a598c67567b92aeaead6ba (diff) | |
| download | openbsd-d3699a732b869a27d4edac40e74816362ea9be8a.tar.gz openbsd-d3699a732b869a27d4edac40e74816362ea9be8a.tar.bz2 openbsd-d3699a732b869a27d4edac40e74816362ea9be8a.zip | |
Rename bn_umul_hilo() to bn_mulw().
This keeps the naming consistent with the other bignum primitives that have
been recently introduced. Also, use 1/0 intead of h/l (e.g. a1 instead of
ah), as this keeps consistency with other primitives and allows for naming
that works with double word, triple word and quadruple word inputs/outputs.
Discussed with tb@
Diffstat (limited to 'src/lib/libcrypto/bn/arch/amd64')
| -rw-r--r-- | src/lib/libcrypto/bn/arch/amd64/bn_arch.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/arch/amd64/bn_arch.h b/src/lib/libcrypto/bn/arch/amd64/bn_arch.h index 637903077a..80f73bf15f 100644 --- a/src/lib/libcrypto/bn/arch/amd64/bn_arch.h +++ b/src/lib/libcrypto/bn/arch/amd64/bn_arch.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_arch.h,v 1.11 2023/02/04 14:00:18 jsing Exp $ */ | 1 | /* $OpenBSD: bn_arch.h,v 1.12 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 | * |
| @@ -63,24 +63,24 @@ bn_div_rem_words_inline(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q, | |||
| 63 | #endif /* __GNUC__ */ | 63 | #endif /* __GNUC__ */ |
| 64 | 64 | ||
| 65 | #if defined(__GNUC__) | 65 | #if defined(__GNUC__) |
| 66 | #define HAVE_BN_UMUL_HILO | 66 | #define HAVE_BN_MULW |
| 67 | 67 | ||
| 68 | static inline void | 68 | static inline void |
| 69 | bn_umul_hilo(BN_ULONG a, BN_ULONG b, BN_ULONG *out_h, BN_ULONG *out_l) | 69 | bn_mulw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0) |
| 70 | { | 70 | { |
| 71 | BN_ULONG h, l; | 71 | BN_ULONG r1, r0; |
| 72 | 72 | ||
| 73 | /* | 73 | /* |
| 74 | * Unsigned multiplication of %rax, with the double word result being | 74 | * Unsigned multiplication of %rax, with the double word result being |
| 75 | * stored in %rdx:%rax. | 75 | * stored in %rdx:%rax. |
| 76 | */ | 76 | */ |
| 77 | __asm__ ("mulq %3" | 77 | __asm__ ("mulq %3" |
| 78 | : "=d"(h), "=a"(l) | 78 | : "=d"(r1), "=a"(r0) |
| 79 | : "a"(a), "rm"(b) | 79 | : "a"(a), "rm"(b) |
| 80 | : "cc"); | 80 | : "cc"); |
| 81 | 81 | ||
| 82 | *out_h = h; | 82 | *out_r1 = r1; |
| 83 | *out_l = l; | 83 | *out_r0 = r0; |
| 84 | } | 84 | } |
| 85 | #endif /* __GNUC__ */ | 85 | #endif /* __GNUC__ */ |
| 86 | 86 | ||
