xref: /freebsd/crypto/libecc/include/libecc/lib_ecc_config.h (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
1 /*
2  *  Copyright (C) 2017 - This file is part of libecc project
3  *
4  *  Authors:
5  *      Ryad BENADJILA <ryadbenadjila@gmail.com>
6  *      Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
7  *      Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
8  *
9  *  Contributors:
10  *      Nicolas VIVET <nicolas.vivet@ssi.gouv.fr>
11  *      Karim KHALFALLAH <karim.khalfallah@ssi.gouv.fr>
12  *
13  *  This software is licensed under a dual BSD and GPL v2 license.
14  *  See LICENSE file at the root folder of the project.
15  */
16 #ifndef __LIB_ECC_CONFIG_H__
17 #define __LIB_ECC_CONFIG_H__
18 
19 /*
20  * This configuration file provides various knobs to configure
21  * what will be built in the library (supported curves, hash
22  * algorithms and signature/verification schemes).
23  */
24 
25 /* It is possible to override the LIBECC configuration by defining
26  * the WITH_LIBECC_CONFIG_OVERRIDE preprocessing flag in the CFLAGS. When
27  * this is done, it is expected that the user defines the curves,
28  * hash algorithms and signature schemes in the compilation
29  * command line (e.g. via the CFLAGS).
30  * For instance, in order to only use FRP256V1, SHA-256 and ECDSA, add to the CFLAGS:
31  *
32  *   -DWITH_LIBECC_CONFIG_OVERRIDE -DWITH_CURVE_FRP256V1 -DWITH_HASH_SHA256 -DWITH_SIG_ECDSA
33  *
34  */
35 #ifndef WITH_LIBECC_CONFIG_OVERRIDE
36 
37 /* Supported curves */
38 #define WITH_CURVE_FRP256V1
39 #define WITH_CURVE_SECP192R1
40 #define WITH_CURVE_SECP224R1
41 #define WITH_CURVE_SECP256R1
42 #define WITH_CURVE_SECP384R1
43 #define WITH_CURVE_SECP521R1
44 #define WITH_CURVE_BRAINPOOLP192R1
45 #define WITH_CURVE_BRAINPOOLP224R1
46 #define WITH_CURVE_BRAINPOOLP256R1
47 #define WITH_CURVE_BRAINPOOLP384R1
48 #define WITH_CURVE_BRAINPOOLP512R1
49 #define WITH_CURVE_GOST256
50 #define WITH_CURVE_GOST512
51 #define WITH_CURVE_SM2P256TEST
52 #define WITH_CURVE_SM2P256V1
53 #define WITH_CURVE_WEI25519
54 #define WITH_CURVE_WEI448
55 #define WITH_CURVE_GOST_R3410_2012_256_PARAMSETA
56 #define WITH_CURVE_SECP256K1
57 #define WITH_CURVE_GOST_R3410_2001_TESTPARAMSET
58 #define WITH_CURVE_GOST_R3410_2001_CRYPTOPRO_A_PARAMSET
59 #define WITH_CURVE_GOST_R3410_2001_CRYPTOPRO_B_PARAMSET
60 #define WITH_CURVE_GOST_R3410_2001_CRYPTOPRO_C_PARAMSET
61 #define WITH_CURVE_GOST_R3410_2001_CRYPTOPRO_XCHA_PARAMSET
62 #define WITH_CURVE_GOST_R3410_2001_CRYPTOPRO_XCHB_PARAMSET
63 #define WITH_CURVE_GOST_R3410_2012_256_PARAMSETB
64 #define WITH_CURVE_GOST_R3410_2012_256_PARAMSETC
65 #define WITH_CURVE_GOST_R3410_2012_256_PARAMSETD
66 #define WITH_CURVE_GOST_R3410_2012_512_PARAMSETTEST
67 #define WITH_CURVE_GOST_R3410_2012_512_PARAMSETA
68 #define WITH_CURVE_GOST_R3410_2012_512_PARAMSETB
69 #define WITH_CURVE_GOST_R3410_2012_512_PARAMSETC
70 #define WITH_CURVE_SECP192K1
71 #define WITH_CURVE_SECP224K1
72 #define WITH_CURVE_BRAINPOOLP192T1
73 #define WITH_CURVE_BRAINPOOLP224T1
74 #define WITH_CURVE_BRAINPOOLP256T1
75 #define WITH_CURVE_BRAINPOOLP320R1
76 #define WITH_CURVE_BRAINPOOLP320T1
77 #define WITH_CURVE_BRAINPOOLP384T1
78 #define WITH_CURVE_BRAINPOOLP512T1
79 #define WITH_CURVE_BIGN256V1
80 #define WITH_CURVE_BIGN384V1
81 #define WITH_CURVE_BIGN512V1
82 /* ADD curves define here */
83 /* XXX: Do not remove the comment above, as it is
84  * used by external tools as a placeholder to add or
85  * remove automatically generated code.
86  */
87 
88 /* Supported hash algorithms */
89 #define WITH_HASH_SHA224
90 #define WITH_HASH_SHA256
91 #define WITH_HASH_SHA384
92 #define WITH_HASH_SHA512
93 #define WITH_HASH_SHA512_224
94 #define WITH_HASH_SHA512_256
95 #define WITH_HASH_SHA3_224
96 #define WITH_HASH_SHA3_256
97 #define WITH_HASH_SHA3_384
98 #define WITH_HASH_SHA3_512
99 #define WITH_HASH_SM3
100 #define WITH_HASH_SHAKE256
101 #define WITH_HASH_STREEBOG256
102 #define WITH_HASH_STREEBOG512
103 #define WITH_HASH_RIPEMD160
104 #define WITH_HASH_BELT_HASH
105 #define WITH_HASH_BASH224
106 #define WITH_HASH_BASH256
107 #define WITH_HASH_BASH384
108 #define WITH_HASH_BASH512
109 #define WITH_HMAC
110 
111 /* Supported sig/verif schemes */
112 #define WITH_SIG_ECDSA
113 #define WITH_SIG_ECKCDSA
114 #define WITH_SIG_ECSDSA
115 #define WITH_SIG_ECOSDSA
116 #define WITH_SIG_ECFSDSA
117 #define WITH_SIG_ECGDSA
118 #define WITH_SIG_ECRDSA
119 #define WITH_SIG_SM2
120 #define WITH_SIG_EDDSA25519
121 #define WITH_SIG_EDDSA448
122 #define WITH_SIG_DECDSA
123 #define WITH_SIG_BIGN
124 #define WITH_SIG_DBIGN
125 #define WITH_SIG_BIP0340
126 
127 /* Supported ECDH schemes */
128 #define WITH_ECCCDH
129 #define WITH_X25519
130 #define WITH_X448
131 
132 #endif /* WITH_LIBECC_CONFIG_OVERRIDE */
133 
134 #endif /* __LIB_ECC_CONFIG_H__ */
135