Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-07-19 03:26:25 +0400
committerAdam Langley <agl@google.com>2014-07-19 04:03:13 +0400
commitc0d948490288b91dbaa16f691f4f29a3536ae6e3 (patch)
treecab15c60d6042931054fb0330bb2233d1b9fed6a /crypto/ec/internal.h
parentecc0ce7e67b7dcfdfc57ffa99d70c9a04996e15b (diff)
ec: recognise known parameters when written in full.
Some EC ASN.1 structures are using a named curve, but include the full parameters anyway. With this change, BoringSSL will recognise the order of the curve. Change-Id: Iff057178453f9fdc98c8c03bcabbccef89709887 Reviewed-on: https://boringssl-review.googlesource.com/1270 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/ec/internal.h')
-rw-r--r--crypto/ec/internal.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/ec/internal.h b/crypto/ec/internal.h
index dc791860..76c3a800 100644
--- a/crypto/ec/internal.h
+++ b/crypto/ec/internal.h
@@ -349,6 +349,30 @@ struct ec_key_st {
CRYPTO_EX_DATA ex_data;
} /* EC_KEY */;
+/* curve_data contains data about a built-in elliptic curve. */
+struct curve_data {
+ /* comment is a human-readable string describing the curve. */
+ const char *comment;
+ /* param_len is the number of bytes needed to store a field element. */
+ uint8_t param_len;
+ /* cofactor is the cofactor of the group (i.e. the number of elements in the
+ * group divided by the size of the main subgroup. */
+ uint8_t cofactor; /* promoted to BN_ULONG */
+ /* data points to an array of 6*|param_len| bytes which hold the field
+ * elements of the following (in big-endian order): prime, a, b, generator x,
+ * generator y, order. */
+ const uint8_t data[];
+};
+
+struct built_in_curve {
+ int nid;
+ const struct curve_data *data;
+ const EC_METHOD *(*method)(void);
+};
+
+/* OPENSSL_built_in_curves is terminated with an entry where |nid| is
+ * |NID_undef|. */
+extern const struct built_in_curve OPENSSL_built_in_curves[];
#if defined(__cplusplus)
} /* extern C */