diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-04-14 00:50:03 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-04-14 00:50:03 +0800 |
commit | 5c87c6a435ab1791294c412abe32aa629b42fdc7 (patch) | |
tree | 6986d3354125438325538674274b82455ce8589a /ecc.c | |
parent | f842712551cc458532aaddb6f140fe1286cfa9fb (diff) |
A bit of work on ecdsa for host/auth keys
--HG--
branch : ecc
Diffstat (limited to 'ecc.c')
-rw-r--r-- | ecc.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -10,21 +10,21 @@ #ifdef DROPBEAR_ECC_256 struct dropbear_ecc_curve ecc_curve_nistp256 = { .ltc_size = 32, - .hashdesc = &sha256_desc, + .hash_desc = &sha256_desc, .name = "nistp256" }; #endif #ifdef DROPBEAR_ECC_384 struct dropbear_ecc_curve ecc_curve_nistp384 = { .ltc_size = 48, - .hashdesc = &sha384_desc, + .hash_desc = &sha384_desc, .name = "nistp384" }; #endif #ifdef DROPBEAR_ECC_521 struct dropbear_ecc_curve ecc_curve_nistp521 = { .ltc_size = 66, - .hashdesc = &sha512_desc, + .hash_desc = &sha512_desc, .name = "nistp521" }; #endif @@ -59,6 +59,17 @@ void dropbear_ecc_fill_dp() { } } +struct dropbear_ecc_curve* curve_for_dp(const ltc_ecc_set_type *dp) { + struct dropbear_ecc_curve **curve = NULL; + for (curve = dropbear_ecc_curves; *curve; curve++) { + if ((*curve)->dp == dp) { + break; + } + } + assert(*curve); + return *curve; +} + ecc_key * new_ecc_key(void) { ecc_key *key = m_malloc(sizeof(*key)); key->pubkey.x = m_malloc(sizeof(mp_int)); |