OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Timing benchmark for verifying a firmware image. | 5 * Timing benchmark for verifying a firmware image. |
6 */ | 6 */ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
11 #include "cryptolib.h" | |
12 #include "file_keys.h" | 11 #include "file_keys.h" |
13 #include "kernel_image.h" | 12 #include "kernel_image.h" |
| 13 #include "padding.h" |
| 14 #include "rsa_utility.h" |
14 #include "test_common.h" | 15 #include "test_common.h" |
15 #include "timer_utils.h" | 16 #include "timer_utils.h" |
16 #include "utility.h" | 17 #include "utility.h" |
17 | 18 |
18 #define FILE_NAME_SIZE 128 | 19 #define FILE_NAME_SIZE 128 |
19 | 20 |
20 #define NUM_OPERATIONS 30 /* Number of verify operations to time. | 21 #define NUM_OPERATIONS 30 /* Number of verify operations to time. |
21 * We use a smaller number here (30 vs. 100) | 22 * We use a smaller number here (30 vs. 100) |
22 * since there are many more cases to consider | 23 * since there are many more cases to consider |
23 * (one for each combination of firmware and kernel | 24 * (one for each combination of firmware and kernel |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (siglen_map[j] > siglen_map[i]) | 150 if (siglen_map[j] > siglen_map[i]) |
150 continue; | 151 continue; |
151 if (siglen_map[j] == siglen_map[i] && hash_size_map[j] > hash_size_map[i]) | 152 if (siglen_map[j] == siglen_map[i] && hash_size_map[j] > hash_size_map[i]) |
152 continue; | 153 continue; |
153 if (0 != (error_code = SpeedTestAlgorithm(i, j))) | 154 if (0 != (error_code = SpeedTestAlgorithm(i, j))) |
154 return error_code; | 155 return error_code; |
155 } | 156 } |
156 } | 157 } |
157 return 0; | 158 return 0; |
158 } | 159 } |
OLD | NEW |