提交 e5b2ea0a 编写于 作者: D Dr. Stephen Henson

Add group_order_bits to EC_METHOD.

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NEmilia Käsper <emilia@openssl.org>
上级 3e8ee475
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册