OLD | NEW |
1 /* crypto/bn/exptest.c */ | 1 /* crypto/bn/exptest.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 && BN_cmp(r_simple,r_recp) == 0 | 156 && BN_cmp(r_simple,r_recp) == 0 |
157 && BN_cmp(r_simple,r_mont_const) == 0) | 157 && BN_cmp(r_simple,r_mont_const) == 0) |
158 { | 158 { |
159 printf("."); | 159 printf("."); |
160 fflush(stdout); | 160 fflush(stdout); |
161 } | 161 } |
162 else | 162 else |
163 { | 163 { |
164 if (BN_cmp(r_simple,r_mont) != 0) | 164 if (BN_cmp(r_simple,r_mont) != 0) |
165 printf("\nsimple and mont results differ\n"); | 165 printf("\nsimple and mont results differ\n"); |
166 » » » if (BN_cmp(r_simple,r_mont) != 0) | 166 » » » if (BN_cmp(r_simple,r_mont_const) != 0) |
167 printf("\nsimple and mont const time results dif
fer\n"); | 167 printf("\nsimple and mont const time results dif
fer\n"); |
168 if (BN_cmp(r_simple,r_recp) != 0) | 168 if (BN_cmp(r_simple,r_recp) != 0) |
169 printf("\nsimple and recp results differ\n"); | 169 printf("\nsimple and recp results differ\n"); |
170 | 170 |
171 printf("a (%3d) = ",BN_num_bits(a)); BN_print(out,a); | 171 printf("a (%3d) = ",BN_num_bits(a)); BN_print(out,a); |
172 printf("\nb (%3d) = ",BN_num_bits(b)); BN_print(out,b); | 172 printf("\nb (%3d) = ",BN_num_bits(b)); BN_print(out,b); |
173 printf("\nm (%3d) = ",BN_num_bits(m)); BN_print(out,m); | 173 printf("\nm (%3d) = ",BN_num_bits(m)); BN_print(out,m); |
174 printf("\nsimple ="); BN_print(out,r_simple); | 174 printf("\nsimple ="); BN_print(out,r_simple); |
175 printf("\nrecp ="); BN_print(out,r_recp); | 175 printf("\nrecp ="); BN_print(out,r_recp); |
176 printf("\nmont ="); BN_print(out,r_mont); | 176 printf("\nmont ="); BN_print(out,r_mont); |
177 printf("\nmont_ct ="); BN_print(out,r_mont_const); | 177 printf("\nmont_ct ="); BN_print(out,r_mont_const); |
178 printf("\n"); | 178 printf("\n"); |
179 EXIT(1); | 179 EXIT(1); |
180 } | 180 } |
181 } | 181 } |
182 BN_free(r_mont); | 182 BN_free(r_mont); |
183 BN_free(r_mont_const); | 183 BN_free(r_mont_const); |
184 BN_free(r_recp); | 184 BN_free(r_recp); |
185 BN_free(r_simple); | 185 BN_free(r_simple); |
186 BN_free(a); | 186 BN_free(a); |
187 BN_free(b); | 187 BN_free(b); |
188 BN_free(m); | 188 BN_free(m); |
189 BN_CTX_free(ctx); | 189 BN_CTX_free(ctx); |
190 » ERR_remove_state(0); | 190 » ERR_remove_thread_state(NULL); |
191 CRYPTO_mem_leaks(out); | 191 CRYPTO_mem_leaks(out); |
192 BIO_free(out); | 192 BIO_free(out); |
193 printf(" done\n"); | 193 printf(" done\n"); |
194 EXIT(0); | 194 EXIT(0); |
195 err: | 195 err: |
196 ERR_load_crypto_strings(); | 196 ERR_load_crypto_strings(); |
197 ERR_print_errors(out); | 197 ERR_print_errors(out); |
198 #ifdef OPENSSL_SYS_NETWARE | 198 #ifdef OPENSSL_SYS_NETWARE |
199 printf("ERROR\n"); | 199 printf("ERROR\n"); |
200 #endif | 200 #endif |
201 EXIT(1); | 201 EXIT(1); |
202 return(1); | 202 return(1); |
203 } | 203 } |
204 | 204 |
OLD | NEW |