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 "firmware_image.h" | 12 #include "firmware_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 #define NUM_OPERATIONS 100 /* Number of verify operations to time. */ | 20 #define NUM_OPERATIONS 100 /* Number of verify operations to time. */ |
20 | 21 |
21 #define FIRMWARE_SIZE_SMALL 512000 | 22 #define FIRMWARE_SIZE_SMALL 512000 |
22 #define FIRMWARE_SIZE_MEDIUM 1024000 | 23 #define FIRMWARE_SIZE_MEDIUM 1024000 |
23 #define FIRMWARE_SIZE_LARGE 4096000 | 24 #define FIRMWARE_SIZE_LARGE 4096000 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 | 123 |
123 int main(int argc, char* argv[]) { | 124 int main(int argc, char* argv[]) { |
124 int i, error_code = 0; | 125 int i, error_code = 0; |
125 for (i = 0; i < kNumAlgorithms; ++i) { | 126 for (i = 0; i < kNumAlgorithms; ++i) { |
126 if (0 != (error_code = SpeedTestAlgorithm(i))) | 127 if (0 != (error_code = SpeedTestAlgorithm(i))) |
127 return error_code; | 128 return error_code; |
128 } | 129 } |
129 return 0; | 130 return 0; |
130 } | 131 } |
OLD | NEW |