diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_kron.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_kron.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_kron.c b/src/lib/libcrypto/bn/bn_kron.c index 49f75594ae..740359b752 100644 --- a/src/lib/libcrypto/bn/bn_kron.c +++ b/src/lib/libcrypto/bn/bn_kron.c | |||
@@ -53,9 +53,9 @@ | |||
53 | * | 53 | * |
54 | */ | 54 | */ |
55 | 55 | ||
56 | #include "cryptlib.h" | ||
56 | #include "bn_lcl.h" | 57 | #include "bn_lcl.h" |
57 | 58 | ||
58 | |||
59 | /* least significant word */ | 59 | /* least significant word */ |
60 | #define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0]) | 60 | #define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0]) |
61 | 61 | ||
@@ -74,6 +74,9 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | |||
74 | */ | 74 | */ |
75 | static const int tab[8] = {0, 1, 0, -1, 0, -1, 0, 1}; | 75 | static const int tab[8] = {0, 1, 0, -1, 0, -1, 0, 1}; |
76 | 76 | ||
77 | bn_check_top(a); | ||
78 | bn_check_top(b); | ||
79 | |||
77 | BN_CTX_start(ctx); | 80 | BN_CTX_start(ctx); |
78 | A = BN_CTX_get(ctx); | 81 | A = BN_CTX_get(ctx); |
79 | B = BN_CTX_get(ctx); | 82 | B = BN_CTX_get(ctx); |
@@ -172,8 +175,7 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | |||
172 | tmp = A; A = B; B = tmp; | 175 | tmp = A; A = B; B = tmp; |
173 | tmp->neg = 0; | 176 | tmp->neg = 0; |
174 | } | 177 | } |
175 | 178 | end: | |
176 | end: | ||
177 | BN_CTX_end(ctx); | 179 | BN_CTX_end(ctx); |
178 | if (err) | 180 | if (err) |
179 | return -2; | 181 | return -2; |