goto end;
}
ok = 1;
-end:
+ end:
if (P)
EC_POINT_free(P);
if (grp)
md = hashsum2bn(dgst, dlen);
newsig = DSA_SIG_new();
if (!newsig || !md) {
- GOSTerr(GOST_F_GOST_EC_SIGN, GOST_R_NO_MEMORY);
+ GOSTerr(GOST_F_GOST_EC_SIGN, ERR_R_MALLOC_FAILURE);
goto err;
}
group = EC_KEY_get0_group(eckey);
do {
do {
if (!BN_rand_range(k, order)) {
- GOSTerr(GOST_F_GOST_EC_SIGN,
- GOST_R_RANDOM_NUMBER_GENERATOR_FAILED);
+ GOSTerr(GOST_F_GOST_EC_SIGN, GOST_R_RNG_ERROR);
goto err;
}
/*
OPENSSL_assert(dgst != NULL && sig != NULL && group != NULL);
if (!(ctx = BN_CTX_new())) {
- GOSTerr(GOST_F_GOST_EC_VERIFY, GOST_R_NO_MEMORY);
+ GOSTerr(GOST_F_GOST_EC_VERIFY, ERR_R_MALLOC_FAILURE);
return 0;
}
goto err;
}
v = BN_mod_inverse(v, e, order, ctx);
- if (!v
- || !BN_mod_mul(z1, sig->s, v, order, ctx)
+ if (!v || !BN_mod_mul(z1, sig->s, v, order, ctx)
|| !BN_sub(tmp, order, sig->r)
|| !BN_mod_mul(z2, tmp, v, order, ctx)) {
GOSTerr(GOST_F_GOST_EC_VERIFY, ERR_R_INTERNAL_ERROR);
do {
if (!BN_rand_range(d, order)) {
- GOSTerr(GOST_F_GOST_EC_KEYGEN,
- GOST_R_RANDOM_NUMBER_GENERATOR_FAILED);
+ GOSTerr(GOST_F_GOST_EC_KEYGEN, GOST_R_RNG_ERROR);
goto end;
}
}
}
ok = 1;
-end:
+ end:
if (d)
BN_free(d);
if (order)
BN_free(order);
-
+
return (ok) ? gost_ec_compute_public(ec) : 0;
}