Activated Curve25519 support for ECDHE cipher suites.
[BearSSL] / tools / brssl.h
index e93ed4c..d889b08 100644 (file)
@@ -211,6 +211,23 @@ extern const hash_function hash_functions[];
  */
 unsigned parse_hash_functions(const char *arg);
 
+/*
+ * Get a curve name (by ID). If the curve ID is not known, this returns
+ * NULL.
+ */
+const char *get_curve_name(int id);
+
+/*
+ * Get a curve name (by ID). The name is written in the provided buffer
+ * (zero-terminated). If the curve ID is not known, the name is
+ * "unknown (***)" where "***" is the decimal value of the identifier.
+ * If the name does not fit in the provided buffer, then dst[0] is set
+ * to 0 (unless len is 0, in which case nothing is written), and -1 is
+ * returned. Otherwise, the name is written in dst[] (with a terminating
+ * 0), and this function returns 0.
+ */
+int get_curve_name_ext(int id, char *dst, size_t len);
+
 /*
  * Type for a known cipher suite.
  */
@@ -235,11 +252,12 @@ extern const cipher_suite cipher_suites[];
 #define REQ_SHA384         0x0008   /* suite needs SHA-384 */
 #define REQ_AESCBC         0x0010   /* suite needs AES/CBC encryption */
 #define REQ_AESGCM         0x0020   /* suite needs AES/GCM encryption */
-#define REQ_3DESCBC        0x0040   /* suite needs 3DES/CBC encryption */
-#define REQ_RSAKEYX        0x0080   /* suite uses RSA key exchange */
-#define REQ_ECDHE_RSA      0x0100   /* suite uses ECDHE_RSA key exchange */
-#define REQ_ECDHE_ECDSA    0x0200   /* suite uses ECDHE_ECDSA key exchange */
-#define REQ_ECDH           0x0400   /* suite uses static ECDH key exchange */
+#define REQ_CHAPOL         0x0040   /* suite needs ChaCha20+Poly1305 */
+#define REQ_3DESCBC        0x0080   /* suite needs 3DES/CBC encryption */
+#define REQ_RSAKEYX        0x0100   /* suite uses RSA key exchange */
+#define REQ_ECDHE_RSA      0x0200   /* suite uses ECDHE_RSA key exchange */
+#define REQ_ECDHE_ECDSA    0x0400   /* suite uses ECDHE_ECDSA key exchange */
+#define REQ_ECDH           0x0800   /* suite uses static ECDH key exchange */
 
 /*
  * Parse a list of cipher suite names. The names are comma-separated. If
@@ -269,6 +287,11 @@ const char *get_suite_name(unsigned suite);
  */
 int get_suite_name_ext(unsigned suite, char *dst, size_t len);
 
+/*
+ * Tell whether a cipher suite uses ECDHE key exchange.
+ */
+int uses_ecdhe(unsigned suite);
+
 /*
  * Print out all known names (for protocol versions, cipher suites...).
  */