Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Side by Side Diff: src/platform/vboot_reference/tests/sha_tests.c

Issue 1593002: Revert "VBoot Reference: Refactor Part 2 - Crypto Libraries" (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5
6 /* FIPS 180-2 Tests for message digest functions. */ 6 /* FIPS 180-2 Tests for message digest functions. */
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
11 11
12 #include "cryptolib.h" 12 #include "sha.h"
13
13 #include "sha_test_vectors.h" 14 #include "sha_test_vectors.h"
14 15
15 int SHA1_tests(void) { 16 int SHA1_tests(void) {
16 int i, success = 1; 17 int i, success = 1;
17 uint8_t sha1_digest[SHA1_DIGEST_SIZE]; 18 uint8_t sha1_digest[SHA1_DIGEST_SIZE];
18 uint8_t* test_inputs[3]; 19 uint8_t* test_inputs[3];
19 test_inputs[0] = (uint8_t *) oneblock_msg; 20 test_inputs[0] = (uint8_t *) oneblock_msg;
20 test_inputs[1] = (uint8_t *) multiblock_msg1; 21 test_inputs[1] = (uint8_t *) multiblock_msg1;
21 test_inputs[2] = (uint8_t *) long_msg; 22 test_inputs[2] = (uint8_t *) long_msg;
22 23
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 success = 0; 90 success = 0;
90 if (!SHA256_tests()) 91 if (!SHA256_tests())
91 success = 0; 92 success = 0;
92 if (!SHA512_tests()) 93 if (!SHA512_tests())
93 success = 0; 94 success = 0;
94 95
95 free(long_msg); 96 free(long_msg);
96 97
97 return !success; 98 return !success;
98 } 99 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/tests/sha_benchmark.c ('k') | src/platform/vboot_reference/tests/test_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698