mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Add group_order_bits to EC_METHOD.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
This commit is contained in:
parent
3e8ee4753c
commit
e5b2ea0ac3
@ -85,6 +85,7 @@ const EC_METHOD *EC_GF2m_simple_method(void)
|
||||
ec_GF2m_simple_group_set_curve,
|
||||
ec_GF2m_simple_group_get_curve,
|
||||
ec_GF2m_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GF2m_simple_group_check_discriminant,
|
||||
ec_GF2m_simple_point_init,
|
||||
ec_GF2m_simple_point_finish,
|
||||
|
@ -112,6 +112,7 @@ struct ec_method_st {
|
||||
BN_CTX *);
|
||||
/* used by EC_GROUP_get_degree: */
|
||||
int (*group_get_degree) (const EC_GROUP *);
|
||||
int (*group_order_bits) (const EC_GROUP *);
|
||||
/* used by EC_GROUP_check: */
|
||||
int (*group_check_discriminant) (const EC_GROUP *, BN_CTX *);
|
||||
/*
|
||||
|
@ -373,6 +373,8 @@ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)
|
||||
|
||||
int EC_GROUP_order_bits(const EC_GROUP *group)
|
||||
{
|
||||
if (group->meth->group_order_bits)
|
||||
return group->meth->group_order_bits(group);
|
||||
if (group->order)
|
||||
return BN_num_bits(group->order);
|
||||
return 0;
|
||||
|
@ -76,6 +76,7 @@ const EC_METHOD *EC_GFp_mont_method(void)
|
||||
ec_GFp_mont_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -78,6 +78,7 @@ const EC_METHOD *EC_GFp_nist_method(void)
|
||||
ec_GFp_nist_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -245,6 +245,7 @@ const EC_METHOD *EC_GFp_nistp224_method(void)
|
||||
ec_GFp_nistp224_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -1774,6 +1774,7 @@ const EC_METHOD *EC_GFp_nistp256_method(void)
|
||||
ec_GFp_nistp256_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -1603,6 +1603,7 @@ const EC_METHOD *EC_GFp_nistp521_method(void)
|
||||
ec_GFp_nistp521_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -1441,6 +1441,7 @@ const EC_METHOD *EC_GFp_nistz256_method(void)
|
||||
ec_GFp_mont_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
@ -79,6 +79,7 @@ const EC_METHOD *EC_GFp_simple_method(void)
|
||||
ec_GFp_simple_group_set_curve,
|
||||
ec_GFp_simple_group_get_curve,
|
||||
ec_GFp_simple_group_get_degree,
|
||||
0, /* group_order_bits */
|
||||
ec_GFp_simple_group_check_discriminant,
|
||||
ec_GFp_simple_point_init,
|
||||
ec_GFp_simple_point_finish,
|
||||
|
Loading…
Reference in New Issue
Block a user