<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bn/bn_recp.c, branch OPENBSD_7_9_BASE</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9_BASE</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9_BASE'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2025-05-10T05:54:39+00:00</updated>
<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>bn_recp: reformat another ugly comment</title>
<updated>2025-02-04T20:22:20+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-02-04T20:22:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=2076aae78095fd10e70ad30d488bdf5e9964ca98'/>
<id>urn:sha1:2076aae78095fd10e70ad30d488bdf5e9964ca98</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Inline BN_reciprocal() in its only caller</title>
<updated>2025-02-04T12:47:58+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-02-04T12:47:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=b732166c5143f7ab1b657c8c0581ad8e8449ce84'/>
<id>urn:sha1:b732166c5143f7ab1b657c8c0581ad8e8449ce84</id>
<content type='text'>
This is simpler, doesn't need an auxiliary function of dubious value,
avouds an auxiliary variable and gets rid of a bunch of comments that
are hard to make sense of.

This doesn't bother to invalidate recp-&gt;shift since on error you should
not be reusing the RECP_CTX without reinitializing it.

ok jsing
</content>
</entry>
<entry>
<title>Start cleaning up BN_div_reciprocal() a bit</title>
<updated>2025-02-04T05:09:53+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-02-04T05:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=09bef15f6dde7dfa51b7c2b40bd8dc186f44edf8'/>
<id>urn:sha1:09bef15f6dde7dfa51b7c2b40bd8dc186f44edf8</id>
<content type='text'>
The fast path where no division is performed can be dealt with without
BN_CTX, so do that up front so there's no need to clean up before return.
Error check BN_CTX_get() on each use asd simplify the logic for optional
input parameters. KNF for an ugly comment.

ok jsing
</content>
</entry>
<entry>
<title>bn_recp: Avoid complication for negative moduli</title>
<updated>2025-01-22T12:53:16+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-22T12:53:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=b247738e05b5336b6b755731d3686ac29e6cf54f'/>
<id>urn:sha1:b247738e05b5336b6b755731d3686ac29e6cf54f</id>
<content type='text'>
Instead of doing a weird dance, set the sign on N in BN_RECP_CTX_create().
Since we're not exposing a general purpose calculator API, we can simplify.

ok jsing
</content>
</entry>
<entry>
<title>Rename BN_div_recp() into BN_div_reciprocal()</title>
<updated>2025-01-22T10:12:01+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-22T10:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=cf4e92c24aed14f7d79286679af5bc35b2578741'/>
<id>urn:sha1:cf4e92c24aed14f7d79286679af5bc35b2578741</id>
<content type='text'>
Requested by jsing
</content>
</entry>
<entry>
<title>Split BN_mod_sqr_reciprocal() out of BN_mod_mul_reciprocal()</title>
<updated>2025-01-22T10:08:10+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-22T10:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=08809e17ad814f4314ef0a7cc09287483156803b'/>
<id>urn:sha1:08809e17ad814f4314ef0a7cc09287483156803b</id>
<content type='text'>
There's no need for BN_mod_mul_reciprocal() to have this complication.
The caller knows when x == y, so place the burden on the caller. This
simplifies both the caller side and the implementation in bn_recp.c.

ok jsing
</content>
</entry>
<entry>
<title>BN_mod_mul_reciprocal: remove y == NULL complication</title>
<updated>2025-01-22T09:39:56+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-22T09:39:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4beeaf6ba7000957e3b3dbf5ba0994c6c67f3b5e'/>
<id>urn:sha1:4beeaf6ba7000957e3b3dbf5ba0994c6c67f3b5e</id>
<content type='text'>
No caller ever passes y == NULL, so remove the corresponding contortions
and unindent the relevant bits.

ok jsing
</content>
</entry>
<entry>
<title>Move BN_RECP_CTX to the heap</title>
<updated>2025-01-21T15:44:22+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-21T15:44:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=797cf6b23360385bf34a89fce562aa5cb0a0e978'/>
<id>urn:sha1:797cf6b23360385bf34a89fce562aa5cb0a0e978</id>
<content type='text'>
This introduces a BN_RECP_CTX_create() function that allocates and
populates the BN_RECP_CTX in a single call, without taking an unused
BN_CTX argument.

At the same time, make the N and Nr members BIGNUMs on the heap which
are allocated by BN_RECP_CTX_create() and freed by BN_RECP_CTX_free()
and remove the unnecessary flags argument.

Garbage collect the now unused BN_RECP_CTX_{new,init,set}().

ok jsing
</content>
</entry>
<entry>
<title>Improve order of things in BN_RECP_CTX_set()</title>
<updated>2025-01-08T20:21:28+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-08T20:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5eda5e9155502d3f84e351050563569c99460c35'/>
<id>urn:sha1:5eda5e9155502d3f84e351050563569c99460c35</id>
<content type='text'>
+ some whitespace cosmetics
</content>
</entry>
</feed>
