diff options
Diffstat (limited to 'crypto/ec/ec_curve.c')
-rw-r--r-- | crypto/ec/ec_curve.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index 8bba3bcb83..d0f1fcb2fd 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -74,6 +74,7 @@ #include <openssl/err.h> #include <openssl/obj_mac.h> #include <openssl/opensslconf.h> +#include "e_os.h" typedef struct { int field_type, /* either NID_X9_62_prime_field or @@ -3022,7 +3023,7 @@ static const ec_list_element curve_list[] = { "RFC 5639 curve over a 512 bit prime field"}, }; -#define curve_list_length (sizeof(curve_list)/sizeof(ec_list_element)) +#define curve_list_length OSSL_NELEM(curve_list) static EC_GROUP *ec_group_new_from_data(const ec_list_element curve) { @@ -3194,7 +3195,7 @@ static EC_NIST_NAME nist_curves[] = { const char *EC_curve_nid2nist(int nid) { size_t i; - for (i = 0; i < sizeof(nist_curves) / sizeof(EC_NIST_NAME); i++) { + for (i = 0; i < OSSL_NELEM(nist_curves); i++) { if (nist_curves[i].nid == nid) return nist_curves[i].name; } @@ -3204,7 +3205,7 @@ const char *EC_curve_nid2nist(int nid) int EC_curve_nist2nid(const char *name) { size_t i; - for (i = 0; i < sizeof(nist_curves) / sizeof(EC_NIST_NAME); i++) { + for (i = 0; i < OSSL_NELEM(nist_curves); i++) { if (!strcmp(nist_curves[i].name, name)) return nist_curves[i].nid; } |