-/* $OpenBSD: ec.h,v 1.20 2021/04/20 17:16:37 tb Exp $ */
+/* $OpenBSD: ec.h,v 1.21 2021/04/20 17:28:18 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
*/
int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
+#if defined(LIBRESSL_INTERNAL)
+int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p,
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
+int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
+#else
/** Sets the jacobian projective coordinates of a EC_POINT over GFp
* \param group underlying EC_GROUP object
* \param p EC_POINT object
*/
int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
+#endif
#if defined(LIBRESSL_INTERNAL)
int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
-/* $OpenBSD: ec_lcl.h,v 1.15 2021/04/20 17:16:37 tb Exp $ */
+/* $OpenBSD: ec_lcl.h,v 1.16 2021/04/20 17:28:18 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
int (*point_copy)(EC_POINT *, const EC_POINT *);
/* used by EC_POINT_set_to_infinity,
- * EC_POINT_set_Jprojective_coordinates_GFp,
- * EC_POINT_get_Jprojective_coordinates_GFp,
+ * EC_POINT_set_Jprojective_coordinates,
+ * EC_POINT_get_Jprojective_coordinates,
* EC_POINT_set_affine_coordinates,
* EC_POINT_get_affine_coordinates,
* EC_POINT_set_compressed_coordinates_GFp, ..._GF2m:
*/
int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *);
- int (*point_set_Jprojective_coordinates_GFp)(const EC_GROUP *, EC_POINT *,
+ int (*point_set_Jprojective_coordinates)(const EC_GROUP *, EC_POINT *,
const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
- int (*point_get_Jprojective_coordinates_GFp)(const EC_GROUP *, const EC_POINT *,
+ int (*point_get_Jprojective_coordinates)(const EC_GROUP *, const EC_POINT *,
BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
int (*point_set_affine_coordinates)(const EC_GROUP *, EC_POINT *,
const BIGNUM *x, const BIGNUM *y, BN_CTX *);
void ec_GFp_simple_point_clear_finish(EC_POINT *);
int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *);
int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *);
-int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
-int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
- BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
+int ec_GFp_simple_set_Jprojective_coordinates(const EC_GROUP *, EC_POINT *,
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
+int ec_GFp_simple_get_Jprojective_coordinates(const EC_GROUP *,
+ const EC_POINT *, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *,
const BIGNUM *x, const BIGNUM *y, BN_CTX *);
int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *, const EC_POINT *,
-/* $OpenBSD: ec_lib.c,v 1.37 2021/04/20 17:17:47 tb Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.38 2021/04/20 17:28:18 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
return group->meth->point_set_to_infinity(group, point);
}
-
-int
-EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
+int
+EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *point,
const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
{
- if (group->meth->point_set_Jprojective_coordinates_GFp == 0) {
+ if (group->meth->point_set_Jprojective_coordinates == 0) {
ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
ECerror(EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
- return group->meth->point_set_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
+ return group->meth->point_set_Jprojective_coordinates(group, point,
+ x, y, z, ctx);
}
-
-int
-EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
+int
+EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
{
- if (group->meth->point_get_Jprojective_coordinates_GFp == 0) {
+ if (group->meth->point_get_Jprojective_coordinates == 0) {
ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
ECerror(EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
- return group->meth->point_get_Jprojective_coordinates_GFp(group, point, x, y, z, ctx);
+ return group->meth->point_get_Jprojective_coordinates(group, point,
+ x, y, z, ctx);
+}
+
+int
+EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point,
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx)
+{
+ return EC_POINT_set_Jprojective_coordinates(group, point, x, y, z, ctx);
+}
+
+int
+EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
+ const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
+{
+ return EC_POINT_get_Jprojective_coordinates(group, point, x, y, z, ctx);
}
int
-/* $OpenBSD: ecp_mont.c,v 1.17 2018/11/05 20:18:21 tb Exp $ */
+/* $OpenBSD: ecp_mont.c,v 1.18 2021/04/20 17:28:18 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
-/* $OpenBSD: ecp_nist.c,v 1.15 2018/11/05 20:18:21 tb Exp $ */
+/* $OpenBSD: ecp_nist.c,v 1.16 2021/04/20 17:28:18 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
-/* $OpenBSD: ecp_nistp224.c,v 1.24 2021/04/20 17:16:37 tb Exp $ */
+/* $OpenBSD: ecp_nistp224.c,v 1.25 2021/04/20 17:28:18 tb Exp $ */
/*
* Written by Emilia Kasper (Google) for the OpenSSL project.
*/
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
ECerror(ERR_R_BN_LIB);
goto err;
}
- if (!EC_POINT_set_Jprojective_coordinates_GFp(group,
- generator, x, y, z, ctx))
+ if (!EC_POINT_set_Jprojective_coordinates(group, generator,
+ x, y, z, ctx))
goto err;
if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
/* precomputation matches generator */
ECerror(ERR_R_BN_LIB);
goto err;
}
- ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx);
+ ret = EC_POINT_set_Jprojective_coordinates(group, r, x, y, z, ctx);
err:
BN_CTX_end(ctx);
-/* $OpenBSD: ecp_nistp256.c,v 1.23 2021/04/20 17:16:37 tb Exp $ */
+/* $OpenBSD: ecp_nistp256.c,v 1.24 2021/04/20 17:28:18 tb Exp $ */
/*
* Written by Adam Langley (Google) for the OpenSSL project
*/
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
ECerror(ERR_R_BN_LIB);
goto err;
}
- if (!EC_POINT_set_Jprojective_coordinates_GFp(group,
- generator, x, y, z, ctx))
+ if (!EC_POINT_set_Jprojective_coordinates(group, generator,
+ x, y, z, ctx))
goto err;
if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
/* precomputation matches generator */
ECerror(ERR_R_BN_LIB);
goto err;
}
- ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx);
+ ret = EC_POINT_set_Jprojective_coordinates(group, r, x, y, z, ctx);
err:
BN_CTX_end(ctx);
-/* $OpenBSD: ecp_nistp521.c,v 1.24 2021/04/20 17:16:38 tb Exp $ */
+/* $OpenBSD: ecp_nistp521.c,v 1.25 2021/04/20 17:28:18 tb Exp $ */
/*
* Written by Adam Langley (Google) for the OpenSSL project
*/
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
ECerror(ERR_R_BN_LIB);
goto err;
}
- if (!EC_POINT_set_Jprojective_coordinates_GFp(group,
- generator, x, y, z, ctx))
+ if (!EC_POINT_set_Jprojective_coordinates(group, generator,
+ x, y, z, ctx))
goto err;
if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
/* precomputation matches generator */
ECerror(ERR_R_BN_LIB);
goto err;
}
- ret = EC_POINT_set_Jprojective_coordinates_GFp(group, r, x, y, z, ctx);
+ ret = EC_POINT_set_Jprojective_coordinates(group, r, x, y, z, ctx);
err:
BN_CTX_end(ctx);
-/* $OpenBSD: ecp_nistz256.c,v 1.8 2021/04/20 17:16:38 tb Exp $ */
+/* $OpenBSD: ecp_nistz256.c,v 1.9 2021/04/20 17:28:18 tb Exp $ */
/* Copyright (c) 2014, Intel Corporation.
*
* Permission to use, copy, modify, and/or distribute this software for any
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates = ecp_nistz256_get_affine,
-/* $OpenBSD: ecp_smpl.c,v 1.30 2021/04/20 17:16:38 tb Exp $ */
+/* $OpenBSD: ecp_smpl.c,v 1.31 2021/04/20 17:28:18 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project.
* Includes code written by Bodo Moeller for the OpenSSL project.
.point_clear_finish = ec_GFp_simple_point_clear_finish,
.point_copy = ec_GFp_simple_point_copy,
.point_set_to_infinity = ec_GFp_simple_point_set_to_infinity,
- .point_set_Jprojective_coordinates_GFp =
- ec_GFp_simple_set_Jprojective_coordinates_GFp,
- .point_get_Jprojective_coordinates_GFp =
- ec_GFp_simple_get_Jprojective_coordinates_GFp,
+ .point_set_Jprojective_coordinates =
+ ec_GFp_simple_set_Jprojective_coordinates,
+ .point_get_Jprojective_coordinates =
+ ec_GFp_simple_get_Jprojective_coordinates,
.point_set_affine_coordinates =
ec_GFp_simple_point_set_affine_coordinates,
.point_get_affine_coordinates =
}
-int
-ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP * group, EC_POINT * point,
- const BIGNUM * x, const BIGNUM * y, const BIGNUM * z, BN_CTX * ctx)
+int
+ec_GFp_simple_set_Jprojective_coordinates(const EC_GROUP *group,
+ EC_POINT *point, const BIGNUM *x, const BIGNUM *y, const BIGNUM *z,
+ BN_CTX *ctx)
{
BN_CTX *new_ctx = NULL;
int ret = 0;
return ret;
}
-
-int
-ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP * group, const EC_POINT * point,
- BIGNUM * x, BIGNUM * y, BIGNUM * z, BN_CTX * ctx)
+int
+ec_GFp_simple_get_Jprojective_coordinates(const EC_GROUP *group,
+ const EC_POINT *point, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx)
{
BN_CTX *new_ctx = NULL;
int ret = 0;
return ret;
}
-
-int
+int
ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP * group, EC_POINT * point,
const BIGNUM * x, const BIGNUM * y, BN_CTX * ctx)
{
ECerror(ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y, BN_value_one(), ctx);
+ return EC_POINT_set_Jprojective_coordinates(group, point, x, y,
+ BN_value_one(), ctx);
}
-
-int
+int
ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POINT * point,
BIGNUM * x, BIGNUM * y, BN_CTX * ctx)
{