Mercurial > dropbear
comparison libtommath/tommath_class.h @ 1655:f52919ffd3b1
update ltm to 1.1.0 and enable FIPS 186.4 compliant key-generation (#79)
* make key-generation compliant to FIPS 186.4
* fix includes in tommath_class.h
* update fuzzcorpus instead of error-out
* fixup fuzzing make-targets
* update Makefile.in
* apply necessary patches to ltm sources
* clean-up not required ltm files
* update to vanilla ltm 1.1.0
this already only contains the required files
* remove set/get double
author | Steffen Jaeckel <s_jaeckel@gmx.de> |
---|---|
date | Mon, 16 Sep 2019 15:50:38 +0200 |
parents | d4efb7801fcd |
children | 1051e4eea25a |
comparison
equal
deleted
inserted
replaced
1654:cc0fc5131c5c | 1655:f52919ffd3b1 |
---|---|
1 /* LibTomMath, multiple-precision integer library -- Tom St Denis | |
2 * | |
3 * LibTomMath is a library that provides multiple-precision | |
4 * integer arithmetic as well as number theoretic functionality. | |
5 * | |
6 * The library was designed directly after the MPI library by | |
7 * Michael Fromberger but has been written from scratch with | |
8 * additional optimizations in place. | |
9 * | |
10 * SPDX-License-Identifier: Unlicense | |
11 */ | |
12 | |
1 #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) | 13 #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) |
2 #if defined(LTM2) | 14 #if defined(LTM2) |
3 #define LTM3 | 15 # define LTM3 |
4 #endif | 16 #endif |
5 #if defined(LTM1) | 17 #if defined(LTM1) |
6 #define LTM2 | 18 # define LTM2 |
7 #endif | 19 #endif |
8 #define LTM1 | 20 #define LTM1 |
9 | |
10 #if defined(LTM_ALL) | 21 #if defined(LTM_ALL) |
11 #define BN_ERROR_C | 22 # define BN_ERROR_C |
12 #define BN_FAST_MP_INVMOD_C | 23 # define BN_FAST_MP_INVMOD_C |
13 #define BN_FAST_MP_MONTGOMERY_REDUCE_C | 24 # define BN_FAST_MP_MONTGOMERY_REDUCE_C |
14 #define BN_FAST_S_MP_MUL_DIGS_C | 25 # define BN_FAST_S_MP_MUL_DIGS_C |
15 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C | 26 # define BN_FAST_S_MP_MUL_HIGH_DIGS_C |
16 #define BN_FAST_S_MP_SQR_C | 27 # define BN_FAST_S_MP_SQR_C |
17 #define BN_MP_2EXPT_C | 28 # define BN_MP_2EXPT_C |
18 #define BN_MP_ABS_C | 29 # define BN_MP_ABS_C |
19 #define BN_MP_ADD_C | 30 # define BN_MP_ADD_C |
20 #define BN_MP_ADD_D_C | 31 # define BN_MP_ADD_D_C |
21 #define BN_MP_ADDMOD_C | 32 # define BN_MP_ADDMOD_C |
22 #define BN_MP_AND_C | 33 # define BN_MP_AND_C |
23 #define BN_MP_CLAMP_C | 34 # define BN_MP_CLAMP_C |
24 #define BN_MP_CLEAR_C | 35 # define BN_MP_CLEAR_C |
25 #define BN_MP_CLEAR_MULTI_C | 36 # define BN_MP_CLEAR_MULTI_C |
26 #define BN_MP_CMP_C | 37 # define BN_MP_CMP_C |
27 #define BN_MP_CMP_D_C | 38 # define BN_MP_CMP_D_C |
28 #define BN_MP_CMP_MAG_C | 39 # define BN_MP_CMP_MAG_C |
29 #define BN_MP_CNT_LSB_C | 40 # define BN_MP_CNT_LSB_C |
30 #define BN_MP_COPY_C | 41 # define BN_MP_COMPLEMENT_C |
31 #define BN_MP_COUNT_BITS_C | 42 # define BN_MP_COPY_C |
32 #define BN_MP_DIV_C | 43 # define BN_MP_COUNT_BITS_C |
33 #define BN_MP_DIV_2_C | 44 # define BN_MP_DIV_C |
34 #define BN_MP_DIV_2D_C | 45 # define BN_MP_DIV_2_C |
35 #define BN_MP_DIV_3_C | 46 # define BN_MP_DIV_2D_C |
36 #define BN_MP_DIV_D_C | 47 # define BN_MP_DIV_3_C |
37 #define BN_MP_DR_IS_MODULUS_C | 48 # define BN_MP_DIV_D_C |
38 #define BN_MP_DR_REDUCE_C | 49 # define BN_MP_DR_IS_MODULUS_C |
39 #define BN_MP_DR_SETUP_C | 50 # define BN_MP_DR_REDUCE_C |
40 #define BN_MP_EXCH_C | 51 # define BN_MP_DR_SETUP_C |
41 #define BN_MP_EXPORT_C | 52 # define BN_MP_EXCH_C |
42 #define BN_MP_EXPT_D_C | 53 # define BN_MP_EXPORT_C |
43 #define BN_MP_EXPT_D_EX_C | 54 # define BN_MP_EXPT_D_C |
44 #define BN_MP_EXPTMOD_C | 55 # define BN_MP_EXPT_D_EX_C |
45 #define BN_MP_EXPTMOD_FAST_C | 56 # define BN_MP_EXPTMOD_C |
46 #define BN_MP_EXTEUCLID_C | 57 # define BN_MP_EXPTMOD_FAST_C |
47 #define BN_MP_FREAD_C | 58 # define BN_MP_EXTEUCLID_C |
48 #define BN_MP_FWRITE_C | 59 # define BN_MP_FREAD_C |
49 #define BN_MP_GCD_C | 60 # define BN_MP_FWRITE_C |
50 #define BN_MP_GET_INT_C | 61 # define BN_MP_GCD_C |
51 #define BN_MP_GET_LONG_C | 62 # define BN_MP_GET_BIT_C |
52 #define BN_MP_GET_LONG_LONG_C | 63 # define BN_MP_GET_DOUBLE_C |
53 #define BN_MP_GROW_C | 64 # define BN_MP_GET_INT_C |
54 #define BN_MP_IMPORT_C | 65 # define BN_MP_GET_LONG_C |
55 #define BN_MP_INIT_C | 66 # define BN_MP_GET_LONG_LONG_C |
56 #define BN_MP_INIT_COPY_C | 67 # define BN_MP_GROW_C |
57 #define BN_MP_INIT_MULTI_C | 68 # define BN_MP_IMPORT_C |
58 #define BN_MP_INIT_SET_C | 69 # define BN_MP_INIT_C |
59 #define BN_MP_INIT_SET_INT_C | 70 # define BN_MP_INIT_COPY_C |
60 #define BN_MP_INIT_SIZE_C | 71 # define BN_MP_INIT_MULTI_C |
61 #define BN_MP_INVMOD_C | 72 # define BN_MP_INIT_SET_C |
62 #define BN_MP_INVMOD_SLOW_C | 73 # define BN_MP_INIT_SET_INT_C |
63 #define BN_MP_IS_SQUARE_C | 74 # define BN_MP_INIT_SIZE_C |
64 #define BN_MP_JACOBI_C | 75 # define BN_MP_INVMOD_C |
65 #define BN_MP_KARATSUBA_MUL_C | 76 # define BN_MP_INVMOD_SLOW_C |
66 #define BN_MP_KARATSUBA_SQR_C | 77 # define BN_MP_IS_SQUARE_C |
67 #define BN_MP_LCM_C | 78 # define BN_MP_JACOBI_C |
68 #define BN_MP_LSHD_C | 79 # define BN_MP_KARATSUBA_MUL_C |
69 #define BN_MP_MOD_C | 80 # define BN_MP_KARATSUBA_SQR_C |
70 #define BN_MP_MOD_2D_C | 81 # define BN_MP_KRONECKER_C |
71 #define BN_MP_MOD_D_C | 82 # define BN_MP_LCM_C |
72 #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C | 83 # define BN_MP_LSHD_C |
73 #define BN_MP_MONTGOMERY_REDUCE_C | 84 # define BN_MP_MOD_C |
74 #define BN_MP_MONTGOMERY_SETUP_C | 85 # define BN_MP_MOD_2D_C |
75 #define BN_MP_MUL_C | 86 # define BN_MP_MOD_D_C |
76 #define BN_MP_MUL_2_C | 87 # define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C |
77 #define BN_MP_MUL_2D_C | 88 # define BN_MP_MONTGOMERY_REDUCE_C |
78 #define BN_MP_MUL_D_C | 89 # define BN_MP_MONTGOMERY_SETUP_C |
79 #define BN_MP_MULMOD_C | 90 # define BN_MP_MUL_C |
80 #define BN_MP_N_ROOT_C | 91 # define BN_MP_MUL_2_C |
81 #define BN_MP_N_ROOT_EX_C | 92 # define BN_MP_MUL_2D_C |
82 #define BN_MP_NEG_C | 93 # define BN_MP_MUL_D_C |
83 #define BN_MP_OR_C | 94 # define BN_MP_MULMOD_C |
84 #define BN_MP_PRIME_FERMAT_C | 95 # define BN_MP_N_ROOT_C |
85 #define BN_MP_PRIME_IS_DIVISIBLE_C | 96 # define BN_MP_N_ROOT_EX_C |
86 #define BN_MP_PRIME_IS_PRIME_C | 97 # define BN_MP_NEG_C |
87 #define BN_MP_PRIME_MILLER_RABIN_C | 98 # define BN_MP_OR_C |
88 #define BN_MP_PRIME_NEXT_PRIME_C | 99 # define BN_MP_PRIME_FERMAT_C |
89 #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C | 100 # define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C |
90 #define BN_MP_PRIME_RANDOM_EX_C | 101 # define BN_MP_PRIME_IS_DIVISIBLE_C |
91 #define BN_MP_RADIX_SIZE_C | 102 # define BN_MP_PRIME_IS_PRIME_C |
92 #define BN_MP_RADIX_SMAP_C | 103 # define BN_MP_PRIME_MILLER_RABIN_C |
93 #define BN_MP_RAND_C | 104 # define BN_MP_PRIME_NEXT_PRIME_C |
94 #define BN_MP_READ_RADIX_C | 105 # define BN_MP_PRIME_RABIN_MILLER_TRIALS_C |
95 #define BN_MP_READ_SIGNED_BIN_C | 106 # define BN_MP_PRIME_RANDOM_EX_C |
96 #define BN_MP_READ_UNSIGNED_BIN_C | 107 # define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C |
97 #define BN_MP_REDUCE_C | 108 # define BN_MP_RADIX_SIZE_C |
98 #define BN_MP_REDUCE_2K_C | 109 # define BN_MP_RADIX_SMAP_C |
99 #define BN_MP_REDUCE_2K_L_C | 110 # define BN_MP_RAND_C |
100 #define BN_MP_REDUCE_2K_SETUP_C | 111 # define BN_MP_READ_RADIX_C |
101 #define BN_MP_REDUCE_2K_SETUP_L_C | 112 # define BN_MP_READ_SIGNED_BIN_C |
102 #define BN_MP_REDUCE_IS_2K_C | 113 # define BN_MP_READ_UNSIGNED_BIN_C |
103 #define BN_MP_REDUCE_IS_2K_L_C | 114 # define BN_MP_REDUCE_C |
104 #define BN_MP_REDUCE_SETUP_C | 115 # define BN_MP_REDUCE_2K_C |
105 #define BN_MP_RSHD_C | 116 # define BN_MP_REDUCE_2K_L_C |
106 #define BN_MP_SET_C | 117 # define BN_MP_REDUCE_2K_SETUP_C |
107 #define BN_MP_SET_INT_C | 118 # define BN_MP_REDUCE_2K_SETUP_L_C |
108 #define BN_MP_SET_LONG_C | 119 # define BN_MP_REDUCE_IS_2K_C |
109 #define BN_MP_SET_LONG_LONG_C | 120 # define BN_MP_REDUCE_IS_2K_L_C |
110 #define BN_MP_SHRINK_C | 121 # define BN_MP_REDUCE_SETUP_C |
111 #define BN_MP_SIGNED_BIN_SIZE_C | 122 # define BN_MP_RSHD_C |
112 #define BN_MP_SQR_C | 123 # define BN_MP_SET_C |
113 #define BN_MP_SQRMOD_C | 124 # define BN_MP_SET_DOUBLE_C |
114 #define BN_MP_SQRT_C | 125 # define BN_MP_SET_INT_C |
115 #define BN_MP_SQRTMOD_PRIME_C | 126 # define BN_MP_SET_LONG_C |
116 #define BN_MP_SUB_C | 127 # define BN_MP_SET_LONG_LONG_C |
117 #define BN_MP_SUB_D_C | 128 # define BN_MP_SHRINK_C |
118 #define BN_MP_SUBMOD_C | 129 # define BN_MP_SIGNED_BIN_SIZE_C |
119 #define BN_MP_TO_SIGNED_BIN_C | 130 # define BN_MP_SQR_C |
120 #define BN_MP_TO_SIGNED_BIN_N_C | 131 # define BN_MP_SQRMOD_C |
121 #define BN_MP_TO_UNSIGNED_BIN_C | 132 # define BN_MP_SQRT_C |
122 #define BN_MP_TO_UNSIGNED_BIN_N_C | 133 # define BN_MP_SQRTMOD_PRIME_C |
123 #define BN_MP_TOOM_MUL_C | 134 # define BN_MP_SUB_C |
124 #define BN_MP_TOOM_SQR_C | 135 # define BN_MP_SUB_D_C |
125 #define BN_MP_TORADIX_C | 136 # define BN_MP_SUBMOD_C |
126 #define BN_MP_TORADIX_N_C | 137 # define BN_MP_TC_AND_C |
127 #define BN_MP_UNSIGNED_BIN_SIZE_C | 138 # define BN_MP_TC_DIV_2D_C |
128 #define BN_MP_XOR_C | 139 # define BN_MP_TC_OR_C |
129 #define BN_MP_ZERO_C | 140 # define BN_MP_TC_XOR_C |
130 #define BN_PRIME_TAB_C | 141 # define BN_MP_TO_SIGNED_BIN_C |
131 #define BN_REVERSE_C | 142 # define BN_MP_TO_SIGNED_BIN_N_C |
132 #define BN_S_MP_ADD_C | 143 # define BN_MP_TO_UNSIGNED_BIN_C |
133 #define BN_S_MP_EXPTMOD_C | 144 # define BN_MP_TO_UNSIGNED_BIN_N_C |
134 #define BN_S_MP_MUL_DIGS_C | 145 # define BN_MP_TOOM_MUL_C |
135 #define BN_S_MP_MUL_HIGH_DIGS_C | 146 # define BN_MP_TOOM_SQR_C |
136 #define BN_S_MP_SQR_C | 147 # define BN_MP_TORADIX_C |
137 #define BN_S_MP_SUB_C | 148 # define BN_MP_TORADIX_N_C |
138 #define BNCORE_C | 149 # define BN_MP_UNSIGNED_BIN_SIZE_C |
139 #endif | 150 # define BN_MP_XOR_C |
140 | 151 # define BN_MP_ZERO_C |
152 # define BN_PRIME_TAB_C | |
153 # define BN_REVERSE_C | |
154 # define BN_S_MP_ADD_C | |
155 # define BN_S_MP_EXPTMOD_C | |
156 # define BN_S_MP_MUL_DIGS_C | |
157 # define BN_S_MP_MUL_HIGH_DIGS_C | |
158 # define BN_S_MP_SQR_C | |
159 # define BN_S_MP_SUB_C | |
160 # define BNCORE_C | |
161 #endif | |
141 #if defined(BN_ERROR_C) | 162 #if defined(BN_ERROR_C) |
142 #define BN_MP_ERROR_TO_STRING_C | 163 # define BN_MP_ERROR_TO_STRING_C |
143 #endif | 164 #endif |
144 | 165 |
145 #if defined(BN_FAST_MP_INVMOD_C) | 166 #if defined(BN_FAST_MP_INVMOD_C) |
146 #define BN_MP_ISEVEN_C | 167 # define BN_MP_ISEVEN_C |
147 #define BN_MP_INIT_MULTI_C | 168 # define BN_MP_INIT_MULTI_C |
148 #define BN_MP_COPY_C | 169 # define BN_MP_COPY_C |
149 #define BN_MP_MOD_C | 170 # define BN_MP_MOD_C |
150 #define BN_MP_SET_C | 171 # define BN_MP_ISZERO_C |
151 #define BN_MP_DIV_2_C | 172 # define BN_MP_SET_C |
152 #define BN_MP_ISODD_C | 173 # define BN_MP_DIV_2_C |
153 #define BN_MP_SUB_C | 174 # define BN_MP_ISODD_C |
154 #define BN_MP_CMP_C | 175 # define BN_MP_SUB_C |
155 #define BN_MP_ISZERO_C | 176 # define BN_MP_CMP_C |
156 #define BN_MP_CMP_D_C | 177 # define BN_MP_CMP_D_C |
157 #define BN_MP_ADD_C | 178 # define BN_MP_ADD_C |
158 #define BN_MP_EXCH_C | 179 # define BN_MP_CMP_MAG_C |
159 #define BN_MP_CLEAR_MULTI_C | 180 # define BN_MP_EXCH_C |
181 # define BN_MP_CLEAR_MULTI_C | |
160 #endif | 182 #endif |
161 | 183 |
162 #if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C) | 184 #if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C) |
163 #define BN_MP_GROW_C | 185 # define BN_MP_GROW_C |
164 #define BN_MP_RSHD_C | 186 # define BN_MP_RSHD_C |
165 #define BN_MP_CLAMP_C | 187 # define BN_MP_CLAMP_C |
166 #define BN_MP_CMP_MAG_C | 188 # define BN_MP_CMP_MAG_C |
167 #define BN_S_MP_SUB_C | 189 # define BN_S_MP_SUB_C |
168 #endif | 190 #endif |
169 | 191 |
170 #if defined(BN_FAST_S_MP_MUL_DIGS_C) | 192 #if defined(BN_FAST_S_MP_MUL_DIGS_C) |
171 #define BN_MP_GROW_C | 193 # define BN_MP_GROW_C |
172 #define BN_MP_CLAMP_C | 194 # define BN_MP_CLAMP_C |
173 #endif | 195 #endif |
174 | 196 |
175 #if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) | 197 #if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) |
176 #define BN_MP_GROW_C | 198 # define BN_MP_GROW_C |
177 #define BN_MP_CLAMP_C | 199 # define BN_MP_CLAMP_C |
178 #endif | 200 #endif |
179 | 201 |
180 #if defined(BN_FAST_S_MP_SQR_C) | 202 #if defined(BN_FAST_S_MP_SQR_C) |
181 #define BN_MP_GROW_C | 203 # define BN_MP_GROW_C |
182 #define BN_MP_CLAMP_C | 204 # define BN_MP_CLAMP_C |
183 #endif | 205 #endif |
184 | 206 |
185 #if defined(BN_MP_2EXPT_C) | 207 #if defined(BN_MP_2EXPT_C) |
186 #define BN_MP_ZERO_C | 208 # define BN_MP_ZERO_C |
187 #define BN_MP_GROW_C | 209 # define BN_MP_GROW_C |
188 #endif | 210 #endif |
189 | 211 |
190 #if defined(BN_MP_ABS_C) | 212 #if defined(BN_MP_ABS_C) |
191 #define BN_MP_COPY_C | 213 # define BN_MP_COPY_C |
192 #endif | 214 #endif |
193 | 215 |
194 #if defined(BN_MP_ADD_C) | 216 #if defined(BN_MP_ADD_C) |
195 #define BN_S_MP_ADD_C | 217 # define BN_S_MP_ADD_C |
196 #define BN_MP_CMP_MAG_C | 218 # define BN_MP_CMP_MAG_C |
197 #define BN_S_MP_SUB_C | 219 # define BN_S_MP_SUB_C |
198 #endif | 220 #endif |
199 | 221 |
200 #if defined(BN_MP_ADD_D_C) | 222 #if defined(BN_MP_ADD_D_C) |
201 #define BN_MP_GROW_C | 223 # define BN_MP_GROW_C |
202 #define BN_MP_SUB_D_C | 224 # define BN_MP_SUB_D_C |
203 #define BN_MP_CLAMP_C | 225 # define BN_MP_CLAMP_C |
204 #endif | 226 #endif |
205 | 227 |
206 #if defined(BN_MP_ADDMOD_C) | 228 #if defined(BN_MP_ADDMOD_C) |
207 #define BN_MP_INIT_C | 229 # define BN_MP_INIT_C |
208 #define BN_MP_ADD_C | 230 # define BN_MP_ADD_C |
209 #define BN_MP_CLEAR_C | 231 # define BN_MP_CLEAR_C |
210 #define BN_MP_MOD_C | 232 # define BN_MP_MOD_C |
211 #endif | 233 #endif |
212 | 234 |
213 #if defined(BN_MP_AND_C) | 235 #if defined(BN_MP_AND_C) |
214 #define BN_MP_INIT_COPY_C | 236 # define BN_MP_INIT_COPY_C |
215 #define BN_MP_CLAMP_C | 237 # define BN_MP_CLAMP_C |
216 #define BN_MP_EXCH_C | 238 # define BN_MP_EXCH_C |
217 #define BN_MP_CLEAR_C | 239 # define BN_MP_CLEAR_C |
218 #endif | 240 #endif |
219 | 241 |
220 #if defined(BN_MP_CLAMP_C) | 242 #if defined(BN_MP_CLAMP_C) |
221 #endif | 243 #endif |
222 | 244 |
223 #if defined(BN_MP_CLEAR_C) | 245 #if defined(BN_MP_CLEAR_C) |
224 #endif | 246 #endif |
225 | 247 |
226 #if defined(BN_MP_CLEAR_MULTI_C) | 248 #if defined(BN_MP_CLEAR_MULTI_C) |
227 #define BN_MP_CLEAR_C | 249 # define BN_MP_CLEAR_C |
228 #endif | 250 #endif |
229 | 251 |
230 #if defined(BN_MP_CMP_C) | 252 #if defined(BN_MP_CMP_C) |
231 #define BN_MP_CMP_MAG_C | 253 # define BN_MP_CMP_MAG_C |
232 #endif | 254 #endif |
233 | 255 |
234 #if defined(BN_MP_CMP_D_C) | 256 #if defined(BN_MP_CMP_D_C) |
235 #endif | 257 #endif |
236 | 258 |
237 #if defined(BN_MP_CMP_MAG_C) | 259 #if defined(BN_MP_CMP_MAG_C) |
238 #endif | 260 #endif |
239 | 261 |
240 #if defined(BN_MP_CNT_LSB_C) | 262 #if defined(BN_MP_CNT_LSB_C) |
241 #define BN_MP_ISZERO_C | 263 # define BN_MP_ISZERO_C |
264 #endif | |
265 | |
266 #if defined(BN_MP_COMPLEMENT_C) | |
267 # define BN_MP_NEG_C | |
268 # define BN_MP_SUB_D_C | |
242 #endif | 269 #endif |
243 | 270 |
244 #if defined(BN_MP_COPY_C) | 271 #if defined(BN_MP_COPY_C) |
245 #define BN_MP_GROW_C | 272 # define BN_MP_GROW_C |
246 #endif | 273 #endif |
247 | 274 |
248 #if defined(BN_MP_COUNT_BITS_C) | 275 #if defined(BN_MP_COUNT_BITS_C) |
249 #endif | 276 #endif |
250 | 277 |
251 #if defined(BN_MP_DIV_C) | 278 #if defined(BN_MP_DIV_C) |
252 #define BN_MP_ISZERO_C | 279 # define BN_MP_ISZERO_C |
253 #define BN_MP_CMP_MAG_C | 280 # define BN_MP_CMP_MAG_C |
254 #define BN_MP_COPY_C | 281 # define BN_MP_COPY_C |
255 #define BN_MP_ZERO_C | 282 # define BN_MP_ZERO_C |
256 #define BN_MP_INIT_MULTI_C | 283 # define BN_MP_INIT_MULTI_C |
257 #define BN_MP_SET_C | 284 # define BN_MP_SET_C |
258 #define BN_MP_COUNT_BITS_C | 285 # define BN_MP_COUNT_BITS_C |
259 #define BN_MP_ABS_C | 286 # define BN_MP_ABS_C |
260 #define BN_MP_MUL_2D_C | 287 # define BN_MP_MUL_2D_C |
261 #define BN_MP_CMP_C | 288 # define BN_MP_CMP_C |
262 #define BN_MP_SUB_C | 289 # define BN_MP_SUB_C |
263 #define BN_MP_ADD_C | 290 # define BN_MP_ADD_C |
264 #define BN_MP_DIV_2D_C | 291 # define BN_MP_DIV_2D_C |
265 #define BN_MP_EXCH_C | 292 # define BN_MP_EXCH_C |
266 #define BN_MP_CLEAR_MULTI_C | 293 # define BN_MP_CLEAR_MULTI_C |
267 #define BN_MP_INIT_SIZE_C | 294 # define BN_MP_INIT_SIZE_C |
268 #define BN_MP_INIT_C | 295 # define BN_MP_INIT_C |
269 #define BN_MP_INIT_COPY_C | 296 # define BN_MP_INIT_COPY_C |
270 #define BN_MP_LSHD_C | 297 # define BN_MP_LSHD_C |
271 #define BN_MP_RSHD_C | 298 # define BN_MP_RSHD_C |
272 #define BN_MP_MUL_D_C | 299 # define BN_MP_MUL_D_C |
273 #define BN_MP_CLAMP_C | 300 # define BN_MP_CLAMP_C |
274 #define BN_MP_CLEAR_C | 301 # define BN_MP_CLEAR_C |
275 #endif | 302 #endif |
276 | 303 |
277 #if defined(BN_MP_DIV_2_C) | 304 #if defined(BN_MP_DIV_2_C) |
278 #define BN_MP_GROW_C | 305 # define BN_MP_GROW_C |
279 #define BN_MP_CLAMP_C | 306 # define BN_MP_CLAMP_C |
280 #endif | 307 #endif |
281 | 308 |
282 #if defined(BN_MP_DIV_2D_C) | 309 #if defined(BN_MP_DIV_2D_C) |
283 #define BN_MP_COPY_C | 310 # define BN_MP_COPY_C |
284 #define BN_MP_ZERO_C | 311 # define BN_MP_ZERO_C |
285 #define BN_MP_MOD_2D_C | 312 # define BN_MP_MOD_2D_C |
286 #define BN_MP_RSHD_C | 313 # define BN_MP_RSHD_C |
287 #define BN_MP_CLAMP_C | 314 # define BN_MP_CLAMP_C |
288 #endif | 315 #endif |
289 | 316 |
290 #if defined(BN_MP_DIV_3_C) | 317 #if defined(BN_MP_DIV_3_C) |
291 #define BN_MP_INIT_SIZE_C | 318 # define BN_MP_INIT_SIZE_C |
292 #define BN_MP_CLAMP_C | 319 # define BN_MP_CLAMP_C |
293 #define BN_MP_EXCH_C | 320 # define BN_MP_EXCH_C |
294 #define BN_MP_CLEAR_C | 321 # define BN_MP_CLEAR_C |
295 #endif | 322 #endif |
296 | 323 |
297 #if defined(BN_MP_DIV_D_C) | 324 #if defined(BN_MP_DIV_D_C) |
298 #define BN_MP_ISZERO_C | 325 # define BN_MP_ISZERO_C |
299 #define BN_MP_COPY_C | 326 # define BN_MP_COPY_C |
300 #define BN_MP_DIV_2D_C | 327 # define BN_MP_DIV_2D_C |
301 #define BN_MP_DIV_3_C | 328 # define BN_MP_DIV_3_C |
302 #define BN_MP_INIT_SIZE_C | 329 # define BN_MP_INIT_SIZE_C |
303 #define BN_MP_CLAMP_C | 330 # define BN_MP_CLAMP_C |
304 #define BN_MP_EXCH_C | 331 # define BN_MP_EXCH_C |
305 #define BN_MP_CLEAR_C | 332 # define BN_MP_CLEAR_C |
306 #endif | 333 #endif |
307 | 334 |
308 #if defined(BN_MP_DR_IS_MODULUS_C) | 335 #if defined(BN_MP_DR_IS_MODULUS_C) |
309 #endif | 336 #endif |
310 | 337 |
311 #if defined(BN_MP_DR_REDUCE_C) | 338 #if defined(BN_MP_DR_REDUCE_C) |
312 #define BN_MP_GROW_C | 339 # define BN_MP_GROW_C |
313 #define BN_MP_CLAMP_C | 340 # define BN_MP_CLAMP_C |
314 #define BN_MP_CMP_MAG_C | 341 # define BN_MP_CMP_MAG_C |
315 #define BN_S_MP_SUB_C | 342 # define BN_S_MP_SUB_C |
316 #endif | 343 #endif |
317 | 344 |
318 #if defined(BN_MP_DR_SETUP_C) | 345 #if defined(BN_MP_DR_SETUP_C) |
319 #endif | 346 #endif |
320 | 347 |
321 #if defined(BN_MP_EXCH_C) | 348 #if defined(BN_MP_EXCH_C) |
322 #endif | 349 #endif |
323 | 350 |
324 #if defined(BN_MP_EXPORT_C) | 351 #if defined(BN_MP_EXPORT_C) |
325 #define BN_MP_INIT_COPY_C | 352 # define BN_MP_INIT_COPY_C |
326 #define BN_MP_COUNT_BITS_C | 353 # define BN_MP_COUNT_BITS_C |
327 #define BN_MP_DIV_2D_C | 354 # define BN_MP_DIV_2D_C |
328 #define BN_MP_CLEAR_C | 355 # define BN_MP_CLEAR_C |
329 #endif | 356 #endif |
330 | 357 |
331 #if defined(BN_MP_EXPT_D_C) | 358 #if defined(BN_MP_EXPT_D_C) |
332 #define BN_MP_EXPT_D_EX_C | 359 # define BN_MP_EXPT_D_EX_C |
333 #endif | 360 #endif |
334 | 361 |
335 #if defined(BN_MP_EXPT_D_EX_C) | 362 #if defined(BN_MP_EXPT_D_EX_C) |
336 #define BN_MP_INIT_COPY_C | 363 # define BN_MP_INIT_COPY_C |
337 #define BN_MP_SET_C | 364 # define BN_MP_SET_C |
338 #define BN_MP_MUL_C | 365 # define BN_MP_MUL_C |
339 #define BN_MP_CLEAR_C | 366 # define BN_MP_CLEAR_C |
340 #define BN_MP_SQR_C | 367 # define BN_MP_SQR_C |
341 #endif | 368 #endif |
342 | 369 |
343 #if defined(BN_MP_EXPTMOD_C) | 370 #if defined(BN_MP_EXPTMOD_C) |
344 #define BN_MP_INIT_C | 371 # define BN_MP_INIT_C |
345 #define BN_MP_INVMOD_C | 372 # define BN_MP_INVMOD_C |
346 #define BN_MP_CLEAR_C | 373 # define BN_MP_CLEAR_C |
347 #define BN_MP_ABS_C | 374 # define BN_MP_ABS_C |
348 #define BN_MP_CLEAR_MULTI_C | 375 # define BN_MP_CLEAR_MULTI_C |
349 #define BN_MP_REDUCE_IS_2K_L_C | 376 # define BN_MP_REDUCE_IS_2K_L_C |
350 #define BN_S_MP_EXPTMOD_C | 377 # define BN_S_MP_EXPTMOD_C |
351 #define BN_MP_DR_IS_MODULUS_C | 378 # define BN_MP_DR_IS_MODULUS_C |
352 #define BN_MP_REDUCE_IS_2K_C | 379 # define BN_MP_REDUCE_IS_2K_C |
353 #define BN_MP_ISODD_C | 380 # define BN_MP_ISODD_C |
354 #define BN_MP_EXPTMOD_FAST_C | 381 # define BN_MP_EXPTMOD_FAST_C |
355 #endif | 382 #endif |
356 | 383 |
357 #if defined(BN_MP_EXPTMOD_FAST_C) | 384 #if defined(BN_MP_EXPTMOD_FAST_C) |
358 #define BN_MP_COUNT_BITS_C | 385 # define BN_MP_COUNT_BITS_C |
359 #define BN_MP_INIT_SIZE_C | 386 # define BN_MP_INIT_SIZE_C |
360 #define BN_MP_CLEAR_C | 387 # define BN_MP_CLEAR_C |
361 #define BN_MP_MONTGOMERY_SETUP_C | 388 # define BN_MP_MONTGOMERY_SETUP_C |
362 #define BN_FAST_MP_MONTGOMERY_REDUCE_C | 389 # define BN_FAST_MP_MONTGOMERY_REDUCE_C |
363 #define BN_MP_MONTGOMERY_REDUCE_C | 390 # define BN_MP_MONTGOMERY_REDUCE_C |
364 #define BN_MP_DR_SETUP_C | 391 # define BN_MP_DR_SETUP_C |
365 #define BN_MP_DR_REDUCE_C | 392 # define BN_MP_DR_REDUCE_C |
366 #define BN_MP_REDUCE_2K_SETUP_C | 393 # define BN_MP_REDUCE_2K_SETUP_C |
367 #define BN_MP_REDUCE_2K_C | 394 # define BN_MP_REDUCE_2K_C |
368 #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C | 395 # define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C |
369 #define BN_MP_MULMOD_C | 396 # define BN_MP_MULMOD_C |
370 #define BN_MP_SET_C | 397 # define BN_MP_SET_C |
371 #define BN_MP_MOD_C | 398 # define BN_MP_MOD_C |
372 #define BN_MP_COPY_C | 399 # define BN_MP_COPY_C |
373 #define BN_MP_SQR_C | 400 # define BN_MP_SQR_C |
374 #define BN_MP_MUL_C | 401 # define BN_MP_MUL_C |
375 #define BN_MP_EXCH_C | 402 # define BN_MP_EXCH_C |
376 #endif | 403 #endif |
377 | 404 |
378 #if defined(BN_MP_EXTEUCLID_C) | 405 #if defined(BN_MP_EXTEUCLID_C) |
379 #define BN_MP_INIT_MULTI_C | 406 # define BN_MP_INIT_MULTI_C |
380 #define BN_MP_SET_C | 407 # define BN_MP_SET_C |
381 #define BN_MP_COPY_C | 408 # define BN_MP_COPY_C |
382 #define BN_MP_ISZERO_C | 409 # define BN_MP_ISZERO_C |
383 #define BN_MP_DIV_C | 410 # define BN_MP_DIV_C |
384 #define BN_MP_MUL_C | 411 # define BN_MP_MUL_C |
385 #define BN_MP_SUB_C | 412 # define BN_MP_SUB_C |
386 #define BN_MP_NEG_C | 413 # define BN_MP_NEG_C |
387 #define BN_MP_EXCH_C | 414 # define BN_MP_EXCH_C |
388 #define BN_MP_CLEAR_MULTI_C | 415 # define BN_MP_CLEAR_MULTI_C |
389 #endif | 416 #endif |
390 | 417 |
391 #if defined(BN_MP_FREAD_C) | 418 #if defined(BN_MP_FREAD_C) |
392 #define BN_MP_ZERO_C | 419 # define BN_MP_ZERO_C |
393 #define BN_MP_S_RMAP_C | 420 # define BN_MP_S_RMAP_REVERSE_SZ_C |
394 #define BN_MP_MUL_D_C | 421 # define BN_MP_S_RMAP_REVERSE_C |
395 #define BN_MP_ADD_D_C | 422 # define BN_MP_MUL_D_C |
396 #define BN_MP_CMP_D_C | 423 # define BN_MP_ADD_D_C |
424 # define BN_MP_CMP_D_C | |
397 #endif | 425 #endif |
398 | 426 |
399 #if defined(BN_MP_FWRITE_C) | 427 #if defined(BN_MP_FWRITE_C) |
400 #define BN_MP_RADIX_SIZE_C | 428 # define BN_MP_RADIX_SIZE_C |
401 #define BN_MP_TORADIX_C | 429 # define BN_MP_TORADIX_C |
402 #endif | 430 #endif |
403 | 431 |
404 #if defined(BN_MP_GCD_C) | 432 #if defined(BN_MP_GCD_C) |
405 #define BN_MP_ISZERO_C | 433 # define BN_MP_ISZERO_C |
406 #define BN_MP_ABS_C | 434 # define BN_MP_ABS_C |
407 #define BN_MP_INIT_COPY_C | 435 # define BN_MP_INIT_COPY_C |
408 #define BN_MP_CNT_LSB_C | 436 # define BN_MP_CNT_LSB_C |
409 #define BN_MP_DIV_2D_C | 437 # define BN_MP_DIV_2D_C |
410 #define BN_MP_CMP_MAG_C | 438 # define BN_MP_CMP_MAG_C |
411 #define BN_MP_EXCH_C | 439 # define BN_MP_EXCH_C |
412 #define BN_S_MP_SUB_C | 440 # define BN_S_MP_SUB_C |
413 #define BN_MP_MUL_2D_C | 441 # define BN_MP_MUL_2D_C |
414 #define BN_MP_CLEAR_C | 442 # define BN_MP_CLEAR_C |
443 #endif | |
444 | |
445 #if defined(BN_MP_GET_BIT_C) | |
446 # define BN_MP_ISZERO_C | |
447 #endif | |
448 | |
449 #if defined(BN_MP_GET_DOUBLE_C) | |
450 # define BN_MP_ISNEG_C | |
415 #endif | 451 #endif |
416 | 452 |
417 #if defined(BN_MP_GET_INT_C) | 453 #if defined(BN_MP_GET_INT_C) |
418 #endif | 454 #endif |
419 | 455 |
425 | 461 |
426 #if defined(BN_MP_GROW_C) | 462 #if defined(BN_MP_GROW_C) |
427 #endif | 463 #endif |
428 | 464 |
429 #if defined(BN_MP_IMPORT_C) | 465 #if defined(BN_MP_IMPORT_C) |
430 #define BN_MP_ZERO_C | 466 # define BN_MP_ZERO_C |
431 #define BN_MP_MUL_2D_C | 467 # define BN_MP_MUL_2D_C |
432 #define BN_MP_CLAMP_C | 468 # define BN_MP_CLAMP_C |
433 #endif | 469 #endif |
434 | 470 |
435 #if defined(BN_MP_INIT_C) | 471 #if defined(BN_MP_INIT_C) |
436 #endif | 472 #endif |
437 | 473 |
438 #if defined(BN_MP_INIT_COPY_C) | 474 #if defined(BN_MP_INIT_COPY_C) |
439 #define BN_MP_INIT_SIZE_C | 475 # define BN_MP_INIT_SIZE_C |
440 #define BN_MP_COPY_C | 476 # define BN_MP_COPY_C |
441 #define BN_MP_CLEAR_C | 477 # define BN_MP_CLEAR_C |
442 #endif | 478 #endif |
443 | 479 |
444 #if defined(BN_MP_INIT_MULTI_C) | 480 #if defined(BN_MP_INIT_MULTI_C) |
445 #define BN_MP_ERR_C | 481 # define BN_MP_ERR_C |
446 #define BN_MP_INIT_C | 482 # define BN_MP_INIT_C |
447 #define BN_MP_CLEAR_C | 483 # define BN_MP_CLEAR_C |
448 #endif | 484 #endif |
449 | 485 |
450 #if defined(BN_MP_INIT_SET_C) | 486 #if defined(BN_MP_INIT_SET_C) |
451 #define BN_MP_INIT_C | 487 # define BN_MP_INIT_C |
452 #define BN_MP_SET_C | 488 # define BN_MP_SET_C |
453 #endif | 489 #endif |
454 | 490 |
455 #if defined(BN_MP_INIT_SET_INT_C) | 491 #if defined(BN_MP_INIT_SET_INT_C) |
456 #define BN_MP_INIT_C | 492 # define BN_MP_INIT_C |
457 #define BN_MP_SET_INT_C | 493 # define BN_MP_SET_INT_C |
458 #endif | 494 #endif |
459 | 495 |
460 #if defined(BN_MP_INIT_SIZE_C) | 496 #if defined(BN_MP_INIT_SIZE_C) |
461 #define BN_MP_INIT_C | 497 # define BN_MP_INIT_C |
462 #endif | 498 #endif |
463 | 499 |
464 #if defined(BN_MP_INVMOD_C) | 500 #if defined(BN_MP_INVMOD_C) |
465 #define BN_MP_ISZERO_C | 501 # define BN_MP_CMP_D_C |
466 #define BN_MP_ISODD_C | 502 # define BN_MP_ISODD_C |
467 #define BN_MP_CMP_D_C | 503 # define BN_FAST_MP_INVMOD_C |
468 #define BN_FAST_MP_INVMOD_C | 504 # define BN_MP_INVMOD_SLOW_C |
469 #define BN_MP_INVMOD_SLOW_C | |
470 #endif | 505 #endif |
471 | 506 |
472 #if defined(BN_MP_INVMOD_SLOW_C) | 507 #if defined(BN_MP_INVMOD_SLOW_C) |
473 #define BN_MP_ISZERO_C | 508 # define BN_MP_ISZERO_C |
474 #define BN_MP_INIT_MULTI_C | 509 # define BN_MP_INIT_MULTI_C |
475 #define BN_MP_MOD_C | 510 # define BN_MP_MOD_C |
476 #define BN_MP_COPY_C | 511 # define BN_MP_COPY_C |
477 #define BN_MP_ISEVEN_C | 512 # define BN_MP_ISEVEN_C |
478 #define BN_MP_SET_C | 513 # define BN_MP_SET_C |
479 #define BN_MP_DIV_2_C | 514 # define BN_MP_DIV_2_C |
480 #define BN_MP_ISODD_C | 515 # define BN_MP_ISODD_C |
481 #define BN_MP_ADD_C | 516 # define BN_MP_ADD_C |
482 #define BN_MP_SUB_C | 517 # define BN_MP_SUB_C |
483 #define BN_MP_CMP_C | 518 # define BN_MP_CMP_C |
484 #define BN_MP_CMP_D_C | 519 # define BN_MP_CMP_D_C |
485 #define BN_MP_CMP_MAG_C | 520 # define BN_MP_CMP_MAG_C |
486 #define BN_MP_EXCH_C | 521 # define BN_MP_EXCH_C |
487 #define BN_MP_CLEAR_MULTI_C | 522 # define BN_MP_CLEAR_MULTI_C |
488 #endif | 523 #endif |
489 | 524 |
490 #if defined(BN_MP_IS_SQUARE_C) | 525 #if defined(BN_MP_IS_SQUARE_C) |
491 #define BN_MP_MOD_D_C | 526 # define BN_MP_MOD_D_C |
492 #define BN_MP_INIT_SET_INT_C | 527 # define BN_MP_INIT_SET_INT_C |
493 #define BN_MP_MOD_C | 528 # define BN_MP_MOD_C |
494 #define BN_MP_GET_INT_C | 529 # define BN_MP_GET_INT_C |
495 #define BN_MP_SQRT_C | 530 # define BN_MP_SQRT_C |
496 #define BN_MP_SQR_C | 531 # define BN_MP_SQR_C |
497 #define BN_MP_CMP_MAG_C | 532 # define BN_MP_CMP_MAG_C |
498 #define BN_MP_CLEAR_C | 533 # define BN_MP_CLEAR_C |
499 #endif | 534 #endif |
500 | 535 |
501 #if defined(BN_MP_JACOBI_C) | 536 #if defined(BN_MP_JACOBI_C) |
502 #define BN_MP_ISNEG_C | 537 # define BN_MP_KRONECKER_C |
503 #define BN_MP_CMP_D_C | 538 # define BN_MP_ISNEG_C |
504 #define BN_MP_ISZERO_C | 539 # define BN_MP_CMP_D_C |
505 #define BN_MP_INIT_COPY_C | |
506 #define BN_MP_CNT_LSB_C | |
507 #define BN_MP_DIV_2D_C | |
508 #define BN_MP_MOD_C | |
509 #define BN_MP_CLEAR_C | |
510 #endif | 540 #endif |
511 | 541 |
512 #if defined(BN_MP_KARATSUBA_MUL_C) | 542 #if defined(BN_MP_KARATSUBA_MUL_C) |
513 #define BN_MP_MUL_C | 543 # define BN_MP_MUL_C |
514 #define BN_MP_INIT_SIZE_C | 544 # define BN_MP_INIT_SIZE_C |
515 #define BN_MP_CLAMP_C | 545 # define BN_MP_CLAMP_C |
516 #define BN_S_MP_ADD_C | 546 # define BN_S_MP_ADD_C |
517 #define BN_MP_ADD_C | 547 # define BN_MP_ADD_C |
518 #define BN_S_MP_SUB_C | 548 # define BN_S_MP_SUB_C |
519 #define BN_MP_LSHD_C | 549 # define BN_MP_LSHD_C |
520 #define BN_MP_CLEAR_C | 550 # define BN_MP_CLEAR_C |
521 #endif | 551 #endif |
522 | 552 |
523 #if defined(BN_MP_KARATSUBA_SQR_C) | 553 #if defined(BN_MP_KARATSUBA_SQR_C) |
524 #define BN_MP_INIT_SIZE_C | 554 # define BN_MP_INIT_SIZE_C |
525 #define BN_MP_CLAMP_C | 555 # define BN_MP_CLAMP_C |
526 #define BN_MP_SQR_C | 556 # define BN_MP_SQR_C |
527 #define BN_S_MP_ADD_C | 557 # define BN_S_MP_ADD_C |
528 #define BN_S_MP_SUB_C | 558 # define BN_S_MP_SUB_C |
529 #define BN_MP_LSHD_C | 559 # define BN_MP_LSHD_C |
530 #define BN_MP_ADD_C | 560 # define BN_MP_ADD_C |
531 #define BN_MP_CLEAR_C | 561 # define BN_MP_CLEAR_C |
562 #endif | |
563 | |
564 #if defined(BN_MP_KRONECKER_C) | |
565 # define BN_MP_ISZERO_C | |
566 # define BN_MP_ISEVEN_C | |
567 # define BN_MP_INIT_COPY_C | |
568 # define BN_MP_CNT_LSB_C | |
569 # define BN_MP_DIV_2D_C | |
570 # define BN_MP_CMP_D_C | |
571 # define BN_MP_COPY_C | |
572 # define BN_MP_MOD_C | |
573 # define BN_MP_CLEAR_C | |
532 #endif | 574 #endif |
533 | 575 |
534 #if defined(BN_MP_LCM_C) | 576 #if defined(BN_MP_LCM_C) |
535 #define BN_MP_INIT_MULTI_C | 577 # define BN_MP_INIT_MULTI_C |
536 #define BN_MP_GCD_C | 578 # define BN_MP_GCD_C |
537 #define BN_MP_CMP_MAG_C | 579 # define BN_MP_CMP_MAG_C |
538 #define BN_MP_DIV_C | 580 # define BN_MP_DIV_C |
539 #define BN_MP_MUL_C | 581 # define BN_MP_MUL_C |
540 #define BN_MP_CLEAR_MULTI_C | 582 # define BN_MP_CLEAR_MULTI_C |
541 #endif | 583 #endif |
542 | 584 |
543 #if defined(BN_MP_LSHD_C) | 585 #if defined(BN_MP_LSHD_C) |
544 #define BN_MP_GROW_C | 586 # define BN_MP_ISZERO_C |
545 #define BN_MP_RSHD_C | 587 # define BN_MP_GROW_C |
588 # define BN_MP_RSHD_C | |
546 #endif | 589 #endif |
547 | 590 |
548 #if defined(BN_MP_MOD_C) | 591 #if defined(BN_MP_MOD_C) |
549 #define BN_MP_INIT_SIZE_C | 592 # define BN_MP_INIT_SIZE_C |
550 #define BN_MP_DIV_C | 593 # define BN_MP_DIV_C |
551 #define BN_MP_CLEAR_C | 594 # define BN_MP_CLEAR_C |
552 #define BN_MP_ISZERO_C | 595 # define BN_MP_ISZERO_C |
553 #define BN_MP_EXCH_C | 596 # define BN_MP_EXCH_C |
554 #define BN_MP_ADD_C | 597 # define BN_MP_ADD_C |
555 #endif | 598 #endif |
556 | 599 |
557 #if defined(BN_MP_MOD_2D_C) | 600 #if defined(BN_MP_MOD_2D_C) |
558 #define BN_MP_ZERO_C | 601 # define BN_MP_ZERO_C |
559 #define BN_MP_COPY_C | 602 # define BN_MP_COPY_C |
560 #define BN_MP_CLAMP_C | 603 # define BN_MP_CLAMP_C |
561 #endif | 604 #endif |
562 | 605 |
563 #if defined(BN_MP_MOD_D_C) | 606 #if defined(BN_MP_MOD_D_C) |
564 #define BN_MP_DIV_D_C | 607 # define BN_MP_DIV_D_C |
565 #endif | 608 #endif |
566 | 609 |
567 #if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) | 610 #if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) |
568 #define BN_MP_COUNT_BITS_C | 611 # define BN_MP_COUNT_BITS_C |
569 #define BN_MP_2EXPT_C | 612 # define BN_MP_2EXPT_C |
570 #define BN_MP_SET_C | 613 # define BN_MP_SET_C |
571 #define BN_MP_MUL_2_C | 614 # define BN_MP_MUL_2_C |
572 #define BN_MP_CMP_MAG_C | 615 # define BN_MP_CMP_MAG_C |
573 #define BN_S_MP_SUB_C | 616 # define BN_S_MP_SUB_C |
574 #endif | 617 #endif |
575 | 618 |
576 #if defined(BN_MP_MONTGOMERY_REDUCE_C) | 619 #if defined(BN_MP_MONTGOMERY_REDUCE_C) |
577 #define BN_FAST_MP_MONTGOMERY_REDUCE_C | 620 # define BN_FAST_MP_MONTGOMERY_REDUCE_C |
578 #define BN_MP_GROW_C | 621 # define BN_MP_GROW_C |
579 #define BN_MP_CLAMP_C | 622 # define BN_MP_CLAMP_C |
580 #define BN_MP_RSHD_C | 623 # define BN_MP_RSHD_C |
581 #define BN_MP_CMP_MAG_C | 624 # define BN_MP_CMP_MAG_C |
582 #define BN_S_MP_SUB_C | 625 # define BN_S_MP_SUB_C |
583 #endif | 626 #endif |
584 | 627 |
585 #if defined(BN_MP_MONTGOMERY_SETUP_C) | 628 #if defined(BN_MP_MONTGOMERY_SETUP_C) |
586 #endif | 629 #endif |
587 | 630 |
588 #if defined(BN_MP_MUL_C) | 631 #if defined(BN_MP_MUL_C) |
589 #define BN_MP_TOOM_MUL_C | 632 # define BN_MP_TOOM_MUL_C |
590 #define BN_MP_KARATSUBA_MUL_C | 633 # define BN_MP_KARATSUBA_MUL_C |
591 #define BN_FAST_S_MP_MUL_DIGS_C | 634 # define BN_FAST_S_MP_MUL_DIGS_C |
592 #define BN_S_MP_MUL_C | 635 # define BN_S_MP_MUL_C |
593 #define BN_S_MP_MUL_DIGS_C | 636 # define BN_S_MP_MUL_DIGS_C |
594 #endif | 637 #endif |
595 | 638 |
596 #if defined(BN_MP_MUL_2_C) | 639 #if defined(BN_MP_MUL_2_C) |
597 #define BN_MP_GROW_C | 640 # define BN_MP_GROW_C |
598 #endif | 641 #endif |
599 | 642 |
600 #if defined(BN_MP_MUL_2D_C) | 643 #if defined(BN_MP_MUL_2D_C) |
601 #define BN_MP_COPY_C | 644 # define BN_MP_COPY_C |
602 #define BN_MP_GROW_C | 645 # define BN_MP_GROW_C |
603 #define BN_MP_LSHD_C | 646 # define BN_MP_LSHD_C |
604 #define BN_MP_CLAMP_C | 647 # define BN_MP_CLAMP_C |
605 #endif | 648 #endif |
606 | 649 |
607 #if defined(BN_MP_MUL_D_C) | 650 #if defined(BN_MP_MUL_D_C) |
608 #define BN_MP_GROW_C | 651 # define BN_MP_GROW_C |
609 #define BN_MP_CLAMP_C | 652 # define BN_MP_CLAMP_C |
610 #endif | 653 #endif |
611 | 654 |
612 #if defined(BN_MP_MULMOD_C) | 655 #if defined(BN_MP_MULMOD_C) |
613 #define BN_MP_INIT_SIZE_C | 656 # define BN_MP_INIT_SIZE_C |
614 #define BN_MP_MUL_C | 657 # define BN_MP_MUL_C |
615 #define BN_MP_CLEAR_C | 658 # define BN_MP_CLEAR_C |
616 #define BN_MP_MOD_C | 659 # define BN_MP_MOD_C |
617 #endif | 660 #endif |
618 | 661 |
619 #if defined(BN_MP_N_ROOT_C) | 662 #if defined(BN_MP_N_ROOT_C) |
620 #define BN_MP_N_ROOT_EX_C | 663 # define BN_MP_N_ROOT_EX_C |
621 #endif | 664 #endif |
622 | 665 |
623 #if defined(BN_MP_N_ROOT_EX_C) | 666 #if defined(BN_MP_N_ROOT_EX_C) |
624 #define BN_MP_INIT_C | 667 # define BN_MP_INIT_C |
625 #define BN_MP_SET_C | 668 # define BN_MP_SET_C |
626 #define BN_MP_COPY_C | 669 # define BN_MP_COPY_C |
627 #define BN_MP_EXPT_D_EX_C | 670 # define BN_MP_EXPT_D_EX_C |
628 #define BN_MP_MUL_C | 671 # define BN_MP_MUL_C |
629 #define BN_MP_SUB_C | 672 # define BN_MP_SUB_C |
630 #define BN_MP_MUL_D_C | 673 # define BN_MP_MUL_D_C |
631 #define BN_MP_DIV_C | 674 # define BN_MP_DIV_C |
632 #define BN_MP_CMP_C | 675 # define BN_MP_CMP_C |
633 #define BN_MP_SUB_D_C | 676 # define BN_MP_SUB_D_C |
634 #define BN_MP_EXCH_C | 677 # define BN_MP_EXCH_C |
635 #define BN_MP_CLEAR_C | 678 # define BN_MP_CLEAR_C |
636 #endif | 679 #endif |
637 | 680 |
638 #if defined(BN_MP_NEG_C) | 681 #if defined(BN_MP_NEG_C) |
639 #define BN_MP_COPY_C | 682 # define BN_MP_COPY_C |
640 #define BN_MP_ISZERO_C | 683 # define BN_MP_ISZERO_C |
641 #endif | 684 #endif |
642 | 685 |
643 #if defined(BN_MP_OR_C) | 686 #if defined(BN_MP_OR_C) |
644 #define BN_MP_INIT_COPY_C | 687 # define BN_MP_INIT_COPY_C |
645 #define BN_MP_CLAMP_C | 688 # define BN_MP_CLAMP_C |
646 #define BN_MP_EXCH_C | 689 # define BN_MP_EXCH_C |
647 #define BN_MP_CLEAR_C | 690 # define BN_MP_CLEAR_C |
648 #endif | 691 #endif |
649 | 692 |
650 #if defined(BN_MP_PRIME_FERMAT_C) | 693 #if defined(BN_MP_PRIME_FERMAT_C) |
651 #define BN_MP_CMP_D_C | 694 # define BN_MP_CMP_D_C |
652 #define BN_MP_INIT_C | 695 # define BN_MP_INIT_C |
653 #define BN_MP_EXPTMOD_C | 696 # define BN_MP_EXPTMOD_C |
654 #define BN_MP_CMP_C | 697 # define BN_MP_CMP_C |
655 #define BN_MP_CLEAR_C | 698 # define BN_MP_CLEAR_C |
699 #endif | |
700 | |
701 #if defined(BN_MP_PRIME_FROBENIUS_UNDERWOOD_C) | |
702 # define BN_MP_PRIME_IS_PRIME_C | |
703 # define BN_MP_INIT_MULTI_C | |
704 # define BN_MP_SET_LONG_C | |
705 # define BN_MP_SQR_C | |
706 # define BN_MP_SUB_D_C | |
707 # define BN_MP_KRONECKER_C | |
708 # define BN_MP_GCD_C | |
709 # define BN_MP_ADD_D_C | |
710 # define BN_MP_SET_C | |
711 # define BN_MP_COUNT_BITS_C | |
712 # define BN_MP_MUL_2_C | |
713 # define BN_MP_MUL_D_C | |
714 # define BN_MP_ADD_C | |
715 # define BN_MP_MUL_C | |
716 # define BN_MP_SUB_C | |
717 # define BN_MP_MOD_C | |
718 # define BN_MP_GET_BIT_C | |
719 # define BN_MP_EXCH_C | |
720 # define BN_MP_ISZERO_C | |
721 # define BN_MP_CMP_C | |
722 # define BN_MP_CLEAR_MULTI_C | |
656 #endif | 723 #endif |
657 | 724 |
658 #if defined(BN_MP_PRIME_IS_DIVISIBLE_C) | 725 #if defined(BN_MP_PRIME_IS_DIVISIBLE_C) |
659 #define BN_MP_MOD_D_C | 726 # define BN_MP_MOD_D_C |
660 #endif | 727 #endif |
661 | 728 |
662 #if defined(BN_MP_PRIME_IS_PRIME_C) | 729 #if defined(BN_MP_PRIME_IS_PRIME_C) |
663 #define BN_MP_CMP_D_C | 730 # define BN_MP_ISEVEN_C |
664 #define BN_MP_PRIME_IS_DIVISIBLE_C | 731 # define BN_MP_IS_SQUARE_C |
665 #define BN_MP_INIT_C | 732 # define BN_MP_CMP_D_C |
666 #define BN_MP_SET_C | 733 # define BN_MP_PRIME_IS_DIVISIBLE_C |
667 #define BN_MP_PRIME_MILLER_RABIN_C | 734 # define BN_MP_INIT_SET_C |
668 #define BN_MP_CLEAR_C | 735 # define BN_MP_PRIME_MILLER_RABIN_C |
736 # define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C | |
737 # define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C | |
738 # define BN_MP_READ_RADIX_C | |
739 # define BN_MP_CMP_C | |
740 # define BN_MP_SET_C | |
741 # define BN_MP_COUNT_BITS_C | |
742 # define BN_MP_RAND_C | |
743 # define BN_MP_DIV_2D_C | |
744 # define BN_MP_CLEAR_C | |
669 #endif | 745 #endif |
670 | 746 |
671 #if defined(BN_MP_PRIME_MILLER_RABIN_C) | 747 #if defined(BN_MP_PRIME_MILLER_RABIN_C) |
672 #define BN_MP_CMP_D_C | 748 # define BN_MP_CMP_D_C |
673 #define BN_MP_INIT_COPY_C | 749 # define BN_MP_INIT_COPY_C |
674 #define BN_MP_SUB_D_C | 750 # define BN_MP_SUB_D_C |
675 #define BN_MP_CNT_LSB_C | 751 # define BN_MP_CNT_LSB_C |
676 #define BN_MP_DIV_2D_C | 752 # define BN_MP_DIV_2D_C |
677 #define BN_MP_EXPTMOD_C | 753 # define BN_MP_EXPTMOD_C |
678 #define BN_MP_CMP_C | 754 # define BN_MP_CMP_C |
679 #define BN_MP_SQRMOD_C | 755 # define BN_MP_SQRMOD_C |
680 #define BN_MP_CLEAR_C | 756 # define BN_MP_CLEAR_C |
681 #endif | 757 #endif |
682 | 758 |
683 #if defined(BN_MP_PRIME_NEXT_PRIME_C) | 759 #if defined(BN_MP_PRIME_NEXT_PRIME_C) |
684 #define BN_MP_CMP_D_C | 760 # define BN_MP_CMP_D_C |
685 #define BN_MP_SET_C | 761 # define BN_MP_SET_C |
686 #define BN_MP_SUB_D_C | 762 # define BN_MP_SUB_D_C |
687 #define BN_MP_ISEVEN_C | 763 # define BN_MP_ISEVEN_C |
688 #define BN_MP_MOD_D_C | 764 # define BN_MP_MOD_D_C |
689 #define BN_MP_INIT_C | 765 # define BN_MP_INIT_C |
690 #define BN_MP_ADD_D_C | 766 # define BN_MP_ADD_D_C |
691 #define BN_MP_PRIME_MILLER_RABIN_C | 767 # define BN_MP_PRIME_IS_PRIME_C |
692 #define BN_MP_CLEAR_C | 768 # define BN_MP_CLEAR_C |
693 #endif | 769 #endif |
694 | 770 |
695 #if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) | 771 #if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) |
696 #endif | 772 #endif |
697 | 773 |
698 #if defined(BN_MP_PRIME_RANDOM_EX_C) | 774 #if defined(BN_MP_PRIME_RANDOM_EX_C) |
699 #define BN_MP_READ_UNSIGNED_BIN_C | 775 # define BN_MP_READ_UNSIGNED_BIN_C |
700 #define BN_MP_PRIME_IS_PRIME_C | 776 # define BN_MP_PRIME_IS_PRIME_C |
701 #define BN_MP_SUB_D_C | 777 # define BN_MP_SUB_D_C |
702 #define BN_MP_DIV_2_C | 778 # define BN_MP_DIV_2_C |
703 #define BN_MP_MUL_2_C | 779 # define BN_MP_MUL_2_C |
704 #define BN_MP_ADD_D_C | 780 # define BN_MP_ADD_D_C |
781 #endif | |
782 | |
783 #if defined(BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C) | |
784 # define BN_MP_PRIME_IS_PRIME_C | |
785 # define BN_MP_MUL_D_C | |
786 # define BN_S_MP_MUL_SI_C | |
787 # define BN_MP_INIT_C | |
788 # define BN_MP_SET_LONG_C | |
789 # define BN_MP_MUL_C | |
790 # define BN_MP_CLEAR_C | |
791 # define BN_MP_INIT_MULTI_C | |
792 # define BN_MP_GCD_C | |
793 # define BN_MP_CMP_D_C | |
794 # define BN_MP_CMP_C | |
795 # define BN_MP_KRONECKER_C | |
796 # define BN_MP_ADD_D_C | |
797 # define BN_MP_CNT_LSB_C | |
798 # define BN_MP_DIV_2D_C | |
799 # define BN_MP_SET_C | |
800 # define BN_MP_MUL_2_C | |
801 # define BN_MP_COUNT_BITS_C | |
802 # define BN_MP_MOD_C | |
803 # define BN_MP_SQR_C | |
804 # define BN_MP_SUB_C | |
805 # define BN_MP_GET_BIT_C | |
806 # define BN_MP_ADD_C | |
807 # define BN_MP_ISODD_C | |
808 # define BN_MP_DIV_2_C | |
809 # define BN_MP_SUB_D_C | |
810 # define BN_MP_ISZERO_C | |
811 # define BN_MP_CLEAR_MULTI_C | |
705 #endif | 812 #endif |
706 | 813 |
707 #if defined(BN_MP_RADIX_SIZE_C) | 814 #if defined(BN_MP_RADIX_SIZE_C) |
708 #define BN_MP_ISZERO_C | 815 # define BN_MP_ISZERO_C |
709 #define BN_MP_COUNT_BITS_C | 816 # define BN_MP_COUNT_BITS_C |
710 #define BN_MP_INIT_COPY_C | 817 # define BN_MP_INIT_COPY_C |
711 #define BN_MP_DIV_D_C | 818 # define BN_MP_DIV_D_C |
712 #define BN_MP_CLEAR_C | 819 # define BN_MP_CLEAR_C |
713 #endif | 820 #endif |
714 | 821 |
715 #if defined(BN_MP_RADIX_SMAP_C) | 822 #if defined(BN_MP_RADIX_SMAP_C) |
716 #define BN_MP_S_RMAP_C | 823 # define BN_MP_S_RMAP_C |
824 # define BN_MP_S_RMAP_REVERSE_C | |
825 # define BN_MP_S_RMAP_REVERSE_SZ_C | |
717 #endif | 826 #endif |
718 | 827 |
719 #if defined(BN_MP_RAND_C) | 828 #if defined(BN_MP_RAND_C) |
720 #define BN_MP_ZERO_C | 829 # define BN_MP_RAND_DIGIT_C |
721 #define BN_MP_ADD_D_C | 830 # define BN_MP_ZERO_C |
722 #define BN_MP_LSHD_C | 831 # define BN_MP_ADD_D_C |
832 # define BN_MP_LSHD_C | |
723 #endif | 833 #endif |
724 | 834 |
725 #if defined(BN_MP_READ_RADIX_C) | 835 #if defined(BN_MP_READ_RADIX_C) |
726 #define BN_MP_ZERO_C | 836 # define BN_MP_ZERO_C |
727 #define BN_MP_S_RMAP_C | 837 # define BN_MP_S_RMAP_REVERSE_SZ_C |
728 #define BN_MP_MUL_D_C | 838 # define BN_MP_S_RMAP_REVERSE_C |
729 #define BN_MP_ADD_D_C | 839 # define BN_MP_MUL_D_C |
730 #define BN_MP_ISZERO_C | 840 # define BN_MP_ADD_D_C |
841 # define BN_MP_ISZERO_C | |
731 #endif | 842 #endif |
732 | 843 |
733 #if defined(BN_MP_READ_SIGNED_BIN_C) | 844 #if defined(BN_MP_READ_SIGNED_BIN_C) |
734 #define BN_MP_READ_UNSIGNED_BIN_C | 845 # define BN_MP_READ_UNSIGNED_BIN_C |
735 #endif | 846 #endif |
736 | 847 |
737 #if defined(BN_MP_READ_UNSIGNED_BIN_C) | 848 #if defined(BN_MP_READ_UNSIGNED_BIN_C) |
738 #define BN_MP_GROW_C | 849 # define BN_MP_GROW_C |
739 #define BN_MP_ZERO_C | 850 # define BN_MP_ZERO_C |
740 #define BN_MP_MUL_2D_C | 851 # define BN_MP_MUL_2D_C |
741 #define BN_MP_CLAMP_C | 852 # define BN_MP_CLAMP_C |
742 #endif | 853 #endif |
743 | 854 |
744 #if defined(BN_MP_REDUCE_C) | 855 #if defined(BN_MP_REDUCE_C) |
745 #define BN_MP_REDUCE_SETUP_C | 856 # define BN_MP_REDUCE_SETUP_C |
746 #define BN_MP_INIT_COPY_C | 857 # define BN_MP_INIT_COPY_C |
747 #define BN_MP_RSHD_C | 858 # define BN_MP_RSHD_C |
748 #define BN_MP_MUL_C | 859 # define BN_MP_MUL_C |
749 #define BN_S_MP_MUL_HIGH_DIGS_C | 860 # define BN_S_MP_MUL_HIGH_DIGS_C |
750 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C | 861 # define BN_FAST_S_MP_MUL_HIGH_DIGS_C |
751 #define BN_MP_MOD_2D_C | 862 # define BN_MP_MOD_2D_C |
752 #define BN_S_MP_MUL_DIGS_C | 863 # define BN_S_MP_MUL_DIGS_C |
753 #define BN_MP_SUB_C | 864 # define BN_MP_SUB_C |
754 #define BN_MP_CMP_D_C | 865 # define BN_MP_CMP_D_C |
755 #define BN_MP_SET_C | 866 # define BN_MP_SET_C |
756 #define BN_MP_LSHD_C | 867 # define BN_MP_LSHD_C |
757 #define BN_MP_ADD_C | 868 # define BN_MP_ADD_C |
758 #define BN_MP_CMP_C | 869 # define BN_MP_CMP_C |
759 #define BN_S_MP_SUB_C | 870 # define BN_S_MP_SUB_C |
760 #define BN_MP_CLEAR_C | 871 # define BN_MP_CLEAR_C |
761 #endif | 872 #endif |
762 | 873 |
763 #if defined(BN_MP_REDUCE_2K_C) | 874 #if defined(BN_MP_REDUCE_2K_C) |
764 #define BN_MP_INIT_C | 875 # define BN_MP_INIT_C |
765 #define BN_MP_COUNT_BITS_C | 876 # define BN_MP_COUNT_BITS_C |
766 #define BN_MP_DIV_2D_C | 877 # define BN_MP_DIV_2D_C |
767 #define BN_MP_MUL_D_C | 878 # define BN_MP_MUL_D_C |
768 #define BN_S_MP_ADD_C | 879 # define BN_S_MP_ADD_C |
769 #define BN_MP_CMP_MAG_C | 880 # define BN_MP_CMP_MAG_C |
770 #define BN_S_MP_SUB_C | 881 # define BN_S_MP_SUB_C |
771 #define BN_MP_CLEAR_C | 882 # define BN_MP_CLEAR_C |
772 #endif | 883 #endif |
773 | 884 |
774 #if defined(BN_MP_REDUCE_2K_L_C) | 885 #if defined(BN_MP_REDUCE_2K_L_C) |
775 #define BN_MP_INIT_C | 886 # define BN_MP_INIT_C |
776 #define BN_MP_COUNT_BITS_C | 887 # define BN_MP_COUNT_BITS_C |
777 #define BN_MP_DIV_2D_C | 888 # define BN_MP_DIV_2D_C |
778 #define BN_MP_MUL_C | 889 # define BN_MP_MUL_C |
779 #define BN_S_MP_ADD_C | 890 # define BN_S_MP_ADD_C |
780 #define BN_MP_CMP_MAG_C | 891 # define BN_MP_CMP_MAG_C |
781 #define BN_S_MP_SUB_C | 892 # define BN_S_MP_SUB_C |
782 #define BN_MP_CLEAR_C | 893 # define BN_MP_CLEAR_C |
783 #endif | 894 #endif |
784 | 895 |
785 #if defined(BN_MP_REDUCE_2K_SETUP_C) | 896 #if defined(BN_MP_REDUCE_2K_SETUP_C) |
786 #define BN_MP_INIT_C | 897 # define BN_MP_INIT_C |
787 #define BN_MP_COUNT_BITS_C | 898 # define BN_MP_COUNT_BITS_C |
788 #define BN_MP_2EXPT_C | 899 # define BN_MP_2EXPT_C |
789 #define BN_MP_CLEAR_C | 900 # define BN_MP_CLEAR_C |
790 #define BN_S_MP_SUB_C | 901 # define BN_S_MP_SUB_C |
791 #endif | 902 #endif |
792 | 903 |
793 #if defined(BN_MP_REDUCE_2K_SETUP_L_C) | 904 #if defined(BN_MP_REDUCE_2K_SETUP_L_C) |
794 #define BN_MP_INIT_C | 905 # define BN_MP_INIT_C |
795 #define BN_MP_2EXPT_C | 906 # define BN_MP_2EXPT_C |
796 #define BN_MP_COUNT_BITS_C | 907 # define BN_MP_COUNT_BITS_C |
797 #define BN_S_MP_SUB_C | 908 # define BN_S_MP_SUB_C |
798 #define BN_MP_CLEAR_C | 909 # define BN_MP_CLEAR_C |
799 #endif | 910 #endif |
800 | 911 |
801 #if defined(BN_MP_REDUCE_IS_2K_C) | 912 #if defined(BN_MP_REDUCE_IS_2K_C) |
802 #define BN_MP_REDUCE_2K_C | 913 # define BN_MP_REDUCE_2K_C |
803 #define BN_MP_COUNT_BITS_C | 914 # define BN_MP_COUNT_BITS_C |
804 #endif | 915 #endif |
805 | 916 |
806 #if defined(BN_MP_REDUCE_IS_2K_L_C) | 917 #if defined(BN_MP_REDUCE_IS_2K_L_C) |
807 #endif | 918 #endif |
808 | 919 |
809 #if defined(BN_MP_REDUCE_SETUP_C) | 920 #if defined(BN_MP_REDUCE_SETUP_C) |
810 #define BN_MP_2EXPT_C | 921 # define BN_MP_2EXPT_C |
811 #define BN_MP_DIV_C | 922 # define BN_MP_DIV_C |
812 #endif | 923 #endif |
813 | 924 |
814 #if defined(BN_MP_RSHD_C) | 925 #if defined(BN_MP_RSHD_C) |
815 #define BN_MP_ZERO_C | 926 # define BN_MP_ZERO_C |
816 #endif | 927 #endif |
817 | 928 |
818 #if defined(BN_MP_SET_C) | 929 #if defined(BN_MP_SET_C) |
819 #define BN_MP_ZERO_C | 930 # define BN_MP_ZERO_C |
931 #endif | |
932 | |
933 #if defined(BN_MP_SET_DOUBLE_C) | |
934 # define BN_MP_SET_LONG_LONG_C | |
935 # define BN_MP_DIV_2D_C | |
936 # define BN_MP_MUL_2D_C | |
937 # define BN_MP_ISZERO_C | |
820 #endif | 938 #endif |
821 | 939 |
822 #if defined(BN_MP_SET_INT_C) | 940 #if defined(BN_MP_SET_INT_C) |
823 #define BN_MP_ZERO_C | 941 # define BN_MP_ZERO_C |
824 #define BN_MP_MUL_2D_C | 942 # define BN_MP_MUL_2D_C |
825 #define BN_MP_CLAMP_C | 943 # define BN_MP_CLAMP_C |
826 #endif | 944 #endif |
827 | 945 |
828 #if defined(BN_MP_SET_LONG_C) | 946 #if defined(BN_MP_SET_LONG_C) |
829 #endif | 947 #endif |
830 | 948 |
833 | 951 |
834 #if defined(BN_MP_SHRINK_C) | 952 #if defined(BN_MP_SHRINK_C) |
835 #endif | 953 #endif |
836 | 954 |
837 #if defined(BN_MP_SIGNED_BIN_SIZE_C) | 955 #if defined(BN_MP_SIGNED_BIN_SIZE_C) |
838 #define BN_MP_UNSIGNED_BIN_SIZE_C | 956 # define BN_MP_UNSIGNED_BIN_SIZE_C |
839 #endif | 957 #endif |
840 | 958 |
841 #if defined(BN_MP_SQR_C) | 959 #if defined(BN_MP_SQR_C) |
842 #define BN_MP_TOOM_SQR_C | 960 # define BN_MP_TOOM_SQR_C |
843 #define BN_MP_KARATSUBA_SQR_C | 961 # define BN_MP_KARATSUBA_SQR_C |
844 #define BN_FAST_S_MP_SQR_C | 962 # define BN_FAST_S_MP_SQR_C |
845 #define BN_S_MP_SQR_C | 963 # define BN_S_MP_SQR_C |
846 #endif | 964 #endif |
847 | 965 |
848 #if defined(BN_MP_SQRMOD_C) | 966 #if defined(BN_MP_SQRMOD_C) |
849 #define BN_MP_INIT_C | 967 # define BN_MP_INIT_C |
850 #define BN_MP_SQR_C | 968 # define BN_MP_SQR_C |
851 #define BN_MP_CLEAR_C | 969 # define BN_MP_CLEAR_C |
852 #define BN_MP_MOD_C | 970 # define BN_MP_MOD_C |
853 #endif | 971 #endif |
854 | 972 |
855 #if defined(BN_MP_SQRT_C) | 973 #if defined(BN_MP_SQRT_C) |
856 #define BN_MP_N_ROOT_C | 974 # define BN_MP_N_ROOT_C |
857 #define BN_MP_ISZERO_C | 975 # define BN_MP_ISZERO_C |
858 #define BN_MP_ZERO_C | 976 # define BN_MP_ZERO_C |
859 #define BN_MP_INIT_COPY_C | 977 # define BN_MP_INIT_COPY_C |
860 #define BN_MP_RSHD_C | 978 # define BN_MP_RSHD_C |
861 #define BN_MP_DIV_C | 979 # define BN_MP_DIV_C |
862 #define BN_MP_ADD_C | 980 # define BN_MP_ADD_C |
863 #define BN_MP_DIV_2_C | 981 # define BN_MP_DIV_2_C |
864 #define BN_MP_CMP_MAG_C | 982 # define BN_MP_CMP_MAG_C |
865 #define BN_MP_EXCH_C | 983 # define BN_MP_EXCH_C |
866 #define BN_MP_CLEAR_C | 984 # define BN_MP_CLEAR_C |
867 #endif | 985 #endif |
868 | 986 |
869 #if defined(BN_MP_SQRTMOD_PRIME_C) | 987 #if defined(BN_MP_SQRTMOD_PRIME_C) |
870 #define BN_MP_CMP_D_C | 988 # define BN_MP_CMP_D_C |
871 #define BN_MP_ZERO_C | 989 # define BN_MP_ZERO_C |
872 #define BN_MP_JACOBI_C | 990 # define BN_MP_JACOBI_C |
873 #define BN_MP_INIT_MULTI_C | 991 # define BN_MP_INIT_MULTI_C |
874 #define BN_MP_MOD_D_C | 992 # define BN_MP_MOD_D_C |
875 #define BN_MP_ADD_D_C | 993 # define BN_MP_ADD_D_C |
876 #define BN_MP_DIV_2_C | 994 # define BN_MP_DIV_2_C |
877 #define BN_MP_EXPTMOD_C | 995 # define BN_MP_EXPTMOD_C |
878 #define BN_MP_COPY_C | 996 # define BN_MP_COPY_C |
879 #define BN_MP_SUB_D_C | 997 # define BN_MP_SUB_D_C |
880 #define BN_MP_ISEVEN_C | 998 # define BN_MP_ISEVEN_C |
881 #define BN_MP_SET_INT_C | 999 # define BN_MP_SET_INT_C |
882 #define BN_MP_SQRMOD_C | 1000 # define BN_MP_SQRMOD_C |
883 #define BN_MP_MULMOD_C | 1001 # define BN_MP_MULMOD_C |
884 #define BN_MP_SET_C | 1002 # define BN_MP_SET_C |
885 #define BN_MP_CLEAR_MULTI_C | 1003 # define BN_MP_CLEAR_MULTI_C |
886 #endif | 1004 #endif |
887 | 1005 |
888 #if defined(BN_MP_SUB_C) | 1006 #if defined(BN_MP_SUB_C) |
889 #define BN_S_MP_ADD_C | 1007 # define BN_S_MP_ADD_C |
890 #define BN_MP_CMP_MAG_C | 1008 # define BN_MP_CMP_MAG_C |
891 #define BN_S_MP_SUB_C | 1009 # define BN_S_MP_SUB_C |
892 #endif | 1010 #endif |
893 | 1011 |
894 #if defined(BN_MP_SUB_D_C) | 1012 #if defined(BN_MP_SUB_D_C) |
895 #define BN_MP_GROW_C | 1013 # define BN_MP_GROW_C |
896 #define BN_MP_ADD_D_C | 1014 # define BN_MP_ADD_D_C |
897 #define BN_MP_CLAMP_C | 1015 # define BN_MP_CLAMP_C |
898 #endif | 1016 #endif |
899 | 1017 |
900 #if defined(BN_MP_SUBMOD_C) | 1018 #if defined(BN_MP_SUBMOD_C) |
901 #define BN_MP_INIT_C | 1019 # define BN_MP_INIT_C |
902 #define BN_MP_SUB_C | 1020 # define BN_MP_SUB_C |
903 #define BN_MP_CLEAR_C | 1021 # define BN_MP_CLEAR_C |
904 #define BN_MP_MOD_C | 1022 # define BN_MP_MOD_C |
1023 #endif | |
1024 | |
1025 #if defined(BN_MP_TC_AND_C) | |
1026 # define BN_MP_ISNEG_C | |
1027 # define BN_MP_COUNT_BITS_C | |
1028 # define BN_MP_INIT_SET_INT_C | |
1029 # define BN_MP_MUL_2D_C | |
1030 # define BN_MP_INIT_C | |
1031 # define BN_MP_ADD_C | |
1032 # define BN_MP_CLEAR_C | |
1033 # define BN_MP_AND_C | |
1034 # define BN_MP_SUB_C | |
1035 #endif | |
1036 | |
1037 #if defined(BN_MP_TC_DIV_2D_C) | |
1038 # define BN_MP_ISNEG_C | |
1039 # define BN_MP_DIV_2D_C | |
1040 # define BN_MP_ADD_D_C | |
1041 # define BN_MP_SUB_D_C | |
1042 #endif | |
1043 | |
1044 #if defined(BN_MP_TC_OR_C) | |
1045 # define BN_MP_ISNEG_C | |
1046 # define BN_MP_COUNT_BITS_C | |
1047 # define BN_MP_INIT_SET_INT_C | |
1048 # define BN_MP_MUL_2D_C | |
1049 # define BN_MP_INIT_C | |
1050 # define BN_MP_ADD_C | |
1051 # define BN_MP_CLEAR_C | |
1052 # define BN_MP_OR_C | |
1053 # define BN_MP_SUB_C | |
1054 #endif | |
1055 | |
1056 #if defined(BN_MP_TC_XOR_C) | |
1057 # define BN_MP_ISNEG_C | |
1058 # define BN_MP_COUNT_BITS_C | |
1059 # define BN_MP_INIT_SET_INT_C | |
1060 # define BN_MP_MUL_2D_C | |
1061 # define BN_MP_INIT_C | |
1062 # define BN_MP_ADD_C | |
1063 # define BN_MP_CLEAR_C | |
1064 # define BN_MP_XOR_C | |
1065 # define BN_MP_SUB_C | |
905 #endif | 1066 #endif |
906 | 1067 |
907 #if defined(BN_MP_TO_SIGNED_BIN_C) | 1068 #if defined(BN_MP_TO_SIGNED_BIN_C) |
908 #define BN_MP_TO_UNSIGNED_BIN_C | 1069 # define BN_MP_TO_UNSIGNED_BIN_C |
909 #endif | 1070 #endif |
910 | 1071 |
911 #if defined(BN_MP_TO_SIGNED_BIN_N_C) | 1072 #if defined(BN_MP_TO_SIGNED_BIN_N_C) |
912 #define BN_MP_SIGNED_BIN_SIZE_C | 1073 # define BN_MP_SIGNED_BIN_SIZE_C |
913 #define BN_MP_TO_SIGNED_BIN_C | 1074 # define BN_MP_TO_SIGNED_BIN_C |
914 #endif | 1075 #endif |
915 | 1076 |
916 #if defined(BN_MP_TO_UNSIGNED_BIN_C) | 1077 #if defined(BN_MP_TO_UNSIGNED_BIN_C) |
917 #define BN_MP_INIT_COPY_C | 1078 # define BN_MP_INIT_COPY_C |
918 #define BN_MP_ISZERO_C | 1079 # define BN_MP_ISZERO_C |
919 #define BN_MP_DIV_2D_C | 1080 # define BN_MP_DIV_2D_C |
920 #define BN_MP_CLEAR_C | 1081 # define BN_MP_CLEAR_C |
921 #endif | 1082 #endif |
922 | 1083 |
923 #if defined(BN_MP_TO_UNSIGNED_BIN_N_C) | 1084 #if defined(BN_MP_TO_UNSIGNED_BIN_N_C) |
924 #define BN_MP_UNSIGNED_BIN_SIZE_C | 1085 # define BN_MP_UNSIGNED_BIN_SIZE_C |
925 #define BN_MP_TO_UNSIGNED_BIN_C | 1086 # define BN_MP_TO_UNSIGNED_BIN_C |
926 #endif | 1087 #endif |
927 | 1088 |
928 #if defined(BN_MP_TOOM_MUL_C) | 1089 #if defined(BN_MP_TOOM_MUL_C) |
929 #define BN_MP_INIT_MULTI_C | 1090 # define BN_MP_INIT_MULTI_C |
930 #define BN_MP_MOD_2D_C | 1091 # define BN_MP_MOD_2D_C |
931 #define BN_MP_COPY_C | 1092 # define BN_MP_COPY_C |
932 #define BN_MP_RSHD_C | 1093 # define BN_MP_RSHD_C |
933 #define BN_MP_MUL_C | 1094 # define BN_MP_MUL_C |
934 #define BN_MP_MUL_2_C | 1095 # define BN_MP_MUL_2_C |
935 #define BN_MP_ADD_C | 1096 # define BN_MP_ADD_C |
936 #define BN_MP_SUB_C | 1097 # define BN_MP_SUB_C |
937 #define BN_MP_DIV_2_C | 1098 # define BN_MP_DIV_2_C |
938 #define BN_MP_MUL_2D_C | 1099 # define BN_MP_MUL_2D_C |
939 #define BN_MP_MUL_D_C | 1100 # define BN_MP_MUL_D_C |
940 #define BN_MP_DIV_3_C | 1101 # define BN_MP_DIV_3_C |
941 #define BN_MP_LSHD_C | 1102 # define BN_MP_LSHD_C |
942 #define BN_MP_CLEAR_MULTI_C | 1103 # define BN_MP_CLEAR_MULTI_C |
943 #endif | 1104 #endif |
944 | 1105 |
945 #if defined(BN_MP_TOOM_SQR_C) | 1106 #if defined(BN_MP_TOOM_SQR_C) |
946 #define BN_MP_INIT_MULTI_C | 1107 # define BN_MP_INIT_MULTI_C |
947 #define BN_MP_MOD_2D_C | 1108 # define BN_MP_MOD_2D_C |
948 #define BN_MP_COPY_C | 1109 # define BN_MP_COPY_C |
949 #define BN_MP_RSHD_C | 1110 # define BN_MP_RSHD_C |
950 #define BN_MP_SQR_C | 1111 # define BN_MP_SQR_C |
951 #define BN_MP_MUL_2_C | 1112 # define BN_MP_MUL_2_C |
952 #define BN_MP_ADD_C | 1113 # define BN_MP_ADD_C |
953 #define BN_MP_SUB_C | 1114 # define BN_MP_SUB_C |
954 #define BN_MP_DIV_2_C | 1115 # define BN_MP_DIV_2_C |
955 #define BN_MP_MUL_2D_C | 1116 # define BN_MP_MUL_2D_C |
956 #define BN_MP_MUL_D_C | 1117 # define BN_MP_MUL_D_C |
957 #define BN_MP_DIV_3_C | 1118 # define BN_MP_DIV_3_C |
958 #define BN_MP_LSHD_C | 1119 # define BN_MP_LSHD_C |
959 #define BN_MP_CLEAR_MULTI_C | 1120 # define BN_MP_CLEAR_MULTI_C |
960 #endif | 1121 #endif |
961 | 1122 |
962 #if defined(BN_MP_TORADIX_C) | 1123 #if defined(BN_MP_TORADIX_C) |
963 #define BN_MP_ISZERO_C | 1124 # define BN_MP_ISZERO_C |
964 #define BN_MP_INIT_COPY_C | 1125 # define BN_MP_INIT_COPY_C |
965 #define BN_MP_DIV_D_C | 1126 # define BN_MP_DIV_D_C |
966 #define BN_MP_CLEAR_C | 1127 # define BN_MP_CLEAR_C |
967 #define BN_MP_S_RMAP_C | 1128 # define BN_MP_S_RMAP_C |
968 #endif | 1129 #endif |
969 | 1130 |
970 #if defined(BN_MP_TORADIX_N_C) | 1131 #if defined(BN_MP_TORADIX_N_C) |
971 #define BN_MP_ISZERO_C | 1132 # define BN_MP_ISZERO_C |
972 #define BN_MP_INIT_COPY_C | 1133 # define BN_MP_INIT_COPY_C |
973 #define BN_MP_DIV_D_C | 1134 # define BN_MP_DIV_D_C |
974 #define BN_MP_CLEAR_C | 1135 # define BN_MP_CLEAR_C |
975 #define BN_MP_S_RMAP_C | 1136 # define BN_MP_S_RMAP_C |
976 #endif | 1137 #endif |
977 | 1138 |
978 #if defined(BN_MP_UNSIGNED_BIN_SIZE_C) | 1139 #if defined(BN_MP_UNSIGNED_BIN_SIZE_C) |
979 #define BN_MP_COUNT_BITS_C | 1140 # define BN_MP_COUNT_BITS_C |
980 #endif | 1141 #endif |
981 | 1142 |
982 #if defined(BN_MP_XOR_C) | 1143 #if defined(BN_MP_XOR_C) |
983 #define BN_MP_INIT_COPY_C | 1144 # define BN_MP_INIT_COPY_C |
984 #define BN_MP_CLAMP_C | 1145 # define BN_MP_CLAMP_C |
985 #define BN_MP_EXCH_C | 1146 # define BN_MP_EXCH_C |
986 #define BN_MP_CLEAR_C | 1147 # define BN_MP_CLEAR_C |
987 #endif | 1148 #endif |
988 | 1149 |
989 #if defined(BN_MP_ZERO_C) | 1150 #if defined(BN_MP_ZERO_C) |
990 #endif | 1151 #endif |
991 | 1152 |
994 | 1155 |
995 #if defined(BN_REVERSE_C) | 1156 #if defined(BN_REVERSE_C) |
996 #endif | 1157 #endif |
997 | 1158 |
998 #if defined(BN_S_MP_ADD_C) | 1159 #if defined(BN_S_MP_ADD_C) |
999 #define BN_MP_GROW_C | 1160 # define BN_MP_GROW_C |
1000 #define BN_MP_CLAMP_C | 1161 # define BN_MP_CLAMP_C |
1001 #endif | 1162 #endif |
1002 | 1163 |
1003 #if defined(BN_S_MP_EXPTMOD_C) | 1164 #if defined(BN_S_MP_EXPTMOD_C) |
1004 #define BN_MP_COUNT_BITS_C | 1165 # define BN_MP_COUNT_BITS_C |
1005 #define BN_MP_INIT_C | 1166 # define BN_MP_INIT_C |
1006 #define BN_MP_CLEAR_C | 1167 # define BN_MP_CLEAR_C |
1007 #define BN_MP_REDUCE_SETUP_C | 1168 # define BN_MP_REDUCE_SETUP_C |
1008 #define BN_MP_REDUCE_C | 1169 # define BN_MP_REDUCE_C |
1009 #define BN_MP_REDUCE_2K_SETUP_L_C | 1170 # define BN_MP_REDUCE_2K_SETUP_L_C |
1010 #define BN_MP_REDUCE_2K_L_C | 1171 # define BN_MP_REDUCE_2K_L_C |
1011 #define BN_MP_MOD_C | 1172 # define BN_MP_MOD_C |
1012 #define BN_MP_COPY_C | 1173 # define BN_MP_COPY_C |
1013 #define BN_MP_SQR_C | 1174 # define BN_MP_SQR_C |
1014 #define BN_MP_MUL_C | 1175 # define BN_MP_MUL_C |
1015 #define BN_MP_SET_C | 1176 # define BN_MP_SET_C |
1016 #define BN_MP_EXCH_C | 1177 # define BN_MP_EXCH_C |
1017 #endif | 1178 #endif |
1018 | 1179 |
1019 #if defined(BN_S_MP_MUL_DIGS_C) | 1180 #if defined(BN_S_MP_MUL_DIGS_C) |
1020 #define BN_FAST_S_MP_MUL_DIGS_C | 1181 # define BN_FAST_S_MP_MUL_DIGS_C |
1021 #define BN_MP_INIT_SIZE_C | 1182 # define BN_MP_INIT_SIZE_C |
1022 #define BN_MP_CLAMP_C | 1183 # define BN_MP_CLAMP_C |
1023 #define BN_MP_EXCH_C | 1184 # define BN_MP_EXCH_C |
1024 #define BN_MP_CLEAR_C | 1185 # define BN_MP_CLEAR_C |
1025 #endif | 1186 #endif |
1026 | 1187 |
1027 #if defined(BN_S_MP_MUL_HIGH_DIGS_C) | 1188 #if defined(BN_S_MP_MUL_HIGH_DIGS_C) |
1028 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C | 1189 # define BN_FAST_S_MP_MUL_HIGH_DIGS_C |
1029 #define BN_MP_INIT_SIZE_C | 1190 # define BN_MP_INIT_SIZE_C |
1030 #define BN_MP_CLAMP_C | 1191 # define BN_MP_CLAMP_C |
1031 #define BN_MP_EXCH_C | 1192 # define BN_MP_EXCH_C |
1032 #define BN_MP_CLEAR_C | 1193 # define BN_MP_CLEAR_C |
1033 #endif | 1194 #endif |
1034 | 1195 |
1035 #if defined(BN_S_MP_SQR_C) | 1196 #if defined(BN_S_MP_SQR_C) |
1036 #define BN_MP_INIT_SIZE_C | 1197 # define BN_MP_INIT_SIZE_C |
1037 #define BN_MP_CLAMP_C | 1198 # define BN_MP_CLAMP_C |
1038 #define BN_MP_EXCH_C | 1199 # define BN_MP_EXCH_C |
1039 #define BN_MP_CLEAR_C | 1200 # define BN_MP_CLEAR_C |
1040 #endif | 1201 #endif |
1041 | 1202 |
1042 #if defined(BN_S_MP_SUB_C) | 1203 #if defined(BN_S_MP_SUB_C) |
1043 #define BN_MP_GROW_C | 1204 # define BN_MP_GROW_C |
1044 #define BN_MP_CLAMP_C | 1205 # define BN_MP_CLAMP_C |
1045 #endif | 1206 #endif |
1046 | 1207 |
1047 #if defined(BNCORE_C) | 1208 #if defined(BNCORE_C) |
1048 #endif | 1209 #endif |
1049 | 1210 |
1050 #ifdef LTM3 | 1211 #ifdef LTM3 |
1051 #define LTM_LAST | 1212 # define LTM_LAST |
1052 #endif | 1213 #endif |
1214 | |
1053 #include "tommath_superclass.h" | 1215 #include "tommath_superclass.h" |
1054 #include "tommath_class.h" | 1216 #include "tommath_class.h" |
1055 #else | 1217 #else |
1056 #define LTM_LAST | 1218 # define LTM_LAST |
1057 #endif | 1219 #endif |
1058 | 1220 |
1059 /* Dropbear doesn't need these. */ | 1221 /* Dropbear doesn't need these. */ |
1060 #undef BN_MP_KARATSUBA_MUL_C | 1222 #undef BN_MP_KARATSUBA_MUL_C |
1061 #undef BN_MP_KARATSUBA_SQR_C | 1223 #undef BN_MP_KARATSUBA_SQR_C |
1066 #define XMALLOC m_malloc | 1228 #define XMALLOC m_malloc |
1067 #define XFREE m_free_direct | 1229 #define XFREE m_free_direct |
1068 #define XREALLOC m_realloc | 1230 #define XREALLOC m_realloc |
1069 #define XCALLOC m_calloc | 1231 #define XCALLOC m_calloc |
1070 | 1232 |
1071 /* $Source$ */ | 1233 /* ref: HEAD -> master, tag: v1.1.0 */ |
1072 /* $Revision$ */ | 1234 /* git commit: 08549ad6bc8b0cede0b357a9c341c5c6473a9c55 */ |
1073 /* $Date$ */ | 1235 /* commit time: 2019-01-28 20:32:32 +0100 */ |