<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bn/bn_convert.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-12-05T14:12:32+00:00</updated>
<entry>
<title>libcrypto: make most of the BN_* macro pollution internal</title>
<updated>2025-12-05T14:12:32+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-12-05T14:12:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=f3f05f0cf8c30a990193e332e26fdd8e54b3f59b'/>
<id>urn:sha1:f3f05f0cf8c30a990193e332e26fdd8e54b3f59b</id>
<content type='text'>
This is a first sweep of reducing the number of terribly named macros
in bn.h More can go away. Those we need internally go to bn_local.h.
Annoyingly bn_internal.h uses some of them, so it includes bn_local.h
now. This can be cleaned up later.

ok jsing kenjiro
</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>Rewrite bn2binpad.</title>
<updated>2024-11-08T14:18:44+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-11-08T14:18:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=acc652186bbeb9458b641b1bffef14c7599bf465'/>
<id>urn:sha1:acc652186bbeb9458b641b1bffef14c7599bf465</id>
<content type='text'>
Rewrite bn2binpad, removing some OpenSSL specific behaviour and unnecessary
complexity. Our BN_num_bytes() does not return bogus lengths, so we don't
need to see if things work out with nominated outputs. Swipe away some
endianness_t, but continue to ignore negatives and don't dare give away
padded zeroes.

Implement a more readable constant time conversion. In particular, the
little endian is the less common use case, which we can implement by
reversing the padded output in place, rather than complicating all of the
conversion code.

ok beck@ tb@
</content>
</entry>
<entry>
<title>Rewrite BN_bn2mpi() using CBB.</title>
<updated>2024-06-22T16:33:00+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-06-22T16:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=46f3ac9ae9fffef6fa45edd1e316dc038aac3506'/>
<id>urn:sha1:46f3ac9ae9fffef6fa45edd1e316dc038aac3506</id>
<content type='text'>
The content is effectively a u32 length prefixed field, so use
CBB_add_u32_length_prefixed(). Use BN_bn2binpad() rather than manually
padding if we need to extend and use sensible variable names so that the
code becomes more readable.

Note that since CBB can fail we now need to be able to indicate failure.
This means that BN_bn2mpi() can now return -1 when it would not have
previously (correct callers will check that BN_bn2mpi() returns a positive
length).

ok tb@
</content>
</entry>
<entry>
<title>bn_convert: zap extra blank line</title>
<updated>2024-04-17T21:55:43+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2024-04-17T21:55:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=fb1a8499f5efda58a4a49fccfe94fed7fde87d5d'/>
<id>urn:sha1:fb1a8499f5efda58a4a49fccfe94fed7fde87d5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rewrite BN_mpi2bn() using CBS and bn_bin2bn_cbs().</title>
<updated>2024-04-17T14:47:17+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-04-17T14:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=501a5fea8ddd4572c9635ad63b4e7bc7f4a42b76'/>
<id>urn:sha1:501a5fea8ddd4572c9635ad63b4e7bc7f4a42b76</id>
<content type='text'>
ok tb@
</content>
</entry>
<entry>
<title>Rewrite BN_lebin2bn() using CBS.</title>
<updated>2024-04-17T14:45:46+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-04-17T14:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=57550569e5f6adbeb909274b4691bcb6888c78a0'/>
<id>urn:sha1:57550569e5f6adbeb909274b4691bcb6888c78a0</id>
<content type='text'>
We get an implementation of this for free by having bn_bin2bn_cbs() use
CBS_get_u8() instead of CBS_get_last_u8().

ok tb@
</content>
</entry>
<entry>
<title>Invert BN_BITS2 handling in bn_bin2bn_cbs() and bn_hex2bn_cbs().</title>
<updated>2024-04-16T13:14:46+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-04-16T13:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a2d33edef120713fca38edea57eba33f8e3ba217'/>
<id>urn:sha1:a2d33edef120713fca38edea57eba33f8e3ba217</id>
<content type='text'>
This results in simpler code.

Suggested by tb@ during review.
</content>
</entry>
<entry>
<title>Rewrite BN_bin2bn() using CBS.</title>
<updated>2024-04-16T13:11:37+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-04-16T13:11:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=8616d66dbd9b93e2acc6f471938de8f646a5db24'/>
<id>urn:sha1:8616d66dbd9b93e2acc6f471938de8f646a5db24</id>
<content type='text'>
ok tb@
</content>
</entry>
<entry>
<title>Rename bn_expand() to bn_expand_bits().</title>
<updated>2024-04-16T13:04:05+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-04-16T13:04:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0cf1dfb91461e728170657af9f15ff5bbb00d2f9'/>
<id>urn:sha1:0cf1dfb91461e728170657af9f15ff5bbb00d2f9</id>
<content type='text'>
Also change the bits type from int to size_t, since that's what the callers
are passing and we can avoid unnecessary input validation.

ok tb@
</content>
</entry>
</feed>
