summaryrefslogtreecommitdiffhomepage
path: root/kex.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-03-26 01:35:22 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-03-26 01:35:22 +0800
commit73e22c115c7aa5604c6a2135a5d2c1bc38161cb1 (patch)
tree3804dbbee79b860aafe8db7a81780bbd8fa7c6f3 /kex.h
parent9be0d6b53d6b85a8f273ee28876405fbca49b9fd (diff)
refactor kexdh code a bit, start working on ecdh etc
--HG-- branch : ecc
Diffstat (limited to 'kex.h')
-rw-r--r--kex.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/kex.h b/kex.h
index c89b0a3..f9d70b8 100644
--- a/kex.h
+++ b/kex.h
@@ -33,10 +33,19 @@ void recv_msg_kexinit();
void send_msg_newkeys();
void recv_msg_newkeys();
void kexfirstinitialise();
-void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv);
-void kexdh_comb_key(mp_int *dh_pub_us, mp_int *dh_priv, mp_int *dh_pub_them,
+
+struct kex_dh_param *gen_kexdh_param();
+void free_kexdh_param(struct kex_dh_param *param);
+void kexdh_comb_key(struct kex_dh_param *param, mp_int *dh_pub_them,
sign_key *hostkey);
+#ifdef DROPBEAR_ECDH
+struct kex_ecdh_param *gen_kexecdh_param();
+void free_kexecdh_param(struct kex_ecdh_param *param);
+void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
+ sign_key *hostkey);
+#endif
+
#ifndef DISABLE_ZLIB
int is_compress_trans();
int is_compress_recv();
@@ -64,6 +73,17 @@ struct KEXState {
};
+struct kex_dh_param {
+ mp_int pub;
+ mp_int priv;
+};
+
+#ifdef DROPBEAR_ECDH
+struct kex_ecdh_param {
+ ecc_key key;
+};
+#endif
+
#define MAX_KEXHASHBUF 2000
#endif /* _KEX_H_ */