From 430091c556d1086167da3320cbb60aa0079486e7 Mon Sep 17 00:00:00 2001
From: Adam Langley <agl@google.com>
Date: Tue, 12 May 2015 19:09:47 -0700
Subject: external/boringssl: support arbitrary elliptic curve groups.

This change exposes the functions needed to support arbitrary elliptic
curve groups for Android.

Change-Id: I66a3662d393deadd718e43d91420fecf050502c2
---
 src/include/openssl/ec.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'src/include/openssl')

diff --git a/src/include/openssl/ec.h b/src/include/openssl/ec.h
index 633b11b..617cb19 100644
--- a/src/include/openssl/ec.h
+++ b/src/include/openssl/ec.h
@@ -286,6 +286,21 @@ OPENSSL_EXPORT int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r,
 
 /* Deprecated functions. */
 
+/* EC_GROUP_new_curve_GFp creates a new, arbitrary elliptic curve group based
+ * on the equation y² = x³ + a·x + b. It returns the new group or NULL on
+ * error. */
+OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p,
+                                                const BIGNUM *a,
+                                                const BIGNUM *b, BN_CTX *ctx);
+
+/* EC_GROUP_set_generator sets the generator for |group| to |generator|, which
+ * must have the given order and cofactor. This should only be used with
+ * |EC_GROUP| objects returned by |EC_GROUP_new_curve_GFp|. */
+OPENSSL_EXPORT int EC_GROUP_set_generator(EC_GROUP *group,
+                                          const EC_POINT *generator,
+                                          const BIGNUM *order,
+                                          const BIGNUM *cofactor);
+
 /* EC_GROUP_set_asn1_flag does nothing. */
 OPENSSL_EXPORT void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
 
@@ -381,6 +396,7 @@ OPENSSL_EXPORT void EC_GROUP_set_point_conversion_form(
 #define EC_F_ec_group_copy 163
 #define EC_F_nistp256_pre_comp_new 164
 #define EC_F_EC_KEY_new_by_curve_name 165
+#define EC_F_EC_GROUP_new_curve_GFp 166
 #define EC_R_BUFFER_TOO_SMALL 100
 #define EC_R_COORDINATES_OUT_OF_RANGE 101
 #define EC_R_D2I_ECPKPARAMETERS_FAILURE 102
-- 
cgit v1.1