| 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 "kernel_image.h" | 13 #include "kernel_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 | 19 |
| 21 #define NUM_OPERATIONS 30 /* Number of verify operations to time. | 20 #define NUM_OPERATIONS 30 /* Number of verify operations to time. |
| 22 * We use a smaller number here (30 vs. 100) | 21 * We use a smaller number here (30 vs. 100) |
| 23 * since there are many more cases to consider | 22 * since there are many more cases to consider |
| 24 * (one for each combination of firmware and kernel | 23 * (one for each combination of firmware and kernel |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (siglen_map[j] > siglen_map[i]) | 149 if (siglen_map[j] > siglen_map[i]) |
| 151 continue; | 150 continue; |
| 152 if (siglen_map[j] == siglen_map[i] && hash_size_map[j] > hash_size_map[i]) | 151 if (siglen_map[j] == siglen_map[i] && hash_size_map[j] > hash_size_map[i]) |
| 153 continue; | 152 continue; |
| 154 if (0 != (error_code = SpeedTestAlgorithm(i, j))) | 153 if (0 != (error_code = SpeedTestAlgorithm(i, j))) |
| 155 return error_code; | 154 return error_code; |
| 156 } | 155 } |
| 157 } | 156 } |
| 158 return 0; | 157 return 0; |
| 159 } | 158 } |
| OLD | NEW |