Simplify BN_cmp() and BN_ucmp().
authorjsing <jsing@openbsd.org>
Fri, 23 Dec 2022 03:15:35 +0000 (03:15 +0000)
committerjsing <jsing@openbsd.org>
Fri, 23 Dec 2022 03:15:35 +0000 (03:15 +0000)
commitb0242bdad2acb2d733340eef20d3ed1c50235cfa
treeac13ea98075a28a50d44135ca7d7a9baf36a2a31
parentbcc93ea7f948356d8ff69d92e9bb7529af0b559a
Simplify BN_cmp() and BN_ucmp().

The only real difference between BN_cmp() and BN_ucmp() is that one has
to respect the sign of the BN (although BN_cmp() also gets to deal with
some insanity from accepting NULLs). Rewrite/cleanup BN_ucmp() and turn
BN_cmp() into code that handles differences in sign, before calling
BN_ucmp().

ok tb@
lib/libcrypto/bn/bn_lib.c