comparison ecc.h @ 767:e465ed10c51d ecc

Be safer with how we handle ltc_ecc_sets[] (particularly with system libtomcrypt) A bit of progress with ecdsa code
author Matt Johnston <matt@ucc.asn.au>
date Tue, 09 Apr 2013 22:44:19 +0800
parents d1575fdc29a6
children 70625eed40c9
comparison
equal deleted inserted replaced
766:d1575fdc29a6 767:e465ed10c51d
7 #include "buffer.h" 7 #include "buffer.h"
8 8
9 #ifdef DROPBEAR_ECC 9 #ifdef DROPBEAR_ECC
10 10
11 struct dropbear_ecc_curve { 11 struct dropbear_ecc_curve {
12 int ltc_size; // to match the byte sizes in ltc_ecc_sets[]
12 const ltc_ecc_set_type *dp; // curve domain parameters 13 const ltc_ecc_set_type *dp; // curve domain parameters
13 const struct ltc_hash_descriptor *hashdesc; 14 const struct ltc_hash_descriptor *hashdesc;
14 const char *name; 15 const char *name;
15 }; 16 };
16 17
17 extern const struct dropbear_ecc_curve ecc_curve_nistp256; 18 extern struct dropbear_ecc_curve ecc_curve_nistp256;
18 extern const struct dropbear_ecc_curve ecc_curve_nistp384; 19 extern struct dropbear_ecc_curve ecc_curve_nistp384;
19 extern const struct dropbear_ecc_curve ecc_curve_nistp521; 20 extern struct dropbear_ecc_curve ecc_curve_nistp521;
21 extern struct dropbear_ecc_curve *dropbear_ecc_curves[];
22
23 void dropbear_ecc_fill_dp();
20 24
21 // "pubkey" refers to a point, but LTC uses ecc_key structure for both public 25 // "pubkey" refers to a point, but LTC uses ecc_key structure for both public
22 // and private keys 26 // and private keys
23 void buf_put_ecc_raw_pubkey_string(buffer *buf, ecc_key *key); 27 void buf_put_ecc_raw_pubkey_string(buffer *buf, ecc_key *key);
24 ecc_key * buf_get_ecc_raw_pubkey(buffer *buf, const struct dropbear_ecc_curve *curve); 28 ecc_key * buf_get_ecc_raw_pubkey(buffer *buf, const struct dropbear_ecc_curve *curve);