diff --git a/cgpt/cgpt_wrapper.c b/cgpt/cgpt_wrapper.c index f8dc2f4f50..e7ac6bf3c2 100644 --- a/cgpt/cgpt_wrapper.c +++ b/cgpt/cgpt_wrapper.c @@ -28,7 +28,6 @@ #include "2sha.h" #include "cgpt.h" #include "cgpt_nor.h" -#include "cryptolib.h" #include "file_keys.h" // Check if cmdline |argv| has "-D". "-D" signifies that GPT structs are stored diff --git a/firmware/lib/cryptolib/README b/firmware/lib/cryptolib/README deleted file mode 100644 index e576bb7bc4..0000000000 --- a/firmware/lib/cryptolib/README +++ /dev/null @@ -1,3 +0,0 @@ -This contains the implementation for the crypto library. This includes -implementations for SHA1, SHA256, SHA512, and RSA signature verification -(for PKCS #1 v1.5 signatures). diff --git a/firmware/lib/cryptolib/include/cryptolib.h b/firmware/lib/cryptolib/include/cryptolib.h deleted file mode 100644 index 7cdfdea0cf..0000000000 --- a/firmware/lib/cryptolib/include/cryptolib.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * Firmware Cryptolib includes. - */ - -#ifndef VBOOT_REFERENCE_CRYPTOLIB_H_ -#define VBOOT_REFERENCE_CRYPTOLIB_H_ - -#include "rsa.h" - -#endif /* VBOOT_REFERENCE_CRYPTOLIB_H_ */ diff --git a/firmware/lib/cryptolib/include/rsa.h b/firmware/lib/cryptolib/include/rsa.h deleted file mode 100644 index 8ea7f889e7..0000000000 --- a/firmware/lib/cryptolib/include/rsa.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef VBOOT_REFERENCE_RSA_H_ -#define VBOOT_REFERENCE_RSA_H_ - -#ifndef VBOOT_REFERENCE_CRYPTOLIB_H_ -#error "Do not include this file directly. Use cryptolib.h instead." -#endif - -#include "sysincludes.h" - -#define RSA1024NUMBYTES 128 /* 1024 bit key length */ -#define RSA2048NUMBYTES 256 /* 2048 bit key length */ -#define RSA4096NUMBYTES 512 /* 4096 bit key length */ -#define RSA8192NUMBYTES 1024 /* 8192 bit key length */ - -#endif /* VBOOT_REFERENCE_RSA_H_ */ diff --git a/firmware/lib/include/vboot_common.h b/firmware/lib/include/vboot_common.h index 762448bb00..88bcb63199 100644 --- a/firmware/lib/include/vboot_common.h +++ b/firmware/lib/include/vboot_common.h @@ -8,7 +8,6 @@ #ifndef VBOOT_REFERENCE_VBOOT_COMMON_H_ #define VBOOT_REFERENCE_VBOOT_COMMON_H_ -#include "cryptolib.h" #include "vboot_struct.h" #ifndef ARRAY_SIZE diff --git a/futility/cmd_vbutil_firmware.c b/futility/cmd_vbutil_firmware.c index 242dfc21eb..3bf3492b08 100644 --- a/futility/cmd_vbutil_firmware.c +++ b/futility/cmd_vbutil_firmware.c @@ -16,7 +16,6 @@ #include "2api.h" #include "2common.h" #include "2rsa.h" -#include "cryptolib.h" #include "futility.h" #include "host_common.h" #include "host_key2.h" diff --git a/futility/cmd_vbutil_key.c b/futility/cmd_vbutil_key.c index 15aa9edc0e..27e601ed8b 100644 --- a/futility/cmd_vbutil_key.c +++ b/futility/cmd_vbutil_key.c @@ -12,8 +12,6 @@ #include #include - -#include "cryptolib.h" #include "futility.h" #include "host_common.h" #include "host_key2.h" diff --git a/futility/cmd_vbutil_keyblock.c b/futility/cmd_vbutil_keyblock.c index 18cf63aba7..bb8d62ac1c 100644 --- a/futility/cmd_vbutil_keyblock.c +++ b/futility/cmd_vbutil_keyblock.c @@ -14,7 +14,6 @@ #include "2sysincludes.h" #include "2common.h" #include "2rsa.h" -#include "cryptolib.h" #include "futility.h" #include "host_common.h" #include "host_key2.h" diff --git a/futility/ryu_root_header.c b/futility/ryu_root_header.c index 0797d7bcd9..1865b75c44 100644 --- a/futility/ryu_root_header.c +++ b/futility/ryu_root_header.c @@ -18,7 +18,6 @@ #include "2sysincludes.h" #include "2common.h" #include "2sha.h" -#include "cryptolib.h" #include "futility.h" #include "gbb_header.h" diff --git a/host/lib/file_keys.c b/host/lib/file_keys.c index 24c794f171..0aba6b8684 100644 --- a/host/lib/file_keys.c +++ b/host/lib/file_keys.c @@ -17,7 +17,6 @@ #include "2common.h" #include "2sha.h" -#include "cryptolib.h" #include "file_keys.h" #include "host_common.h" #include "signature_digest.h" diff --git a/host/lib/host_common.c b/host/lib/host_common.c index a741fd9608..c3ba044e8b 100644 --- a/host/lib/host_common.c +++ b/host/lib/host_common.c @@ -12,7 +12,6 @@ #include "2rsa.h" #include "host_common.h" #include "host_key2.h" -#include "cryptolib.h" #include "utility.h" #include "vb2_common.h" #include "vboot_common.h" diff --git a/host/lib/host_key.c b/host/lib/host_key.c index c0a0fdd6a0..10efc7666c 100644 --- a/host/lib/host_key.c +++ b/host/lib/host_key.c @@ -17,9 +17,7 @@ #include "2common.h" #include "2rsa.h" #include "2sha.h" -#include "cryptolib.h" #include "host_common.h" -#include "host_key.h" #include "host_misc.h" #include "vb2_common.h" #include "vboot_common.h" diff --git a/host/lib/host_key2.c b/host/lib/host_key2.c index 7e505761d9..302bffeedc 100644 --- a/host/lib/host_key2.c +++ b/host/lib/host_key2.c @@ -17,7 +17,6 @@ #include "2common.h" #include "2rsa.h" #include "2sha.h" -#include "cryptolib.h" #include "host_common.h" #include "host_key.h" #include "host_key2.h" diff --git a/host/lib/host_keyblock.c b/host/lib/host_keyblock.c index dde8fe6c90..fad17df45d 100644 --- a/host/lib/host_keyblock.c +++ b/host/lib/host_keyblock.c @@ -13,7 +13,6 @@ #include "2common.h" #include "2rsa.h" #include "2sha.h" -#include "cryptolib.h" #include "host_common.h" #include "host_key.h" #include "host_key2.h" diff --git a/host/lib/host_misc.c b/host/lib/host_misc.c index 03d0566416..611253b91a 100644 --- a/host/lib/host_misc.c +++ b/host/lib/host_misc.c @@ -12,7 +12,6 @@ #include #include -#include "cryptolib.h" #include "host_common.h" #include "vboot_common.h" diff --git a/host/lib/host_signature2.c b/host/lib/host_signature2.c index 8925e6a74f..a9d0f44f55 100644 --- a/host/lib/host_signature2.c +++ b/host/lib/host_signature2.c @@ -18,7 +18,6 @@ #include "2common.h" #include "2rsa.h" #include "2sha.h" -#include "cryptolib.h" #include "file_keys.h" #include "host_common.h" #include "host_key2.h" diff --git a/host/lib/include/file_keys.h b/host/lib/include/file_keys.h index 0879c31106..b4bdd3226e 100644 --- a/host/lib/include/file_keys.h +++ b/host/lib/include/file_keys.h @@ -8,7 +8,6 @@ #ifndef VBOOT_REFERENCE_FILE_KEYS_H_ #define VBOOT_REFERENCE_FILE_KEYS_H_ -#include "cryptolib.h" #include "2sha.h" /* Calculates the appropriate digest for the data in [input_file] based on the diff --git a/host/lib/include/host_common.h b/host/lib/include/host_common.h index 8c14942e93..7a347a8f87 100644 --- a/host/lib/include/host_common.h +++ b/host/lib/include/host_common.h @@ -14,7 +14,6 @@ */ #define _STUB_IMPLEMENTATION_ -#include "cryptolib.h" #include "host_key.h" #include "host_key2.h" #include "host_keyblock.h" diff --git a/host/lib/include/host_signature.h b/host/lib/include/host_signature.h index 4fb94d6041..fce664da6a 100644 --- a/host/lib/include/host_signature.h +++ b/host/lib/include/host_signature.h @@ -8,7 +8,6 @@ #ifndef VBOOT_REFERENCE_HOST_SIGNATURE_H_ #define VBOOT_REFERENCE_HOST_SIGNATURE_H_ -#include "cryptolib.h" #include "host_key.h" #include "utility.h" #include "vboot_struct.h" diff --git a/host/lib/signature_digest.c b/host/lib/signature_digest.c index 2050d4a437..d56b05beb2 100644 --- a/host/lib/signature_digest.c +++ b/host/lib/signature_digest.c @@ -14,7 +14,6 @@ #include "2common.h" #include "2rsa.h" #include "2sha.h" -#include "cryptolib.h" #include "host_common.h" #include "host_signature2.h" #include "signature_digest.h" diff --git a/host/lib/util_misc.c b/host/lib/util_misc.c index 56d21b3833..95acecb902 100644 --- a/host/lib/util_misc.c +++ b/host/lib/util_misc.c @@ -17,7 +17,6 @@ #include "2common.h" #include "2sha.h" -#include "cryptolib.h" #include "host_common.h" #include "util_misc.h" #include "vb2_common.h" diff --git a/tests/rsa_padding_test.h b/tests/rsa_padding_test.h index ce1ab247ca..18bccd8cbf 100644 --- a/tests/rsa_padding_test.h +++ b/tests/rsa_padding_test.h @@ -12,7 +12,10 @@ #ifndef VBOOT_REFERENCE_RSA_PADDING_TEST_H_ #define VBOOT_REFERENCE_RSA_PADDING_TEST_H_ -#include "cryptolib.h" +#define RSA1024NUMBYTES 128 /* 1024 bit key length */ +#define RSA2048NUMBYTES 256 /* 2048 bit key length */ +#define RSA4096NUMBYTES 512 /* 4096 bit key length */ +#define RSA8192NUMBYTES 1024 /* 8192 bit key length */ /* The modulus of the public key (RSA-1024). */ static const uint8_t pubkey_n[] = { diff --git a/tests/sha_benchmark.c b/tests/sha_benchmark.c index 49ff829feb..fadcb6bc0f 100644 --- a/tests/sha_benchmark.c +++ b/tests/sha_benchmark.c @@ -10,8 +10,6 @@ #include "2sysincludes.h" #include "2common.h" #include "2sha.h" - -#include "cryptolib.h" #include "host_common.h" #include "timer_utils.h" diff --git a/tests/sha_tests.c b/tests/sha_tests.c index ad85b9eaca..40d3749f8c 100644 --- a/tests/sha_tests.c +++ b/tests/sha_tests.c @@ -10,7 +10,6 @@ #include #include -#include "cryptolib.h" #include "sha_test_vectors.h" int SHA1_tests(void) { diff --git a/tests/test_common.c b/tests/test_common.c index 0a76ccddda..972a3ffe9b 100644 --- a/tests/test_common.c +++ b/tests/test_common.c @@ -5,15 +5,11 @@ * Common functions used by tests. */ -#include "test_common.h" - #include #include #include -#include "cryptolib.h" -#include "file_keys.h" -#include "utility.h" +#include "test_common.h" /* Global test success flag. */ int gTestSuccess = 1; diff --git a/tests/vb20_rsa_padding_tests.c b/tests/vb20_rsa_padding_tests.c index a70da58c9f..c506572d5f 100644 --- a/tests/vb20_rsa_padding_tests.c +++ b/tests/vb20_rsa_padding_tests.c @@ -9,7 +9,6 @@ #define _STUB_IMPLEMENTATION_ -#include "cryptolib.h" #include "file_keys.h" #include "rsa_padding_test.h" #include "test_common.h" diff --git a/tests/vb2_nvstorage_tests.c b/tests/vb2_nvstorage_tests.c index 45dd7b5ea5..2056f1017e 100644 --- a/tests/vb2_nvstorage_tests.c +++ b/tests/vb2_nvstorage_tests.c @@ -10,6 +10,8 @@ #include #include +#include "2sysincludes.h" + #include "test_common.h" #include "vboot_common.h" diff --git a/tests/vb2_rsa_utility_tests.c b/tests/vb2_rsa_utility_tests.c index df603272d4..9fe1b7e12b 100644 --- a/tests/vb2_rsa_utility_tests.c +++ b/tests/vb2_rsa_utility_tests.c @@ -9,16 +9,16 @@ #define _STUB_IMPLEMENTATION_ -#include "cryptolib.h" +#include "2sysincludes.h" + +#include "2common.h" +#include "2rsa.h" #include "file_keys.h" #include "rsa_padding_test.h" #include "test_common.h" #include "utility.h" #include "vboot_api.h" -#include "2common.h" -#include "2rsa.h" - /* * Internal functions from 2rsa.c that have error conditions we can't trigger * from the public APIs. These include checks for bad algorithms where the diff --git a/tests/vb2_secdata_tests.c b/tests/vb2_secdata_tests.c index b8ffafaae1..1abfcb2e14 100644 --- a/tests/vb2_secdata_tests.c +++ b/tests/vb2_secdata_tests.c @@ -10,6 +10,8 @@ #include #include +#include "2sysincludes.h" + #include "test_common.h" #include "vboot_common.h" diff --git a/tests/vb2_secdatak_tests.c b/tests/vb2_secdatak_tests.c index 1aa059ed38..4bc15cf995 100644 --- a/tests/vb2_secdatak_tests.c +++ b/tests/vb2_secdatak_tests.c @@ -10,6 +10,8 @@ #include #include +#include "2sysincludes.h" + #include "test_common.h" #include "vboot_common.h" diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c index 994b792c10..dfb6619594 100644 --- a/tests/vboot_kernel_tests.c +++ b/tests/vboot_kernel_tests.c @@ -16,7 +16,6 @@ #include "cgptlib.h" #include "cgptlib_internal.h" #include "crc32.h" -#include "cryptolib.h" #include "gbb_header.h" #include "gpt.h" #include "host_common.h" diff --git a/utility/verify_data.c b/utility/verify_data.c index d160809bd8..74a11fc4cf 100644 --- a/utility/verify_data.c +++ b/utility/verify_data.c @@ -22,7 +22,6 @@ #include "2common.h" #include "2sha.h" #include "2rsa.h" -#include "cryptolib.h" #include "file_keys.h" #include "host_common.h" #include "vb2_common.h"