diff options
author | jsing <> | 2022-11-26 13:56:33 +0000 |
---|---|---|
committer | jsing <> | 2022-11-26 13:56:33 +0000 |
commit | bcbac728558eebfaa4404c405e7dc22769585345 (patch) | |
tree | 9f1339c5b70b0cfa4e8a0a5c70345e837a21ce77 /src/lib/libcrypto/bn/bn_mul.c | |
parent | 90d0616c736d954d327f399daa636de8e6a2c4d5 (diff) | |
download | openbsd-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_mul.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mul.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c index fa9d559da9..0d8da8a6f6 100644 --- a/src/lib/libcrypto/bn/bn_mul.c +++ b/src/lib/libcrypto/bn/bn_mul.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_mul.c,v 1.21 2022/11/24 01:30:01 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mul.c,v 1.22 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 | * |
@@ -954,9 +954,6 @@ BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | |||
954 | fprintf(stderr, "BN_mul %d * %d\n",a->top,b->top); | 954 | fprintf(stderr, "BN_mul %d * %d\n",a->top,b->top); |
955 | #endif | 955 | #endif |
956 | 956 | ||
957 | bn_check_top(a); | ||
958 | bn_check_top(b); | ||
959 | bn_check_top(r); | ||
960 | 957 | ||
961 | al = a->top; | 958 | al = a->top; |
962 | bl = b->top; | 959 | bl = b->top; |
@@ -1092,7 +1089,6 @@ end: | |||
1092 | BN_copy(r, rr); | 1089 | BN_copy(r, rr); |
1093 | ret = 1; | 1090 | ret = 1; |
1094 | err: | 1091 | err: |
1095 | bn_check_top(r); | ||
1096 | BN_CTX_end(ctx); | 1092 | BN_CTX_end(ctx); |
1097 | return (ret); | 1093 | return (ret); |
1098 | } | 1094 | } |