comparison kex.h @ 839:33207ed1174b

Merge in ECC
author Matt Johnston <matt@ucc.asn.au>
date Mon, 21 Oct 2013 22:57:21 +0800
parents 7dcb46da72d9
children 6c69e7df3621
comparison
equal deleted inserted replaced
834:e378da7eae5d 839:33207ed1174b
25 #ifndef _KEX_H_ 25 #ifndef _KEX_H_
26 #define _KEX_H_ 26 #define _KEX_H_
27 27
28 #include "includes.h" 28 #include "includes.h"
29 #include "algo.h" 29 #include "algo.h"
30 #include "signkey.h"
30 31
31 void send_msg_kexinit(); 32 void send_msg_kexinit();
32 void recv_msg_kexinit(); 33 void recv_msg_kexinit();
33 void send_msg_newkeys(); 34 void send_msg_newkeys();
34 void recv_msg_newkeys(); 35 void recv_msg_newkeys();
35 void kexfirstinitialise(); 36 void kexfirstinitialise();
36 void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv); 37
37 void kexdh_comb_key(mp_int *dh_pub_us, mp_int *dh_priv, mp_int *dh_pub_them, 38 struct kex_dh_param *gen_kexdh_param();
39 void free_kexdh_param(struct kex_dh_param *param);
40 void kexdh_comb_key(struct kex_dh_param *param, mp_int *dh_pub_them,
38 sign_key *hostkey); 41 sign_key *hostkey);
42
43 #ifdef DROPBEAR_ECDH
44 struct kex_ecdh_param *gen_kexecdh_param();
45 void free_kexecdh_param(struct kex_ecdh_param *param);
46 void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
47 sign_key *hostkey);
48 #endif
39 49
40 #ifndef DISABLE_ZLIB 50 #ifndef DISABLE_ZLIB
41 int is_compress_trans(); 51 int is_compress_trans();
42 int is_compress_recv(); 52 int is_compress_recv();
43 #endif 53 #endif
64 unsigned int datatrans; /* data transmitted since last kex */ 74 unsigned int datatrans; /* data transmitted since last kex */
65 unsigned int datarecv; /* data received since last kex */ 75 unsigned int datarecv; /* data received since last kex */
66 76
67 }; 77 };
68 78
79 #define DH_P_1_LEN 128
80 extern const unsigned char dh_p_1[DH_P_1_LEN];
81 #define DH_P_14_LEN 256
82 extern const unsigned char dh_p_14[DH_P_14_LEN];
83
84 struct kex_dh_param {
85 mp_int pub; /* e */
86 mp_int priv; /* x */
87 };
88
89 #ifdef DROPBEAR_ECDH
90 struct kex_ecdh_param {
91 ecc_key key;
92 };
93 #endif
69 94
70 #define MAX_KEXHASHBUF 2000 95 #define MAX_KEXHASHBUF 2000
71 96
72 #endif /* _KEX_H_ */ 97 #endif /* _KEX_H_ */