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 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 StopTimer(&ct); | 117 StopTimer(&ct); |
118 msecs = (float) GetDurationMsecs(&ct) / NUM_OPERATIONS; | 118 msecs = (float) GetDurationMsecs(&ct) / NUM_OPERATIONS; |
119 fprintf(stderr, | 119 fprintf(stderr, |
120 "# Kernel (%s, Algo = %s / %s):" | 120 "# Kernel (%s, Algo = %s / %s):" |
121 "\t%.02f ms/verification\n", | 121 "\t%.02f ms/verification\n", |
122 g_kernel_size_labels[i], | 122 g_kernel_size_labels[i], |
123 algo_strings[firmware_sign_algorithm], | 123 algo_strings[firmware_sign_algorithm], |
124 algo_strings[kernel_sign_algorithm], | 124 algo_strings[kernel_sign_algorithm], |
125 msecs); | 125 msecs); |
126 fprintf(stdout, "ms_firmware_%s_rsa%d_%s_rsa%d_%s:%.02f\n", | 126 fprintf(stdout, "ms_kernel_%s_rsa%d_%s_rsa%d_%s:%.02f\n", |
127 g_kernel_size_labels[i], | 127 g_kernel_size_labels[i], |
128 firmware_key_size, | 128 firmware_key_size, |
129 sha_strings[firmware_sign_algorithm], | 129 sha_strings[firmware_sign_algorithm], |
130 kernel_key_size, | 130 kernel_key_size, |
131 sha_strings[kernel_sign_algorithm], | 131 sha_strings[kernel_sign_algorithm], |
132 msecs); | 132 msecs); |
133 } | 133 } |
134 | 134 |
135 cleanup: | 135 cleanup: |
136 for (i = 0; i < NUM_SIZES_TO_TEST; ++i) | 136 for (i = 0; i < NUM_SIZES_TO_TEST; ++i) |
(...skipping 13 matching lines...) Expand all Loading... |
150 if (siglen_map[j] > siglen_map[i]) | 150 if (siglen_map[j] > siglen_map[i]) |
151 continue; | 151 continue; |
152 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]) |
153 continue; | 153 continue; |
154 if (0 != (error_code = SpeedTestAlgorithm(i, j))) | 154 if (0 != (error_code = SpeedTestAlgorithm(i, j))) |
155 return error_code; | 155 return error_code; |
156 } | 156 } |
157 } | 157 } |
158 return 0; | 158 return 0; |
159 } | 159 } |
OLD | NEW |