Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

212 wiersze
4.7 KiB

  1. include_directories(../include)
  2. if(APPLE)
  3. if (${ARCH} STREQUAL "x86")
  4. set(PERLASM_FLAGS "-fPIC -DOPENSSL_IA32_SSE2")
  5. endif()
  6. set(PERLASM_STYLE macosx)
  7. set(ASM_EXT S)
  8. enable_language(ASM)
  9. elseif(UNIX)
  10. if (${ARCH} STREQUAL "aarch64")
  11. # The "armx" Perl scripts look for "64" in the style argument
  12. # in order to decide whether to generate 32- or 64-bit asm.
  13. set(PERLASM_STYLE linux64)
  14. elseif (${ARCH} STREQUAL "arm")
  15. set(PERLASM_STYLE linux32)
  16. elseif (${ARCH} STREQUAL "x86")
  17. set(PERLASM_FLAGS "-fPIC -DOPENSSL_IA32_SSE2")
  18. set(PERLASM_STYLE elf)
  19. elseif (${ARCH} STREQUAL "ppc64le")
  20. set(PERLASM_STYLE ppc64le)
  21. else()
  22. set(PERLASM_STYLE elf)
  23. endif()
  24. set(ASM_EXT S)
  25. enable_language(ASM)
  26. set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
  27. else()
  28. if (CMAKE_CL_64)
  29. message("Using nasm")
  30. set(PERLASM_STYLE nasm)
  31. else()
  32. message("Using win32n")
  33. set(PERLASM_STYLE win32n)
  34. set(PERLASM_FLAGS "-DOPENSSL_IA32_SSE2")
  35. endif()
  36. # On Windows, we use the NASM output, specifically built with Yasm.
  37. set(ASM_EXT asm)
  38. enable_language(ASM_NASM)
  39. endif()
  40. function(perlasm dest src)
  41. add_custom_command(
  42. OUTPUT ${dest}
  43. COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} ${dest}
  44. DEPENDS
  45. ${src}
  46. ${PROJECT_SOURCE_DIR}/crypto/perlasm/arm-xlate.pl
  47. ${PROJECT_SOURCE_DIR}/crypto/perlasm/ppc-xlate.pl
  48. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl
  49. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl
  50. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl
  51. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86masm.pl
  52. ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86nasm.pl
  53. WORKING_DIRECTORY .
  54. )
  55. endfunction()
  56. # Level 0.1 - depends on nothing outside this set.
  57. add_subdirectory(stack)
  58. add_subdirectory(lhash)
  59. add_subdirectory(err)
  60. add_subdirectory(buf)
  61. add_subdirectory(base64)
  62. add_subdirectory(bytestring)
  63. add_subdirectory(pool)
  64. # Level 0.2 - depends on nothing but itself
  65. add_subdirectory(sha)
  66. add_subdirectory(md4)
  67. add_subdirectory(md5)
  68. add_subdirectory(modes)
  69. add_subdirectory(aes)
  70. add_subdirectory(des)
  71. add_subdirectory(rc4)
  72. add_subdirectory(conf)
  73. add_subdirectory(chacha)
  74. add_subdirectory(poly1305)
  75. add_subdirectory(curve25519)
  76. add_subdirectory(newhope)
  77. # Level 1, depends only on 0.*
  78. add_subdirectory(digest)
  79. add_subdirectory(cipher)
  80. add_subdirectory(rand)
  81. add_subdirectory(bio)
  82. add_subdirectory(bn)
  83. add_subdirectory(obj)
  84. add_subdirectory(asn1)
  85. # Level 2
  86. add_subdirectory(engine)
  87. add_subdirectory(dh)
  88. add_subdirectory(dsa)
  89. add_subdirectory(rsa)
  90. add_subdirectory(ec)
  91. add_subdirectory(ecdh)
  92. add_subdirectory(ecdsa)
  93. add_subdirectory(hmac)
  94. # Level 3
  95. add_subdirectory(cmac)
  96. add_subdirectory(evp)
  97. add_subdirectory(hkdf)
  98. add_subdirectory(pem)
  99. add_subdirectory(x509)
  100. add_subdirectory(x509v3)
  101. # Level 4
  102. add_subdirectory(pkcs8)
  103. # Test support code
  104. add_subdirectory(test)
  105. add_library(
  106. crypto
  107. cpu-aarch64-linux.c
  108. cpu-arm.c
  109. cpu-arm-linux.c
  110. cpu-intel.c
  111. cpu-ppc64le.c
  112. crypto.c
  113. ex_data.c
  114. mem.c
  115. refcount_c11.c
  116. refcount_lock.c
  117. thread.c
  118. thread_none.c
  119. thread_pthread.c
  120. thread_win.c
  121. time_support.c
  122. $<TARGET_OBJECTS:stack>
  123. $<TARGET_OBJECTS:lhash>
  124. $<TARGET_OBJECTS:err>
  125. $<TARGET_OBJECTS:base64>
  126. $<TARGET_OBJECTS:bytestring>
  127. $<TARGET_OBJECTS:pool>
  128. $<TARGET_OBJECTS:sha>
  129. $<TARGET_OBJECTS:md4>
  130. $<TARGET_OBJECTS:md5>
  131. $<TARGET_OBJECTS:digest>
  132. $<TARGET_OBJECTS:cipher>
  133. $<TARGET_OBJECTS:modes>
  134. $<TARGET_OBJECTS:aes>
  135. $<TARGET_OBJECTS:des>
  136. $<TARGET_OBJECTS:rc4>
  137. $<TARGET_OBJECTS:conf>
  138. $<TARGET_OBJECTS:chacha>
  139. $<TARGET_OBJECTS:poly1305>
  140. $<TARGET_OBJECTS:curve25519>
  141. $<TARGET_OBJECTS:buf>
  142. $<TARGET_OBJECTS:bn>
  143. $<TARGET_OBJECTS:bio>
  144. $<TARGET_OBJECTS:rand>
  145. $<TARGET_OBJECTS:obj>
  146. $<TARGET_OBJECTS:asn1>
  147. $<TARGET_OBJECTS:engine>
  148. $<TARGET_OBJECTS:dh>
  149. $<TARGET_OBJECTS:dsa>
  150. $<TARGET_OBJECTS:rsa>
  151. $<TARGET_OBJECTS:ec>
  152. $<TARGET_OBJECTS:ecdh>
  153. $<TARGET_OBJECTS:ecdsa>
  154. $<TARGET_OBJECTS:hmac>
  155. $<TARGET_OBJECTS:cmac>
  156. $<TARGET_OBJECTS:evp>
  157. $<TARGET_OBJECTS:hkdf>
  158. $<TARGET_OBJECTS:pem>
  159. $<TARGET_OBJECTS:x509>
  160. $<TARGET_OBJECTS:x509v3>
  161. $<TARGET_OBJECTS:pkcs8_lib>
  162. $<TARGET_OBJECTS:newhope>
  163. )
  164. if(NOT MSVC AND NOT ANDROID)
  165. target_link_libraries(crypto pthread)
  166. endif()
  167. add_executable(
  168. constant_time_test
  169. constant_time_test.c
  170. $<TARGET_OBJECTS:test_support>
  171. )
  172. target_link_libraries(constant_time_test crypto)
  173. add_dependencies(all_tests constant_time_test)
  174. add_executable(
  175. thread_test
  176. thread_test.c
  177. $<TARGET_OBJECTS:test_support>
  178. )
  179. target_link_libraries(thread_test crypto)
  180. add_dependencies(all_tests thread_test)
  181. add_executable(
  182. refcount_test
  183. refcount_test.c
  184. )
  185. target_link_libraries(refcount_test crypto)
  186. add_dependencies(all_tests refcount_test)