remove unnecessary calls to EC_POINT_copy()
This commit is contained in:
parent
870d3d5595
commit
532203cdb0
2 changed files with 0 additions and 12 deletions
|
@ -92,7 +92,6 @@ int ECDSA_generate_key(ECDSA *ecdsa)
|
||||||
else
|
else
|
||||||
pub_key = ecdsa->pub_key;
|
pub_key = ecdsa->pub_key;
|
||||||
|
|
||||||
if (!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(ecdsa->group))) goto err;
|
|
||||||
if (!EC_POINT_mul(ecdsa->group, pub_key, priv_key, NULL, NULL, ctx)) goto err;
|
if (!EC_POINT_mul(ecdsa->group, pub_key, priv_key, NULL, NULL, ctx)) goto err;
|
||||||
|
|
||||||
ecdsa->priv_key = priv_key;
|
ecdsa->priv_key = priv_key;
|
||||||
|
@ -130,7 +129,6 @@ int ECDSA_check_key(ECDSA *ecdsa)
|
||||||
if (ecdsa->priv_key)
|
if (ecdsa->priv_key)
|
||||||
{
|
{
|
||||||
if (BN_cmp(ecdsa->priv_key,order) >= 0) goto err;
|
if (BN_cmp(ecdsa->priv_key,order) >= 0) goto err;
|
||||||
if (!EC_POINT_copy(point,EC_GROUP_get0_generator(ecdsa->group))) goto err;
|
|
||||||
if (!EC_POINT_mul(ecdsa->group,point,ecdsa->priv_key,NULL,NULL,ctx)) goto err;
|
if (!EC_POINT_mul(ecdsa->group,point,ecdsa->priv_key,NULL,NULL,ctx)) goto err;
|
||||||
if (EC_POINT_cmp(ecdsa->group,point,ecdsa->pub_key,ctx) != 0) goto err;
|
if (EC_POINT_cmp(ecdsa->group,point,ecdsa->pub_key,ctx) != 0) goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,11 +159,6 @@ static int ecdsa_sign_setup(ECDSA *ecdsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM
|
||||||
reason = ERR_R_EC_LIB;
|
reason = ERR_R_EC_LIB;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (!EC_POINT_copy(tmp_point,EC_GROUP_get0_generator(ecdsa->group)))
|
|
||||||
{
|
|
||||||
reason = ERR_R_EC_LIB;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
if (!EC_GROUP_get_order(ecdsa->group,order,ctx))
|
if (!EC_GROUP_get_order(ecdsa->group,order,ctx))
|
||||||
{
|
{
|
||||||
reason = ERR_R_EC_LIB;
|
reason = ERR_R_EC_LIB;
|
||||||
|
@ -355,11 +350,6 @@ static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len, ECDSA_SIG *s
|
||||||
reason = ERR_R_EC_LIB;
|
reason = ERR_R_EC_LIB;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (!EC_POINT_copy(point,EC_GROUP_get0_generator(ecdsa->group)))
|
|
||||||
{
|
|
||||||
reason = ERR_R_EC_LIB;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
if (!EC_POINT_mul(ecdsa->group,point,u1,ecdsa->pub_key,u2,ctx)
|
if (!EC_POINT_mul(ecdsa->group,point,u1,ecdsa->pub_key,u2,ctx)
|
||||||
|| !EC_POINT_get_affine_coordinates(ecdsa->group,point,X,NULL,ctx))
|
|| !EC_POINT_get_affine_coordinates(ecdsa->group,point,X,NULL,ctx))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue