<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bn/bn_div.c, branch OPENBSD_7_9</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2025-09-07T06:28:03+00:00</updated>
<entry>
<title>Remove BN_DIV2W.</title>
<updated>2025-09-07T06:28:03+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2025-09-07T06:28:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=98287b7cd5d64488bbaf57088225f91bd8e8a7f9'/>
<id>urn:sha1:98287b7cd5d64488bbaf57088225f91bd8e8a7f9</id>
<content type='text'>
The BN_DIV2W define provides a code path for double word division via the C
compiler, which is only enabled on hppa. Simplify the code and mop this up.

ok tb@
</content>
</entry>
<entry>
<title>Rename bn_mul_words()/bn_mul_add_words().</title>
<updated>2025-08-30T07:54:27+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2025-08-30T07:54:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=694b88dc8ad458db9997e90128806a423fec09db'/>
<id>urn:sha1:694b88dc8ad458db9997e90128806a423fec09db</id>
<content type='text'>
Most bn_.*_words() functions operate on two word arrays, however
bn_mul_words() and bn_mul_add_words() operate on one word array and
multiply by a single word. Rename these to bn_mulw_words() and
bn_mulw_add_words() to reflect this, following naming scheme that we use
for primitives.

This frees up bn_mul_words() to actually be used for multiplying two word
arrays. Rename bn_mul_normal() to bn_mul_words(), which will then become
one of the possible assembly integration points.

ok tb@
</content>
</entry>
<entry>
<title>Use err_local.h rather than err.h in most places</title>
<updated>2025-05-10T05:54:39+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-10T05:54:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=41e8f99dd1625a9f0c80ce9d4383e95b18e85709'/>
<id>urn:sha1:41e8f99dd1625a9f0c80ce9d4383e95b18e85709</id>
<content type='text'>
ok jsing
</content>
</entry>
<entry>
<title>Hide symbols in bn.h</title>
<updated>2024-04-10T14:58:06+00:00</updated>
<author>
<name>beck</name>
<email></email>
</author>
<published>2024-04-10T14:58:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c1002fc07c1599164ea7518630da25bd606c9993'/>
<id>urn:sha1:c1002fc07c1599164ea7518630da25bd606c9993</id>
<content type='text'>
Mark them LCRYPTO_UNUSED appropriately and remove the LIBRESSL_INTERNAL
guards around them

ok tb@
</content>
</entry>
<entry>
<title>Convert BN_copy() with explicit comparison against NULL to bn_copy()</title>
<updated>2023-03-27T10:21:23+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2023-03-27T10:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a81a8ccd42d8aec45ab93fd62a292dc1d27c0db6'/>
<id>urn:sha1:a81a8ccd42d8aec45ab93fd62a292dc1d27c0db6</id>
<content type='text'>
ok jsing
</content>
</entry>
<entry>
<title>Rename bn_umul_hilo() to bn_mulw().</title>
<updated>2023-02-16T10:41:03+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-02-16T10:41:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=b11f50c06cb0a98a91ab4cbfb49715c95ee07486'/>
<id>urn:sha1:b11f50c06cb0a98a91ab4cbfb49715c95ee07486</id>
<content type='text'>
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@
</content>
</entry>
<entry>
<title>Fix a -0 corner case in BN_div_internal()</title>
<updated>2023-02-14T18:19:27+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-02-14T18:19:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=facea515d845f4df27719fa12f3aae9eb2fc2baf'/>
<id>urn:sha1:facea515d845f4df27719fa12f3aae9eb2fc2baf</id>
<content type='text'>
If the numerator is negative, the numerator and divisor are the same
length (in words) and the absolute value of the divisor &gt; the absolute
value of the numerator, the "no_branch" case produces -0 since negative
has already been set. Call BN_set_negative() at the end of the function
to avoid this.

ok tb@
</content>
</entry>
<entry>
<title>Avoid negative zero.</title>
<updated>2023-02-13T04:25:37+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-02-13T04:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=53aa84bf6a4cfaffa003a28a5651a7f30bd74400'/>
<id>urn:sha1:53aa84bf6a4cfaffa003a28a5651a7f30bd74400</id>
<content type='text'>
Whenever setting negative to one (or when it could potentially be one),
always use BN_set_negative() since it checks for a zero valued bignum and
will not permit negative to be set in this case. Since BN_is_zero()
currently relies on top == 0, call BN_set_negative() after top has been
set (or bn_correct_top() has been called).

This fixes a long standing issue where -0 and +0 have been permitted,
however multiple code paths (such as BN_cmp()) fail to treat these as
equivalent.

Prompted by Guido Vranken who is adding negative zero fuzzing to oss-fuzz.

ok tb@
</content>
</entry>
<entry>
<title>Simplify bn_div_3_words().</title>
<updated>2023-01-31T06:08:23+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-01-31T06:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=12345796ff3076995284ebe35c7768b8c7d56cbd'/>
<id>urn:sha1:12345796ff3076995284ebe35c7768b8c7d56cbd</id>
<content type='text'>
Make use of bn_umul_hilo() and remove the tangle of preprocessor directives
that implement different code paths depending on what defines exist.

ok tb@
</content>
</entry>
<entry>
<title>Fix previous.</title>
<updated>2023-01-28T16:58:24+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-01-28T16:58:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=51f6bf54ed0ca417a8e838b9045b90fcfd53bcf5'/>
<id>urn:sha1:51f6bf54ed0ca417a8e838b9045b90fcfd53bcf5</id>
<content type='text'>
</content>
</entry>
</feed>
