comparison ecc.c @ 766:d1575fdc29a6 ecc

start on ecdsa keys
author Matt Johnston <matt@ucc.asn.au>
date Tue, 09 Apr 2013 00:36:04 +0800
parents 5503e05ab3a4
children e465ed10c51d
comparison
equal deleted inserted replaced
765:5503e05ab3a4 766:d1575fdc29a6
5 #include "bignum.h" 5 #include "bignum.h"
6 6
7 #ifdef DROPBEAR_ECC 7 #ifdef DROPBEAR_ECC
8 8
9 // TODO: use raw bytes for the dp rather than the hex strings in libtomcrypt's ecc.c 9 // TODO: use raw bytes for the dp rather than the hex strings in libtomcrypt's ecc.c
10
11 #ifdef DROPBEAR_ECC_256 10 #ifdef DROPBEAR_ECC_256
12 const struct dropbear_ecc_curve ecc_curve_nistp256 = { 11 const struct dropbear_ecc_curve ecc_curve_nistp256 = {
13 .dp = &ltc_ecc_sets[0], 12 .dp = &ltc_ecc_sets[0],
14 .hash_desc = &sha256_desc, 13 .hashdesc = &sha256_desc,
15 .name = "nistp256" 14 .name = "nistp256"
16 }; 15 };
17 #endif 16 #endif
18 #ifdef DROPBEAR_ECC_384 17 #ifdef DROPBEAR_ECC_384
19 const struct dropbear_ecc_curve ecc_curve_nistp384 = { 18 const struct dropbear_ecc_curve ecc_curve_nistp384 = {
20 .dp = &ltc_ecc_sets[1], 19 .dp = &ltc_ecc_sets[1],
21 .hash_desc = &sha384_desc, 20 .hashdesc = &sha384_desc,
22 .name = "nistp384" 21 .name = "nistp384"
23 }; 22 };
24 #endif 23 #endif
25 #ifdef DROPBEAR_ECC_521 24 #ifdef DROPBEAR_ECC_521
26 const struct dropbear_ecc_curve ecc_curve_nistp521 = { 25 const struct dropbear_ecc_curve ecc_curve_nistp521 = {
27 .dp = &ltc_ecc_sets[2], 26 .dp = &ltc_ecc_sets[2],
28 .hash_desc = &sha512_desc, 27 .hashdesc = &sha512_desc,
29 .name = "nistp521" 28 .name = "nistp521"
30 }; 29 };
31 #endif 30 #endif
32 31
33 static ecc_key * new_ecc_key(void) { 32 static ecc_key * new_ecc_key(void) {