summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_lib.c5
-rw-r--r--crypto/bn/bn_mod.c3
-rw-r--r--crypto/bn/bn_nist.c4
3 files changed, 7 insertions, 5 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index cab87d9959..c46424c8ea 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -82,8 +82,9 @@ int BN_get_params(int which)
const BIGNUM *BN_value_one(void)
{
static const BN_ULONG data_one = 1L;
- static const BIGNUM const_one =
- { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA };
+ static const BIGNUM const_one = {
+ (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
+ };
return &const_one;
}
diff --git a/crypto/bn/bn_mod.c b/crypto/bn/bn_mod.c
index d7c2f4bd5b..4cb64b453b 100644
--- a/crypto/bn/bn_mod.c
+++ b/crypto/bn/bn_mod.c
@@ -8,6 +8,7 @@
*/
#include "internal/cryptlib.h"
+#include "internal/nelem.h"
#include "bn_local.h"
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
@@ -61,7 +62,7 @@ int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
if (bn_wexpand(r, mtop) == NULL)
return 0;
- if (mtop > sizeof(storage) / sizeof(storage[0])) {
+ if (mtop > OSSL_NELEM(storage)) {
tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG));
if (tp == NULL)
return 0;
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index bc864346fb..0d254736e0 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -84,8 +84,8 @@ static const BN_ULONG _nist_p_384_sqr[] = {
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL
};
-static const BN_ULONG _nist_p_521[] =
- { 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
+static const BN_ULONG _nist_p_521[] = {
+ 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL,