diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f2f6ba0..338f212a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,6 +338,7 @@ add_custom_command( add_library(crypto_test_data OBJECT crypto_test_data.cc) add_subdirectory(crypto) +add_subdirectory(third_party/fiat) add_subdirectory(ssl) add_subdirectory(ssl/test) add_subdirectory(fipstools) diff --git a/LICENSE b/LICENSE index a25996f7..9eb5bb49 100644 --- a/LICENSE +++ b/LICENSE @@ -6,7 +6,8 @@ Contributors to BoringSSL are required to follow the CLA rules for Chromium: https://cla.developers.google.com/clas Some files from Intel are under yet another license, which is also included -underneath. +underneath. Files in third_party/ have their own licenses, as described +therein. The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the OpenSSL License and the original SSLeay license apply to the toolkit. See below diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index ae5d0b63..640f2069 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -179,6 +179,7 @@ add_library( $ $ $ + $ $ $ $ diff --git a/crypto/curve25519/CMakeLists.txt b/crypto/curve25519/CMakeLists.txt index c6004d3b..6f51d54f 100644 --- a/crypto/curve25519/CMakeLists.txt +++ b/crypto/curve25519/CMakeLists.txt @@ -21,7 +21,6 @@ add_library( OBJECT - curve25519.c spake25519.c x25519-x86_64.c diff --git a/crypto/curve25519/spake25519.c b/crypto/curve25519/spake25519.c index 9b8d43c3..e0ff9bae 100644 --- a/crypto/curve25519/spake25519.c +++ b/crypto/curve25519/spake25519.c @@ -22,8 +22,8 @@ #include #include -#include "internal.h" #include "../internal.h" +#include "../../third_party/fiat/internal.h" // The following precomputation tables are for the following diff --git a/crypto/curve25519/spake25519_test.cc b/crypto/curve25519/spake25519_test.cc index 3ebd0a96..71c97713 100644 --- a/crypto/curve25519/spake25519_test.cc +++ b/crypto/curve25519/spake25519_test.cc @@ -23,7 +23,7 @@ #include #include "../internal.h" -#include "internal.h" +#include "../../third_party/fiat/internal.h" // TODO(agl): add tests with fixed vectors once SPAKE2 is nailed down. diff --git a/crypto/curve25519/x25519-x86_64.c b/crypto/curve25519/x25519-x86_64.c index d677b52e..41db0bdd 100644 --- a/crypto/curve25519/x25519-x86_64.c +++ b/crypto/curve25519/x25519-x86_64.c @@ -24,7 +24,7 @@ #include #include "../internal.h" -#include "internal.h" +#include "../../third_party/fiat/internal.h" #if defined(BORINGSSL_X25519_X86_64) diff --git a/third_party/fiat/CMakeLists.txt b/third_party/fiat/CMakeLists.txt new file mode 100644 index 00000000..fcc77d52 --- /dev/null +++ b/third_party/fiat/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories(../../include) + +add_library( + fiat + + OBJECT + + curve25519.c +) diff --git a/crypto/curve25519/curve25519.c b/third_party/fiat/curve25519.c similarity index 99% rename from crypto/curve25519/curve25519.c rename to third_party/fiat/curve25519.c index 1496134a..b1354817 100644 --- a/crypto/curve25519/curve25519.c +++ b/third_party/fiat/curve25519.c @@ -30,7 +30,7 @@ #include #include "internal.h" -#include "../internal.h" +#include "../../crypto/internal.h" static const int64_t kBottom25Bits = INT64_C(0x1ffffff); diff --git a/crypto/curve25519/internal.h b/third_party/fiat/internal.h similarity index 100% rename from crypto/curve25519/internal.h rename to third_party/fiat/internal.h diff --git a/util/generate_build_files.py b/util/generate_build_files.py index 738484d4..4b4a8991 100644 --- a/util/generate_build_files.py +++ b/util/generate_build_files.py @@ -587,7 +587,8 @@ def ExtractVariablesFromCMakeFile(cmakefile): def main(platforms): cmake = ExtractVariablesFromCMakeFile(os.path.join('src', 'sources.cmake')) - crypto_c_files = FindCFiles(os.path.join('src', 'crypto'), NoTestsNorFIPSFragments) + crypto_c_files = (FindCFiles(os.path.join('src', 'crypto'), NoTestsNorFIPSFragments) + + FindCFiles(os.path.join('src', 'third_party', 'fiat'), NoTestsNorFIPSFragments)) fips_fragments = FindCFiles(os.path.join('src', 'crypto', 'fipsmodule'), OnlyFIPSFragments) ssl_source_files = FindCFiles(os.path.join('src', 'ssl'), NoTests) tool_c_files = FindCFiles(os.path.join('src', 'tool'), NoTests) @@ -638,8 +639,9 @@ def main(platforms): NotSSLHeaderFiles)) ssl_internal_h_files = FindHeaderFiles(os.path.join('src', 'ssl'), NoTests) - crypto_internal_h_files = FindHeaderFiles( - os.path.join('src', 'crypto'), NoTests) + crypto_internal_h_files = ( + FindHeaderFiles(os.path.join('src', 'crypto'), NoTests) + + FindHeaderFiles(os.path.join('src', 'third_party', 'fiat'), NoTests)) files = { 'crypto': crypto_c_files,