summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_gf2m.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-05-02 18:30:00 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-05-03 12:53:08 +0100
commitb6eb9827a6866981c08cc9613ca8b4a648894fb1 (patch)
treec5a6351461d8be964bc1f31fa2e34c4ebb7cfafd /crypto/bn/bn_gf2m.c
parent31ff45aa975acb43f1da20e714eadf4649655714 (diff)
Add OSSL_NELEM macro.
Add OSSL_NELEM macro to e_os.h to determine the number of elements in an array. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/bn/bn_gf2m.c')
-rw-r--r--crypto/bn/bn_gf2m.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c
index 7c0d4afc71..c87c5d96f8 100644
--- a/crypto/bn/bn_gf2m.c
+++ b/crypto/bn/bn_gf2m.c
@@ -473,8 +473,8 @@ int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p)
int arr[6];
bn_check_top(a);
bn_check_top(p);
- ret = BN_GF2m_poly2arr(p, arr, sizeof(arr) / sizeof(arr[0]));
- if (!ret || ret > (int)(sizeof(arr) / sizeof(arr[0]))) {
+ ret = BN_GF2m_poly2arr(p, arr, OSSL_NELEM(arr));
+ if (!ret || ret > (int)OSSL_NELEM(arr)) {
BNerr(BN_F_BN_GF2M_MOD, BN_R_INVALID_LENGTH);
return 0;
}