comparison ecc.c @ 1295:750ec4ec4cbe

Convert #ifdef to #if, other build changes
author Matt Johnston <matt@ucc.asn.au>
date Wed, 04 May 2016 15:33:40 +0200
parents 063c38ea622b
children 06d52bcb8094
comparison
equal deleted inserted replaced
1294:56aba7dedbea 1295:750ec4ec4cbe
2 #include "options.h" 2 #include "options.h"
3 #include "ecc.h" 3 #include "ecc.h"
4 #include "dbutil.h" 4 #include "dbutil.h"
5 #include "bignum.h" 5 #include "bignum.h"
6 6
7 #ifdef DROPBEAR_ECC 7 #if 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 #if DROPBEAR_ECC_256
11 struct dropbear_ecc_curve ecc_curve_nistp256 = { 11 struct dropbear_ecc_curve ecc_curve_nistp256 = {
12 32, /* .ltc_size */ 12 32, /* .ltc_size */
13 NULL, /* .dp */ 13 NULL, /* .dp */
14 &sha256_desc, /* .hash_desc */ 14 &sha256_desc, /* .hash_desc */
15 "nistp256" /* .name */ 15 "nistp256" /* .name */
16 }; 16 };
17 #endif 17 #endif
18 #ifdef DROPBEAR_ECC_384 18 #if DROPBEAR_ECC_384
19 struct dropbear_ecc_curve ecc_curve_nistp384 = { 19 struct dropbear_ecc_curve ecc_curve_nistp384 = {
20 48, /* .ltc_size */ 20 48, /* .ltc_size */
21 NULL, /* .dp */ 21 NULL, /* .dp */
22 &sha384_desc, /* .hash_desc */ 22 &sha384_desc, /* .hash_desc */
23 "nistp384" /* .name */ 23 "nistp384" /* .name */
24 }; 24 };
25 #endif 25 #endif
26 #ifdef DROPBEAR_ECC_521 26 #if DROPBEAR_ECC_521
27 struct dropbear_ecc_curve ecc_curve_nistp521 = { 27 struct dropbear_ecc_curve ecc_curve_nistp521 = {
28 66, /* .ltc_size */ 28 66, /* .ltc_size */
29 NULL, /* .dp */ 29 NULL, /* .dp */
30 &sha512_desc, /* .hash_desc */ 30 &sha512_desc, /* .hash_desc */
31 "nistp521" /* .name */ 31 "nistp521" /* .name */
32 }; 32 };
33 #endif 33 #endif
34 34
35 struct dropbear_ecc_curve *dropbear_ecc_curves[] = { 35 struct dropbear_ecc_curve *dropbear_ecc_curves[] = {
36 #ifdef DROPBEAR_ECC_256 36 #if DROPBEAR_ECC_256
37 &ecc_curve_nistp256, 37 &ecc_curve_nistp256,
38 #endif 38 #endif
39 #ifdef DROPBEAR_ECC_384 39 #if DROPBEAR_ECC_384
40 &ecc_curve_nistp384, 40 &ecc_curve_nistp384,
41 #endif 41 #endif
42 #ifdef DROPBEAR_ECC_521 42 #if DROPBEAR_ECC_521
43 &ecc_curve_nistp521, 43 &ecc_curve_nistp521,
44 #endif 44 #endif
45 NULL 45 NULL
46 }; 46 };
47 47