Mercurial > dropbear
annotate ecdsa.h @ 838:4365e12c68e6 ecc
A few small fixes for ECC compilation
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 21 Oct 2013 22:46:12 +0800 |
parents | 45f1bc96f357 |
children | 774ad9b112ef |
rev | line source |
---|---|
793
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
1 #ifndef _ECDSA_H_ |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
2 #define _ECDSA_H_ |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
3 |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
4 #include "includes.h" |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
5 #include "buffer.h" |
795 | 6 #include "signkey.h" |
793
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
7 |
797
45f1bc96f357
Fix build for dropbearkey and ecdsa with certain options
Matt Johnston <matt@ucc.asn.au>
parents:
795
diff
changeset
|
8 #ifdef DROPBEAR_ECDSA |
45f1bc96f357
Fix build for dropbearkey and ecdsa with certain options
Matt Johnston <matt@ucc.asn.au>
parents:
795
diff
changeset
|
9 |
838
4365e12c68e6
A few small fixes for ECC compilation
Matt Johnston <matt@ucc.asn.au>
parents:
797
diff
changeset
|
10 #if defined(DROPBEAR_ECC_256) |
794
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
11 #define ECDSA_DEFAULT_SIZE 256 |
838
4365e12c68e6
A few small fixes for ECC compilation
Matt Johnston <matt@ucc.asn.au>
parents:
797
diff
changeset
|
12 #elif defined(DROPBEAR_ECC_384) |
794
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
13 #define ECDSA_DEFAULT_SIZE 384 |
838
4365e12c68e6
A few small fixes for ECC compilation
Matt Johnston <matt@ucc.asn.au>
parents:
797
diff
changeset
|
14 #elif defined(DROPBEAR_ECC_521) |
794
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
15 #define ECDSA_DEFAULT_SIZE 521 |
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
16 #else |
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
17 #define ECDSA_DEFAULT_SIZE 0 |
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
18 #endif |
d386defb5376
more ecdsa signkey work, not correct
Matt Johnston <matt@ucc.asn.au>
parents:
793
diff
changeset
|
19 |
793
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
20 ecc_key *gen_ecdsa_priv_key(unsigned int bit_size); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
21 ecc_key *buf_get_ecdsa_pub_key(buffer* buf); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
22 ecc_key *buf_get_ecdsa_priv_key(buffer *buf); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
23 void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
24 void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key); |
795 | 25 enum signkey_type ecdsa_signkey_type(ecc_key * key); |
793
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
26 |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
27 void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
28 int buf_ecdsa_verify(buffer *buf, ecc_key *key, buffer *data_buf); |
70625eed40c9
A bit of work on ecdsa for host/auth keys
Matt Johnston <matt@ucc.asn.au>
parents:
766
diff
changeset
|
29 |
797
45f1bc96f357
Fix build for dropbearkey and ecdsa with certain options
Matt Johnston <matt@ucc.asn.au>
parents:
795
diff
changeset
|
30 #endif |
45f1bc96f357
Fix build for dropbearkey and ecdsa with certain options
Matt Johnston <matt@ucc.asn.au>
parents:
795
diff
changeset
|
31 |
45f1bc96f357
Fix build for dropbearkey and ecdsa with certain options
Matt Johnston <matt@ucc.asn.au>
parents:
795
diff
changeset
|
32 #endif // _ECDSA_H_ |