Miniupnpd: update to 2.0
[tomato.git] / release / src / router / dropbear / ecdsa.h
blob24792cb6c7bdbe6c38b2398bb1831362a5efb54a
1 #ifndef DROPBEAR_ECDSA_H_
2 #define DROPBEAR_ECDSA_H_
4 #include "includes.h"
5 #include "buffer.h"
6 #include "signkey.h"
8 #ifdef DROPBEAR_ECDSA
10 /* Prefer the larger size - it's fast anyway */
11 #if defined(DROPBEAR_ECC_521)
12 #define ECDSA_DEFAULT_SIZE 521
13 #elif defined(DROPBEAR_ECC_384)
14 #define ECDSA_DEFAULT_SIZE 384
15 #elif defined(DROPBEAR_ECC_256)
16 #define ECDSA_DEFAULT_SIZE 256
17 #else
18 #define ECDSA_DEFAULT_SIZE 0
19 #endif
21 ecc_key *gen_ecdsa_priv_key(unsigned int bit_size);
22 ecc_key *buf_get_ecdsa_pub_key(buffer* buf);
23 ecc_key *buf_get_ecdsa_priv_key(buffer *buf);
24 void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key);
25 void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key);
26 enum signkey_type ecdsa_signkey_type(ecc_key * key);
28 void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf);
29 int buf_ecdsa_verify(buffer *buf, ecc_key *key, buffer *data_buf);
30 /* Returns 1 on success */
31 int signkey_is_ecdsa(enum signkey_type type);
33 #endif
35 #endif /* DROPBEAR_ECDSA_H_ */