-/* $OpenBSD: ec_lib.c,v 1.41 2021/09/12 16:23:19 tb Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.42 2022/03/29 13:44:06 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
}
-void
+void
EC_GROUP_free(EC_GROUP * group)
{
if (!group)
}
-void
+void
EC_GROUP_clear_free(EC_GROUP * group)
{
if (!group)
}
-int
+int
EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src)
{
EC_EXTRA_DATA *d;
}
-int
+int
EC_METHOD_get_field_type(const EC_METHOD *meth)
{
return meth->field_type;
if (!BN_copy(q, &group->field))
goto err;
}
-
+
/*
* Compute
* h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2) / n \rfloor.
return ret;
}
-int
+int
EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
}
-int
+int
EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
if (!BN_copy(order, &group->order))
return group->meth->group_order_bits(group);
}
-int
+int
EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
{
if (!BN_copy(cofactor, &group->cofactor))
}
-void
+void
EC_GROUP_set_curve_name(EC_GROUP * group, int nid)
{
group->curve_name = nid;
}
-int
+int
EC_GROUP_get_curve_name(const EC_GROUP * group)
{
return group->curve_name;
}
-void
+void
EC_GROUP_set_asn1_flag(EC_GROUP * group, int flag)
{
group->asn1_flag = flag;
}
-int
+int
EC_GROUP_get_asn1_flag(const EC_GROUP * group)
{
return group->asn1_flag;
}
-void
+void
EC_GROUP_set_point_conversion_form(EC_GROUP * group,
point_conversion_form_t form)
{
}
-point_conversion_form_t
+point_conversion_form_t
EC_GROUP_get_point_conversion_form(const EC_GROUP * group)
{
return group->asn1_form;
}
-size_t
+size_t
EC_GROUP_set_seed(EC_GROUP * group, const unsigned char *p, size_t len)
{
if (group->seed) {
}
-size_t
+size_t
EC_GROUP_get_seed_len(const EC_GROUP * group)
{
return group->seed_len;
}
#endif
-int
+int
EC_GROUP_get_degree(const EC_GROUP * group)
{
if (group->meth->group_get_degree == 0) {
}
-int
+int
EC_GROUP_check_discriminant(const EC_GROUP * group, BN_CTX * ctx)
{
if (group->meth->group_check_discriminant == 0) {
}
-int
+int
EC_GROUP_cmp(const EC_GROUP * a, const EC_GROUP * b, BN_CTX * ctx)
{
int r = 0;
}
/* this has 'package' visibility */
-int
+int
EC_EX_DATA_set_data(EC_EXTRA_DATA ** ex_data, void *data,
void *(*dup_func) (void *),
void (*free_func) (void *),
}
/* this has 'package' visibility */
-void
+void
EC_EX_DATA_free_data(EC_EXTRA_DATA ** ex_data,
void *(*dup_func) (void *),
void (*free_func) (void *),
}
/* this has 'package' visibility */
-void
+void
EC_EX_DATA_clear_free_data(EC_EXTRA_DATA ** ex_data,
void *(*dup_func) (void *),
void (*free_func) (void *),
}
/* this has 'package' visibility */
-void
+void
EC_EX_DATA_free_all_data(EC_EXTRA_DATA ** ex_data)
{
EC_EXTRA_DATA *d;
}
/* this has 'package' visibility */
-void
+void
EC_EX_DATA_clear_free_all_data(EC_EXTRA_DATA ** ex_data)
{
EC_EXTRA_DATA *d;
}
-void
+void
EC_POINT_free(EC_POINT * point)
{
if (!point)
}
-void
+void
EC_POINT_clear_free(EC_POINT * point)
{
if (!point)
}
-int
+int
EC_POINT_copy(EC_POINT * dest, const EC_POINT * src)
{
if (dest->meth->point_copy == 0) {
}
-int
+int
EC_POINT_set_to_infinity(const EC_GROUP * group, EC_POINT * point)
{
if (group->meth->point_set_to_infinity == 0) {
}
#endif
-int
+int
EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx)
{
}
-int
+int
EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx)
{
if (group->meth->dbl == 0) {
}
-int
+int
EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
{
if (group->meth->invert == 0) {
}
-int
+int
EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
{
if (group->meth->is_at_infinity == 0) {
}
-int
+int
EC_POINT_is_on_curve(const EC_GROUP * group, const EC_POINT * point, BN_CTX * ctx)
{
if (group->meth->is_on_curve == 0) {
}
-int
+int
EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
BN_CTX * ctx)
{
}
-int
+int
EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
{
if (group->meth->make_affine == 0) {
}
-int
+int
EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
BN_CTX *ctx)
{
/* Functions for point multiplication */
-int
+int
EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx)
{
ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
-
+
/* Either bP or aG + bP, this is sane. */
if (num == 1 && points != NULL && scalars != NULL)
return EC_POINT_mul(group, r, scalar, points[0], scalars[0],
ctx);
-
+
/* aG, this is sane */
if (scalar != NULL && points == NULL && scalars == NULL)
return EC_POINT_mul(group, r, scalar, NULL, NULL, ctx);
-
+
/* anything else is an error */
ECerror(ERR_R_EC_LIB);
return 0;
}
-int
+int
EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
{
return group->meth->mul_double_nonct(group, r, g_scalar,
p_scalar, point, ctx);
}
-
+
/* Anything else is an error. */
ECerror(ERR_R_EC_LIB);
return 0;
}
-int
+int
EC_GROUP_precompute_mult(EC_GROUP * group, BN_CTX * ctx)
{
if (group->meth->precompute_mult != 0)
return 1; /* nothing to do, so report success */
}
-int
+int
EC_GROUP_have_precompute_mult(const EC_GROUP * group)
{
if (group->meth->have_precompute_mult != 0)
if ((len = i2d_ECParameters(key, &p)) > 0)
k = d2i_ECParameters(NULL, (const unsigned char **)&p, len);
- return (k);
+ return (k);
}