summaryrefslogtreecommitdiffhomepage
path: root/algo.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-11-08 23:11:43 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-11-08 23:11:43 +0800
commit0162c116da2ce2d546cb6b6523b659d10f460d33 (patch)
tree3689163e79d631171074c9bc0b85660d7e903b4b /algo.h
parentcfac8435a73cddbc54a70ab07418b0bdb900fc10 (diff)
curve25519
--HG-- branch : ecc
Diffstat (limited to 'algo.h')
-rw-r--r--algo.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/algo.h b/algo.h
index dbbafd0..062fd1f 100644
--- a/algo.h
+++ b/algo.h
@@ -56,6 +56,7 @@ extern algo_type ssh_nocompress[];
extern const struct dropbear_cipher dropbear_nocipher;
extern const struct dropbear_cipher_mode dropbear_mode_none;
extern const struct dropbear_hash dropbear_nohash;
+extern const struct dropbear_kex kex_curve25519;
struct dropbear_cipher {
const struct ltc_cipher_descriptor *cipherdesc;
@@ -81,17 +82,27 @@ struct dropbear_hash {
const unsigned char hashsize;
};
+enum dropbear_kex_mode {
+ DROPBEAR_KEX_NORMAL_DH,
+ DROPBEAR_KEX_ECDH,
+ DROPBEAR_KEX_CURVE25519,
+};
+
struct dropbear_kex {
- // "normal" DH KEX
+ enum dropbear_kex_mode mode;
+
+ /* "normal" DH KEX */
const unsigned char *dh_p_bytes;
const int dh_p_len;
- // elliptic curve DH KEX
+ /* elliptic curve DH KEX */
#ifdef DROPBEAR_ECDH
const struct dropbear_ecc_curve *ecc_curve;
+#else
+ const void* dummy;
#endif
- // both
+ /* both */
const struct ltc_hash_descriptor *hash_desc;
};
@@ -117,12 +128,6 @@ int check_user_algos(const char* user_algo_list, algo_type * algos,
char * algolist_string(algo_type algos[]);
#endif
-#ifdef DROPBEAR_ECDH
-#define IS_NORMAL_DH(algo) ((algo)->dh_p_bytes != NULL)
-#else
-#define IS_NORMAL_DH(algo) 1
-#endif
-
enum {
DROPBEAR_COMP_NONE,
DROPBEAR_COMP_ZLIB,