Added some comments.
[BearSSL] / src / config.h
1 /*
2 * Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25 #ifndef CONFIG_H__
26 #define CONFIG_H__
27
28 /*
29 * This file contains compile-time flags that can override the
30 * autodetection performed in relevant files. Each flag is a macro; it
31 * deactivates the feature if defined to 0, activates it if defined to a
32 * non-zero integer (normally 1). If the macro is not defined, then
33 * autodetection applies.
34 */
35
36 /*
37 * When BR_64 is enabled, 64-bit integer types are assumed to be
38 * efficient (i.e. the architecture has 64-bit registers and can
39 * do 64-bit operations as fast as 32-bit operations).
40 *
41 #define BR_64 1
42 */
43
44 /*
45 * When BR_SLOW_MUL is enabled, multiplications are assumed to be
46 * substantially slow with regards to other integer operations, thus
47 * making it worth to make more operations for a given task if it allows
48 * using less multiplications.
49 *
50 #define BR_SLOW_MUL 1
51 */
52
53 /*
54 * When BR_CT_MUL31 is enabled, multiplications of 31-bit values (used
55 * in the "i31" big integer implementation) use an alternate implementation
56 * which is slower and larger than the normal multiplication, but should
57 * ensure constant-time multiplications even on architectures where the
58 * multiplication opcode takes a variable number of cycles to complete.
59 *
60 #define BR_CT_MUL31 1
61 */
62
63 /*
64 * When BR_USE_URANDOM is enabled, the SSL engine will use /dev/urandom
65 * to automatically obtain quality randomness for seedings its internal
66 * PRNG.
67 *
68 #define BR_USE_URANDOM 1
69 */
70
71 /*
72 * When BR_USE_WIN32_RAND is enabled, the SSL engine will use the Win32
73 * (CryptoAPI) functions (CryptAcquireContext(), CryptGenRandom()...) to
74 * automatically obtain quality randomness for seedings its internal PRNG.
75 *
76 * Note: if both BR_USE_URANDOM and BR_USE_WIN32_RAND are defined, the
77 * former takes precedence.
78 *
79 #define BR_USE_WIN32_RAND 1
80 */
81
82 /*
83 * When BR_USE_UNIX_TIME is enabled, the X.509 validation engine obtains
84 * the current time from the OS by calling time(), and assuming that the
85 * returned value (a 'time_t') is an integer that counts time in seconds
86 * since the Unix Epoch (Jan 1st, 1970, 00:00 UTC).
87 *
88 #define BR_USE_UNIX_TIME 1
89 */
90
91 /*
92 * When BR_USE_WIN32_TIME is enabled, the X.509 validation engine obtains
93 * the current time from the OS by calling the Win32 function
94 * GetSystemTimeAsFileTime().
95 *
96 * Note: if both BR_USE_UNIX_TIME and BR_USE_WIN32_TIME are defined, the
97 * former takes precedence.
98 *
99 #define BR_USE_WIN32_TIME 1
100 */
101
102 #endif