comparison ecc.c @ 852:7540c0822374 ecc

Various cleanups and fixes for warnings
author Matt Johnston <matt@ucc.asn.au>
date Tue, 12 Nov 2013 23:02:32 +0800
parents 724c3e0c8734
children 04ede40a529a
comparison
equal deleted inserted replaced
851:c1c1b43f78c2 852:7540c0822374
4 #include "dbutil.h" 4 #include "dbutil.h"
5 #include "bignum.h" 5 #include "bignum.h"
6 6
7 #ifdef DROPBEAR_ECC 7 #ifdef DROPBEAR_ECC
8 8
9 // .dp members are filled out by dropbear_ecc_fill_dp() at startup 9 /* .dp members are filled out by dropbear_ecc_fill_dp() at startup */
10 #ifdef DROPBEAR_ECC_256 10 #ifdef DROPBEAR_ECC_256
11 struct dropbear_ecc_curve ecc_curve_nistp256 = { 11 struct dropbear_ecc_curve ecc_curve_nistp256 = {
12 .ltc_size = 32, 12 .ltc_size = 32,
13 .hash_desc = &sha256_desc, 13 .hash_desc = &sha256_desc,
14 .name = "nistp256" 14 .name = "nistp256"
42 NULL 42 NULL
43 }; 43 };
44 44
45 void dropbear_ecc_fill_dp() { 45 void dropbear_ecc_fill_dp() {
46 struct dropbear_ecc_curve **curve; 46 struct dropbear_ecc_curve **curve;
47 // libtomcrypt guarantees they're ordered by size 47 /* libtomcrypt guarantees they're ordered by size */
48 const ltc_ecc_set_type *dp = ltc_ecc_sets; 48 const ltc_ecc_set_type *dp = ltc_ecc_sets;
49 for (curve = dropbear_ecc_curves; *curve; curve++) { 49 for (curve = dropbear_ecc_curves; *curve; curve++) {
50 for (;dp->size > 0; dp++) { 50 for (;dp->size > 0; dp++) {
51 if (dp->size == (*curve)->ltc_size) { 51 if (dp->size == (*curve)->ltc_size) {
52 (*curve)->dp = dp; 52 (*curve)->dp = dp;