|
1 |
| -/* $OpenBSD: bn_mod_exp.c,v 1.6 2022/12/03 08:05:52 tb Exp $ */ |
| 1 | +/* $OpenBSD: bn_mod_exp.c,v 1.7 2022/12/03 08:21:38 tb Exp $ */ |
2 | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
@@ -157,18 +157,20 @@ main(int argc, char *argv[])
|
157 | 157 | }
|
158 | 158 |
|
159 | 159 | if (BN_cmp(r_simple, r_mont) != 0 ||
|
| 160 | + BN_cmp(r_simple, r_mont_const) || |
160 | 161 | BN_cmp(r_simple, r_recp) != 0 ||
|
161 |
| - BN_cmp(r_simple, r_mont_const) != 0) { |
| 162 | + BN_cmp(r_simple, r_mont_ct) != 0 || |
| 163 | + BN_cmp(r_simple, r_mont_nonct) != 0) { |
162 | 164 | if (BN_cmp(r_simple, r_mont) != 0)
|
163 | 165 | printf("\nsimple and mont results differ\n");
|
164 | 166 | if (BN_cmp(r_simple, r_mont_const) != 0)
|
165 | 167 | printf("\nsimple and mont const time results differ\n");
|
166 | 168 | if (BN_cmp(r_simple, r_recp) != 0)
|
167 | 169 | printf("\nsimple and recp results differ\n");
|
168 |
| - if (BN_cmp(r_mont, r_mont_ct) != 0) |
169 |
| - printf("\nmont_ct and mont results differ\n"); |
170 |
| - if (BN_cmp(r_mont_ct, r_mont_nonct) != 0) |
171 |
| - printf("\nmont_ct and mont_nonct results differ\n"); |
| 170 | + if (BN_cmp(r_simple, r_mont_ct) != 0) |
| 171 | + printf("\nsimple and mont results differ\n"); |
| 172 | + if (BN_cmp(r_simple, r_mont_nonct) != 0) |
| 173 | + printf("\nsimple and mont_nonct results differ\n"); |
172 | 174 |
|
173 | 175 | printf("a (%3d) = ", BN_num_bits(a));
|
174 | 176 | BN_print_fp(stdout, a);
|
|
0 commit comments