diff options
| author | jsing <> | 2023-02-16 10:41:03 +0000 |
|---|---|---|
| committer | jsing <> | 2023-02-16 10:41:03 +0000 |
| commit | b11f50c06cb0a98a91ab4cbfb49715c95ee07486 (patch) | |
| tree | 1567d4016a24536bb2e57960203cb4c640cd41e3 /src/lib/libcrypto/bn/arch/alpha | |
| parent | d439245c6f8c6bd9c887a6926c9934052a12c16b (diff) | |
| download | openbsd-b11f50c06cb0a98a91ab4cbfb49715c95ee07486.tar.gz openbsd-b11f50c06cb0a98a91ab4cbfb49715c95ee07486.tar.bz2 openbsd-b11f50c06cb0a98a91ab4cbfb49715c95ee07486.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/alpha')
| -rw-r--r-- | src/lib/libcrypto/bn/arch/alpha/bn_arch.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/arch/alpha/bn_arch.h b/src/lib/libcrypto/bn/arch/alpha/bn_arch.h index 0f7c582fdf..5bf4ba8722 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.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,20 +22,20 @@ | |||
| 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 | /* Unsigned multiplication using a umulh/mulq pair. */ | 32 | /* Unsigned multiplication using a umulh/mulq pair. */ |
| 33 | __asm__ ("umulh %2, %3, %0; mulq %2, %3, %1" | 33 | __asm__ ("umulh %2, %3, %0; mulq %2, %3, %1" |
| 34 | : "=&r"(h), "=r"(l) | 34 | : "=&r"(r1), "=r"(r0) |
| 35 | : "r"(a), "r"(b)); | 35 | : "r"(a), "r"(b)); |
| 36 | 36 | ||
| 37 | *out_h = h; | 37 | *out_r1 = r1; |
| 38 | *out_l = l; | 38 | *out_r0 = r0; |
| 39 | } | 39 | } |
| 40 | #endif /* __GNUC__ */ | 40 | #endif /* __GNUC__ */ |
| 41 | #endif | 41 | #endif |
