comparison kex.h @ 755:b07eb3dc23ec ecc

refactor kexdh code a bit, start working on ecdh etc
author Matt Johnston <matt@ucc.asn.au>
date Tue, 26 Mar 2013 01:35:22 +0800
parents 895fbe068f2c
children bf9dc2d9c2b1
comparison
equal deleted inserted replaced
725:49f68a7b7a55 755:b07eb3dc23ec
31 void send_msg_kexinit(); 31 void send_msg_kexinit();
32 void recv_msg_kexinit(); 32 void recv_msg_kexinit();
33 void send_msg_newkeys(); 33 void send_msg_newkeys();
34 void recv_msg_newkeys(); 34 void recv_msg_newkeys();
35 void kexfirstinitialise(); 35 void kexfirstinitialise();
36 void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv); 36
37 void kexdh_comb_key(mp_int *dh_pub_us, mp_int *dh_priv, mp_int *dh_pub_them, 37 struct kex_dh_param *gen_kexdh_param();
38 void free_kexdh_param(struct kex_dh_param *param);
39 void kexdh_comb_key(struct kex_dh_param *param, mp_int *dh_pub_them,
38 sign_key *hostkey); 40 sign_key *hostkey);
41
42 #ifdef DROPBEAR_ECDH
43 struct kex_ecdh_param *gen_kexecdh_param();
44 void free_kexecdh_param(struct kex_ecdh_param *param);
45 void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
46 sign_key *hostkey);
47 #endif
39 48
40 #ifndef DISABLE_ZLIB 49 #ifndef DISABLE_ZLIB
41 int is_compress_trans(); 50 int is_compress_trans();
42 int is_compress_recv(); 51 int is_compress_recv();
43 #endif 52 #endif
62 unsigned int datatrans; /* data transmitted since last kex */ 71 unsigned int datatrans; /* data transmitted since last kex */
63 unsigned int datarecv; /* data received since last kex */ 72 unsigned int datarecv; /* data received since last kex */
64 73
65 }; 74 };
66 75
76 struct kex_dh_param {
77 mp_int pub;
78 mp_int priv;
79 };
80
81 #ifdef DROPBEAR_ECDH
82 struct kex_ecdh_param {
83 ecc_key key;
84 };
85 #endif
86
67 #define MAX_KEXHASHBUF 2000 87 #define MAX_KEXHASHBUF 2000
68 88
69 #endif /* _KEX_H_ */ 89 #endif /* _KEX_H_ */