summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-12-01 23:11:45 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-12-01 23:11:45 +0000
commitb74cc0776b97a55f9a17c67d43d694211f734c75 (patch)
tree3fd9ccaac437a8f1eb7fe75b52602c96ea206ce7
parente7e5fe4705233fb0e59dbf8ba19b8e0da004acd6 (diff)
Add missing bn_check_top()s to bn_kron.c, remove some miscellaneous
white-space, and include extra headers to satisfy debugging builds.
-rw-r--r--crypto/bn/bn_kron.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/bn/bn_kron.c b/crypto/bn/bn_kron.c
index 49f75594ae..740359b752 100644
--- a/crypto/bn/bn_kron.c
+++ b/crypto/bn/bn_kron.c
@@ -53,9 +53,9 @@
*
*/
+#include "cryptlib.h"
#include "bn_lcl.h"
-
/* least significant word */
#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
@@ -74,6 +74,9 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
*/
static const int tab[8] = {0, 1, 0, -1, 0, -1, 0, 1};
+ bn_check_top(a);
+ bn_check_top(b);
+
BN_CTX_start(ctx);
A = BN_CTX_get(ctx);
B = BN_CTX_get(ctx);
@@ -172,8 +175,7 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
tmp = A; A = B; B = tmp;
tmp->neg = 0;
}
-
- end:
+end:
BN_CTX_end(ctx);
if (err)
return -2;