Rename function EC_GROUP_precompute to EC_GROUP_precompute_mult,
which indicate its purpose more clearly.
This commit is contained in:
parent
14f7ee4916
commit
194dd04699
@ -162,7 +162,7 @@ int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *);
|
|||||||
|
|
||||||
int EC_POINTs_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, size_t num, const EC_POINT *[], const BIGNUM *[], BN_CTX *);
|
int EC_POINTs_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, size_t num, const EC_POINT *[], const BIGNUM *[], BN_CTX *);
|
||||||
int EC_POINT_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, const EC_POINT *, const BIGNUM *, BN_CTX *);
|
int EC_POINT_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, const EC_POINT *, const BIGNUM *, BN_CTX *);
|
||||||
int EC_GROUP_precompute(EC_GROUP *, BN_CTX *);
|
int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ void ERR_load_EC_strings(void);
|
|||||||
#define EC_F_EC_GROUP_GET_EXTRA_DATA 107
|
#define EC_F_EC_GROUP_GET_EXTRA_DATA 107
|
||||||
#define EC_F_EC_GROUP_GET_ORDER 141
|
#define EC_F_EC_GROUP_GET_ORDER 141
|
||||||
#define EC_F_EC_GROUP_NEW 108
|
#define EC_F_EC_GROUP_NEW 108
|
||||||
#define EC_F_EC_GROUP_PRECOMPUTE 142
|
#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
|
||||||
#define EC_F_EC_GROUP_SET_CURVE_GFP 109
|
#define EC_F_EC_GROUP_SET_CURVE_GFP 109
|
||||||
#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
|
#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
|
||||||
#define EC_F_EC_GROUP_SET_GENERATOR 111
|
#define EC_F_EC_GROUP_SET_GENERATOR 111
|
||||||
|
@ -86,7 +86,7 @@ static ERR_STRING_DATA EC_str_functs[]=
|
|||||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_EXTRA_DATA,0), "EC_GROUP_get_extra_data"},
|
{ERR_PACK(0,EC_F_EC_GROUP_GET_EXTRA_DATA,0), "EC_GROUP_get_extra_data"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_ORDER,0), "EC_GROUP_get_order"},
|
{ERR_PACK(0,EC_F_EC_GROUP_GET_ORDER,0), "EC_GROUP_get_order"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW,0), "EC_GROUP_new"},
|
{ERR_PACK(0,EC_F_EC_GROUP_NEW,0), "EC_GROUP_new"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_PRECOMPUTE,0), "EC_GROUP_precompute"},
|
{ERR_PACK(0,EC_F_EC_GROUP_PRECOMPUTE_MULT,0), "EC_GROUP_precompute_mult"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GFP,0), "EC_GROUP_set_curve_GFp"},
|
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GFP,0), "EC_GROUP_set_curve_GFp"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_EXTRA_DATA,0), "EC_GROUP_set_extra_data"},
|
{ERR_PACK(0,EC_F_EC_GROUP_SET_EXTRA_DATA,0), "EC_GROUP_set_extra_data"},
|
||||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_GENERATOR,0), "EC_GROUP_set_generator"},
|
{ERR_PACK(0,EC_F_EC_GROUP_SET_GENERATOR,0), "EC_GROUP_set_generator"},
|
||||||
|
@ -309,7 +309,7 @@ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EC_GROUP_precompute(EC_GROUP *group, BN_CTX *ctx)
|
int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
|
||||||
{
|
{
|
||||||
const EC_POINT *generator;
|
const EC_POINT *generator;
|
||||||
BN_CTX *new_ctx = NULL;
|
BN_CTX *new_ctx = NULL;
|
||||||
@ -319,7 +319,7 @@ int EC_GROUP_precompute(EC_GROUP *group, BN_CTX *ctx)
|
|||||||
generator = EC_GROUP_get0_generator(group);
|
generator = EC_GROUP_get0_generator(group);
|
||||||
if (generator == NULL)
|
if (generator == NULL)
|
||||||
{
|
{
|
||||||
ECerr(EC_F_EC_GROUP_PRECOMPUTE, EC_R_UNDEFINED_GENERATOR);
|
ECerr(EC_F_EC_GROUP_PRECOMPUTE_MULT, EC_R_UNDEFINED_GENERATOR);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ int EC_GROUP_precompute(EC_GROUP *group, BN_CTX *ctx)
|
|||||||
if (!EC_GROUP_get_order(group, order, ctx)) return 0;
|
if (!EC_GROUP_get_order(group, order, ctx)) return 0;
|
||||||
if (BN_is_zero(order))
|
if (BN_is_zero(order))
|
||||||
{
|
{
|
||||||
ECerr(EC_F_EC_GROUP_PRECOMPUTE, EC_R_UNKNOWN_ORDER);
|
ECerr(EC_F_EC_GROUP_PRECOMPUTE_MULT, EC_R_UNKNOWN_ORDER);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, ".");
|
fprintf(stdout, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (!EC_GROUP_precompute(group, ctx)) ABORT;
|
if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
|
||||||
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, " ok\n");
|
fprintf(stdout, " ok\n");
|
||||||
@ -370,7 +370,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, ".");
|
fprintf(stdout, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (!EC_GROUP_precompute(group, ctx)) ABORT;
|
if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
|
||||||
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, " ok\n");
|
fprintf(stdout, " ok\n");
|
||||||
@ -411,7 +411,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, ".");
|
fprintf(stdout, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (!EC_GROUP_precompute(group, ctx)) ABORT;
|
if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
|
||||||
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, " ok\n");
|
fprintf(stdout, " ok\n");
|
||||||
@ -457,7 +457,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, ".");
|
fprintf(stdout, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (!EC_GROUP_precompute(group, ctx)) ABORT;
|
if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
|
||||||
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, " ok\n");
|
fprintf(stdout, " ok\n");
|
||||||
@ -509,7 +509,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, ".");
|
fprintf(stdout, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (!EC_GROUP_precompute(group, ctx)) ABORT;
|
if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
|
||||||
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
|
||||||
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
|
||||||
fprintf(stdout, " ok\n");
|
fprintf(stdout, " ok\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user