summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_recp.c
diff options
context:
space:
mode:
authorjsing <>2022-11-26 13:56:33 +0000
committerjsing <>2022-11-26 13:56:33 +0000
commitbcbac728558eebfaa4404c405e7dc22769585345 (patch)
tree9f1339c5b70b0cfa4e8a0a5c70345e837a21ce77 /src/lib/libcrypto/bn/bn_recp.c
parent90d0616c736d954d327f399daa636de8e6a2c4d5 (diff)
downloadopenbsd-bcbac728558eebfaa4404c405e7dc22769585345.tar.gz
openbsd-bcbac728558eebfaa4404c405e7dc22769585345.tar.bz2
openbsd-bcbac728558eebfaa4404c405e7dc22769585345.zip
Remove BIGNUM consistency macros.
Compiling with BN_DEBUG (and if you want to take it further, BN_DEBUG_RAND) supposedly adds consistency checks to the BN code. These are rarely if ever used and introduce a bunch of clutter in the code. Furthermore, there are hacks in place to undo things that the debugging code does. Remove all of this mess and instead rely on always enabled checks, more readable code and proper regress coverage to ensure correct behaviour. "Good riddance." tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_recp.c')
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index 6588d33033..8959f6bd3c 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.16 2022/11/26 13:56:33 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 *
@@ -134,7 +134,6 @@ BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
134 134
135err: 135err:
136 BN_CTX_end(ctx); 136 BN_CTX_end(ctx);
137 bn_check_top(r);
138 return (ret); 137 return (ret);
139} 138}
140 139
@@ -228,8 +227,6 @@ BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp,
228 227
229err: 228err:
230 BN_CTX_end(ctx); 229 BN_CTX_end(ctx);
231 bn_check_top(dv);
232 bn_check_top(rem);
233 return (ret); 230 return (ret);
234} 231}
235 232
@@ -257,7 +254,6 @@ BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)
257 ret = len; 254 ret = len;
258 255
259err: 256err:
260 bn_check_top(r);
261 BN_CTX_end(ctx); 257 BN_CTX_end(ctx);
262 return (ret); 258 return (ret);
263} 259}