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