diff options
| author | jsing <> | 2023-01-18 05:29:48 +0000 |
|---|---|---|
| committer | jsing <> | 2023-01-18 05:29:48 +0000 |
| commit | 71fa355f2b801f073987785afab4dd5544f0a82f (patch) | |
| tree | 7f339b877f5cd50bbbedc21243d50e66dc369e74 /src/lib/libcrypto | |
| parent | 177aff8a50c324c35b39633679fbfef806301885 (diff) | |
| download | openbsd-71fa355f2b801f073987785afab4dd5544f0a82f.tar.gz openbsd-71fa355f2b801f073987785afab4dd5544f0a82f.tar.bz2 openbsd-71fa355f2b801f073987785afab4dd5544f0a82f.zip | |
Bring in a description of bn_words_3_div().
This comes from OpenSSL commit 3da2e9c4ee45989a426ff513dc6c6250d1e460de.
ok tb@
Diffstat (limited to 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_div.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c index 7f0560f7c5..47e491ec46 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.30 2023/01/18 05:27:30 jsing Exp $ */ | 1 | /* $OpenBSD: bn_div.c,v 1.31 2023/01/18 05:29:48 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 | * |
| @@ -111,6 +111,14 @@ BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0); | |||
| 111 | # endif /* __GNUC__ */ | 111 | # endif /* __GNUC__ */ |
| 112 | #endif /* OPENSSL_NO_ASM */ | 112 | #endif /* OPENSSL_NO_ASM */ |
| 113 | 113 | ||
| 114 | /* | ||
| 115 | * Interface is somewhat quirky, |m| is pointer to most significant limb, | ||
| 116 | * and less significant limb is referred at |m[-1]|. This means that caller | ||
| 117 | * is responsible for ensuring that |m[-1]| is valid. Second condition that | ||
| 118 | * has to be met is that |d0|'s most significant bit has to be set. Or in | ||
| 119 | * other words divisor has to be "bit-aligned to the left." The subroutine | ||
| 120 | * considers four limbs, two of which are "overlapping," hence the name... | ||
| 121 | */ | ||
| 114 | BN_ULONG | 122 | BN_ULONG |
| 115 | bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0) | 123 | bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0) |
| 116 | { | 124 | { |
