您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CMakeLists.txt 6.5 KiB

Add PPC64LE assembly for AES-GCM. This change adds AES and GHASH assembly from upstream, with the aim of speeding up AES-GCM. The PPC64LE assembly matches the interface of the ARMv8 assembly so I've changed the prefix of both sets of asm functions to be the same ("aes_hw_"). Otherwise, the new assmebly files and Perlasm match exactly those from upstream's c536b6be1a (from their master branch). Before: Did 1879000 AES-128-GCM (16 bytes) seal operations in 1000428us (1878196.1 ops/sec): 30.1 MB/s Did 61000 AES-128-GCM (1350 bytes) seal operations in 1006660us (60596.4 ops/sec): 81.8 MB/s Did 11000 AES-128-GCM (8192 bytes) seal operations in 1072649us (10255.0 ops/sec): 84.0 MB/s Did 1665000 AES-256-GCM (16 bytes) seal operations in 1000591us (1664016.6 ops/sec): 26.6 MB/s Did 52000 AES-256-GCM (1350 bytes) seal operations in 1006971us (51640.0 ops/sec): 69.7 MB/s Did 8840 AES-256-GCM (8192 bytes) seal operations in 1013294us (8724.0 ops/sec): 71.5 MB/s After: Did 4994000 AES-128-GCM (16 bytes) seal operations in 1000017us (4993915.1 ops/sec): 79.9 MB/s Did 1389000 AES-128-GCM (1350 bytes) seal operations in 1000073us (1388898.6 ops/sec): 1875.0 MB/s Did 319000 AES-128-GCM (8192 bytes) seal operations in 1000101us (318967.8 ops/sec): 2613.0 MB/s Did 4668000 AES-256-GCM (16 bytes) seal operations in 1000149us (4667304.6 ops/sec): 74.7 MB/s Did 1202000 AES-256-GCM (1350 bytes) seal operations in 1000646us (1201224.0 ops/sec): 1621.7 MB/s Did 269000 AES-256-GCM (8192 bytes) seal operations in 1002804us (268247.8 ops/sec): 2197.5 MB/s Change-Id: Id848562bd4e1aa79a4683012501dfa5e6c08cfcc Reviewed-on: https://boringssl-review.googlesource.com/11262 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
8 年前
Rewrite ARM feature detection. This removes the thread-unsafe SIGILL-based detection and the multi-consumer-hostile CRYPTO_set_NEON_capable API. (Changing OPENSSL_armcap_P after initialization is likely to cause problems.) The right way to detect ARM features on Linux is getauxval. On aarch64, we should be able to rely on this, so use it straight. Split this out into its own file. The #ifdefs in the old cpu-arm.c meant it shared all but no code with its arm counterpart anyway. Unfortunately, various versions of Android have different missing APIs, so, on arm, we need a series of workarounds. Previously, we used a SIGILL fallback based on OpenSSL's logic, but this is inherently not thread-safe. (SIGILL also does not tell us if the OS knows how to save and restore NEON state.) Instead, base the behavior on Android NDK's cpu-features library, what Chromium currently uses with CRYPTO_set_NEON_capable: - Android before API level 20 does not provide getauxval. Where missing, we can read from /proc/self/auxv. - On some versions of Android, /proc/self/auxv is also not readable, so use /proc/cpuinfo's Features line. - Linux only advertises optional features in /proc/cpuinfo. ARMv8 makes NEON mandatory, so /proc/cpuinfo can't be used without additional effort. Finally, we must blacklist a particular chip because the NEON unit is broken (https://crbug.com/341598). Unfortunately, this means CRYPTO_library_init now depends on /proc being available, which will require some care with Chromium's sandbox. The simplest solution is to just call CRYPTO_library_init before entering the sandbox. It's worth noting that Chromium's current EnsureOpenSSLInit function already depends on /proc/cpuinfo to detect the broken CPU, by way of base::CPU. android_getCpuFeatures also interally depends on it. We were already relying on both of those being stateful and primed prior to entering the sandbox. BUG=chromium:589200 Change-Id: Ic5d1c341aab5a614eb129d8aa5ada2809edd6af8 Reviewed-on: https://boringssl-review.googlesource.com/7506 Reviewed-by: David Benjamin <davidben@google.com>
8 年前
Add PPC64LE assembly for AES-GCM. This change adds AES and GHASH assembly from upstream, with the aim of speeding up AES-GCM. The PPC64LE assembly matches the interface of the ARMv8 assembly so I've changed the prefix of both sets of asm functions to be the same ("aes_hw_"). Otherwise, the new assmebly files and Perlasm match exactly those from upstream's c536b6be1a (from their master branch). Before: Did 1879000 AES-128-GCM (16 bytes) seal operations in 1000428us (1878196.1 ops/sec): 30.1 MB/s Did 61000 AES-128-GCM (1350 bytes) seal operations in 1006660us (60596.4 ops/sec): 81.8 MB/s Did 11000 AES-128-GCM (8192 bytes) seal operations in 1072649us (10255.0 ops/sec): 84.0 MB/s Did 1665000 AES-256-GCM (16 bytes) seal operations in 1000591us (1664016.6 ops/sec): 26.6 MB/s Did 52000 AES-256-GCM (1350 bytes) seal operations in 1006971us (51640.0 ops/sec): 69.7 MB/s Did 8840 AES-256-GCM (8192 bytes) seal operations in 1013294us (8724.0 ops/sec): 71.5 MB/s After: Did 4994000 AES-128-GCM (16 bytes) seal operations in 1000017us (4993915.1 ops/sec): 79.9 MB/s Did 1389000 AES-128-GCM (1350 bytes) seal operations in 1000073us (1388898.6 ops/sec): 1875.0 MB/s Did 319000 AES-128-GCM (8192 bytes) seal operations in 1000101us (318967.8 ops/sec): 2613.0 MB/s Did 4668000 AES-256-GCM (16 bytes) seal operations in 1000149us (4667304.6 ops/sec): 74.7 MB/s Did 1202000 AES-256-GCM (1350 bytes) seal operations in 1000646us (1201224.0 ops/sec): 1621.7 MB/s Did 269000 AES-256-GCM (8192 bytes) seal operations in 1002804us (268247.8 ops/sec): 2197.5 MB/s Change-Id: Id848562bd4e1aa79a4683012501dfa5e6c08cfcc Reviewed-on: https://boringssl-review.googlesource.com/11262 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
8 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
Do a cursory conversion of a few tests to GTest. For now, this is the laziest conversion possible. The intent is to just get the build setup ready so that we can get everything working in our consumers. The intended end state is: - The standalone build produces three test targets, one per library: {crypto,ssl,decrepit}_tests. - Each FOO_test is made up of: FOO/**/*_test.cc crypto/test/gtest_main.cc test_support - generate_build_files.py emits variables crypto_test_sources and ssl_test_sources. These variables are populated with FindCFiles, looking for *_test.cc. - The consuming file assembles those variables into the two test targets (plus decrepit) from there. This avoids having generate_build_files.py emit actual build rules. - Our standalone builders, Chromium, and Android just run the top-level test targets using whatever GTest-based reporting story they have. In transition, we start by converting one of two tests in each library to populate the three test targets. Those are added to all_tests.json and all_tests.go hacked to handle them transparently. This keeps our standalone builder working. generate_build_files.py, to start with, populates the new source lists manually and subtracts them out of the old machinery. We emit both for the time being. When this change rolls in, we'll write all the build glue needed to build the GTest-based tests and add it to consumers' continuous builders. Next, we'll subsume a file-based test and get the consumers working with that. (I.e. make sure the GTest targets can depend on a data file.) Once that's all done, we'll be sure all this will work. At that point, we start subsuming the remaining tests into the GTest targets and, asynchronously, rewriting tests to use GTest properly rather than cursory conversion here. When all non-GTest tests are gone, the old generate_build_files.py hooks will be removed, consumers updated to not depend on them, and standalone builders converted to not rely on all_tests.go, which can then be removed. (Unless bits end up being needed as a malloc test driver. I'm thinking we'll want to do something with --gtest_filter.) As part of this CL, I've bumped the CMake requirements (for target_include_directories) and added a few suppressions for warnings that GTest doesn't pass. BUG=129 Change-Id: I881b26b07a8739cc0b52dbb51a30956908e1b71a Reviewed-on: https://boringssl-review.googlesource.com/13232 Reviewed-by: Adam Langley <agl@google.com>
7 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. include_directories(../include)
  2. if(NOT OPENSSL_NO_ASM)
  3. if(UNIX)
  4. if (${ARCH} STREQUAL "aarch64")
  5. # The "armx" Perl scripts look for "64" in the style argument
  6. # in order to decide whether to generate 32- or 64-bit asm.
  7. if (APPLE)
  8. set(PERLASM_STYLE ios64)
  9. else()
  10. set(PERLASM_STYLE linux64)
  11. endif()
  12. elseif (${ARCH} STREQUAL "arm")
  13. if (APPLE)
  14. set(PERLASM_STYLE ios32)
  15. else()
  16. set(PERLASM_STYLE linux32)
  17. endif()
  18. elseif (${ARCH} STREQUAL "ppc64le")
  19. set(PERLASM_STYLE linux64le)
  20. else()
  21. if (${ARCH} STREQUAL "x86")
  22. set(PERLASM_FLAGS "-fPIC -DOPENSSL_IA32_SSE2")
  23. endif()
  24. if (APPLE)
  25. set(PERLASM_STYLE macosx)
  26. else()
  27. set(PERLASM_STYLE elf)
  28. endif()
  29. endif()
  30. set(ASM_EXT S)
  31. enable_language(ASM)
  32. set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
  33. # Clang's integerated assembler does not support debug symbols.
  34. if(NOT CMAKE_ASM_COMPILER_ID MATCHES "Clang")
  35. set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,-g")
  36. endif()
  37. # CMake does not add -isysroot and -arch flags to assembly.
  38. if (APPLE)
  39. if (CMAKE_OSX_SYSROOT)
  40. set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
  41. endif()
  42. foreach(arch ${CMAKE_OSX_ARCHITECTURES})
  43. set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -arch ${arch}")
  44. endforeach()
  45. endif()
  46. else()
  47. if (${ARCH} STREQUAL "x86_64")
  48. set(PERLASM_STYLE nasm)
  49. else()
  50. set(PERLASM_STYLE win32n)
  51. set(PERLASM_FLAGS "-DOPENSSL_IA32_SSE2")
  52. endif()
  53. # On Windows, we use the NASM output, specifically built with Yasm.
  54. set(ASM_EXT asm)
  55. enable_language(ASM_NASM)
  56. endif()
  57. endif()
  58. function(perlasm dest src)
  59. add_custom_command(
  60. OUTPUT ${dest}
  61. COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} ${dest}
  62. DEPENDS
  63. ${src}
  64. ${PROJECT_SOURCE_DIR}/crypto/perlasm/arm-xlate.pl
  65. ${PROJECT_SOURCE_DIR}/crypto/perlasm/ppc-xlate.pl
  66. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl
  67. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl
  68. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl
  69. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86masm.pl
  70. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86nasm.pl
  71. WORKING_DIRECTORY .
  72. )
  73. endfunction()
  74. # Level 0.1 - depends on nothing outside this set.
  75. add_subdirectory(stack)
  76. add_subdirectory(lhash)
  77. add_subdirectory(err)
  78. add_subdirectory(buf)
  79. add_subdirectory(base64)
  80. add_subdirectory(bytestring)
  81. add_subdirectory(pool)
  82. # Level 0.2 - depends on nothing but itself
  83. add_subdirectory(rc4)
  84. add_subdirectory(conf)
  85. add_subdirectory(chacha)
  86. add_subdirectory(poly1305)
  87. add_subdirectory(curve25519)
  88. # Level 1, depends only on 0.*
  89. add_subdirectory(digest_extra)
  90. add_subdirectory(cipher_extra)
  91. add_subdirectory(rand_extra)
  92. add_subdirectory(bio)
  93. add_subdirectory(bn_extra)
  94. add_subdirectory(obj)
  95. add_subdirectory(asn1)
  96. # Level 2
  97. add_subdirectory(engine)
  98. add_subdirectory(dh)
  99. add_subdirectory(dsa)
  100. add_subdirectory(rsa_extra)
  101. add_subdirectory(ec_extra)
  102. add_subdirectory(ecdh)
  103. add_subdirectory(ecdsa_extra)
  104. # Level 3
  105. add_subdirectory(cmac)
  106. add_subdirectory(evp)
  107. add_subdirectory(hkdf)
  108. add_subdirectory(pem)
  109. add_subdirectory(x509)
  110. add_subdirectory(x509v3)
  111. # Level 4
  112. add_subdirectory(pkcs7)
  113. add_subdirectory(pkcs8)
  114. # Test support code
  115. add_subdirectory(test)
  116. add_subdirectory(fipsmodule)
  117. add_library(
  118. crypto_base
  119. OBJECT
  120. cpu-aarch64-linux.c
  121. cpu-arm.c
  122. cpu-arm-linux.c
  123. cpu-intel.c
  124. cpu-ppc64le.c
  125. crypto.c
  126. ex_data.c
  127. mem.c
  128. refcount_c11.c
  129. refcount_lock.c
  130. thread.c
  131. thread_none.c
  132. thread_pthread.c
  133. thread_win.c
  134. )
  135. if(FIPS_DELOCATE)
  136. SET_SOURCE_FILES_PROPERTIES(fipsmodule/bcm.o PROPERTIES EXTERNAL_OBJECT true)
  137. SET_SOURCE_FILES_PROPERTIES(fipsmodule/bcm.o PROPERTIES GENERATED true)
  138. set(
  139. CRYPTO_FIPS_OBJECTS
  140. fipsmodule/bcm.o
  141. )
  142. endif()
  143. add_library(
  144. crypto
  145. $<TARGET_OBJECTS:crypto_base>
  146. $<TARGET_OBJECTS:stack>
  147. $<TARGET_OBJECTS:lhash>
  148. $<TARGET_OBJECTS:err>
  149. $<TARGET_OBJECTS:base64>
  150. $<TARGET_OBJECTS:bytestring>
  151. $<TARGET_OBJECTS:pool>
  152. $<TARGET_OBJECTS:fipsmodule>
  153. $<TARGET_OBJECTS:digest_extra>
  154. $<TARGET_OBJECTS:cipher_extra>
  155. $<TARGET_OBJECTS:rc4>
  156. $<TARGET_OBJECTS:conf>
  157. $<TARGET_OBJECTS:chacha>
  158. $<TARGET_OBJECTS:poly1305>
  159. $<TARGET_OBJECTS:curve25519>
  160. $<TARGET_OBJECTS:buf>
  161. $<TARGET_OBJECTS:bn_extra>
  162. $<TARGET_OBJECTS:bio>
  163. $<TARGET_OBJECTS:rand_extra>
  164. $<TARGET_OBJECTS:obj>
  165. $<TARGET_OBJECTS:asn1>
  166. $<TARGET_OBJECTS:engine>
  167. $<TARGET_OBJECTS:dh>
  168. $<TARGET_OBJECTS:dsa>
  169. $<TARGET_OBJECTS:rsa_extra>
  170. $<TARGET_OBJECTS:ec_extra>
  171. $<TARGET_OBJECTS:ecdh>
  172. $<TARGET_OBJECTS:ecdsa_extra>
  173. $<TARGET_OBJECTS:cmac>
  174. $<TARGET_OBJECTS:evp>
  175. $<TARGET_OBJECTS:hkdf>
  176. $<TARGET_OBJECTS:pem>
  177. $<TARGET_OBJECTS:x509>
  178. $<TARGET_OBJECTS:x509v3>
  179. $<TARGET_OBJECTS:pkcs7>
  180. $<TARGET_OBJECTS:pkcs8_lib>
  181. ${CRYPTO_FIPS_OBJECTS}
  182. )
  183. if(FIPS_DELOCATE)
  184. add_dependencies(crypto bcm_o_target)
  185. endif()
  186. SET_TARGET_PROPERTIES(crypto PROPERTIES LINKER_LANGUAGE C)
  187. if(NOT MSVC AND NOT ANDROID)
  188. target_link_libraries(crypto pthread)
  189. endif()
  190. # TODO(davidben): Convert the remaining tests to GTest.
  191. add_executable(
  192. crypto_test
  193. asn1/asn1_test.cc
  194. base64/base64_test.cc
  195. bio/bio_test.cc
  196. bytestring/bytestring_test.cc
  197. chacha/chacha_test.cc
  198. cipher_extra/aead_test.cc
  199. cipher_extra/cipher_test.cc
  200. cmac/cmac_test.cc
  201. compiler_test.cc
  202. constant_time_test.cc
  203. curve25519/ed25519_test.cc
  204. curve25519/spake25519_test.cc
  205. curve25519/x25519_test.cc
  206. ecdh/ecdh_test.cc
  207. dh/dh_test.cc
  208. digest_extra/digest_test.cc
  209. dsa/dsa_test.cc
  210. err/err_test.cc
  211. evp/evp_extra_test.cc
  212. evp/evp_test.cc
  213. evp/pbkdf_test.cc
  214. evp/scrypt_test.cc
  215. fipsmodule/aes/aes_test.cc
  216. fipsmodule/bn/bn_test.cc
  217. fipsmodule/ec/ec_test.cc
  218. fipsmodule/ec/p256-x86_64_test.cc
  219. fipsmodule/ecdsa/ecdsa_test.cc
  220. fipsmodule/modes/gcm_test.cc
  221. fipsmodule/rand/ctrdrbg_test.cc
  222. hkdf/hkdf_test.cc
  223. hmac_extra/hmac_test.cc
  224. lhash/lhash_test.cc
  225. obj/obj_test.cc
  226. pkcs7/pkcs7_test.cc
  227. pkcs8/pkcs8_test.cc
  228. pkcs8/pkcs12_test.cc
  229. poly1305/poly1305_test.cc
  230. pool/pool_test.cc
  231. refcount_test.cc
  232. rsa_extra/rsa_test.cc
  233. test/file_test_gtest.cc
  234. thread_test.cc
  235. x509/x509_test.cc
  236. x509v3/tab_test.cc
  237. x509v3/v3name_test.cc
  238. $<TARGET_OBJECTS:crypto_test_data>
  239. $<TARGET_OBJECTS:gtest_main>
  240. $<TARGET_OBJECTS:test_support>
  241. )
  242. target_link_libraries(crypto_test crypto gtest)
  243. if (WIN32)
  244. target_link_libraries(crypto_test ws2_32)
  245. endif()
  246. add_dependencies(all_tests crypto_test)