提交 372b65e3 编写于 作者: A Adam Barth

Merge pull request #131 from abarth/fewer_deps

Remove some unnessary dependencies
......@@ -20,10 +20,8 @@
vars = {
'chromium_git': 'https://chromium.googlesource.com',
'skia_revision': '2ced78866fcadd98895777c8dffe92e229775181',
'angle_revision': '02df796f466cee47f42130bd8c7dbad6c72a1662',
'dart_revision': 'e5e3d161e70d862608e6597facdf5ac8ae9ab2c3',
'dart_observatory_packages_revision': 'cdc4b3d4c15b9c0c8e7702dff127b440afbb7485',
'boringssl_revision': '7f15ff53d82a1991d6732d2303eb652b1cf7e023',
'buildtools_revision': '5215ee866bc3e8eb4a7f124212845abf4029e60b',
......@@ -58,9 +56,6 @@ deps = {
'src/testing/gmock':
Var('chromium_git') + '/external/googlemock.git' + '@' + '29763965ab52f24565299976b936d1265cb6a271',
'src/third_party/angle':
Var('chromium_git') + '/angle/angle.git' + '@' + Var('angle_revision'),
'src/third_party/icu':
Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'c3f79166089e5360c09e3053fce50e6e296c3204',
......@@ -81,18 +76,9 @@ deps = {
'src/third_party/libjpeg_turbo':
Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + 'f4631b6ee8b1dbb05e51ae335a7886f9ac598ab6',
'src/third_party/smhasher/src':
Var('chromium_git') + '/external/smhasher.git' + '@' + 'e87738e57558e0ec472b2fc3a643b838e5b6e88f',
'src/third_party/mesa/src':
Var('chromium_git') + '/chromium/deps/mesa.git' + '@' + '071d25db04c23821a12a8b260ab9d96a097402f0',
'src/third_party/boringssl/src':
'https://boringssl.googlesource.com/boringssl.git' + '@' + Var('boringssl_revision'),
'src/third_party/requests/src':
Var('chromium_git') + '/external/github.com/kennethreitz/requests.git' + '@' + 'f172b30356d821d180fa4ecfa3e71c7274a32de4',
'src/third_party/dart-pkg/archive':
Var('chromium_git') + '/external/github.com/brendan-duncan/archive.git' + '@' + Var('archive_dart_revision'),
......@@ -150,9 +136,6 @@ deps_os = {
'src/third_party/robolectric/lib':
Var('chromium_git') + '/chromium/third_party/robolectric.git' + '@' + '6b63c99a8b6967acdb42cbed0adb067c80efc810',
'src/third_party/appurify-python/src':
Var('chromium_git') + '/external/github.com/appurify/appurify-python.git' + '@' + 'ee7abd5c5ae3106f72b2a0b9d2cb55094688e867',
'src/third_party/freetype-android/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + 'e186230678ee8e4ea4ac4797ece8125761e3225a',
},
......
......@@ -2,373 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/crypto.gni")
import("//testing/test.gni")
if (is_nacl) {
component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"random.cc",
"random.h",
]
deps = [
"//base",
]
}
} else {
component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"aead_openssl.cc",
"aead_openssl.h",
"aes_128_gcm_helpers_nss.cc",
"aes_128_gcm_helpers_nss.h",
"apple_keychain.h",
"apple_keychain_ios.mm",
"apple_keychain_mac.mm",
"capi_util.cc",
"capi_util.h",
"crypto_export.h",
"cssm_init.cc",
"cssm_init.h",
"curve25519-donna.c",
"curve25519.cc",
"curve25519.h",
"ec_private_key.h",
"ec_private_key_nss.cc",
"ec_private_key_openssl.cc",
"ec_signature_creator.cc",
"ec_signature_creator.h",
"ec_signature_creator_impl.h",
"ec_signature_creator_nss.cc",
"ec_signature_creator_openssl.cc",
"encryptor.cc",
"encryptor.h",
"encryptor_nss.cc",
"encryptor_openssl.cc",
"ghash.cc",
"ghash.h",
"hkdf.cc",
"hkdf.h",
"hmac.cc",
"hmac.h",
"hmac_nss.cc",
"hmac_openssl.cc",
"mac_security_services_lock.cc",
"mac_security_services_lock.h",
# TODO(brettw) these mocks should be moved to a test_support_crypto target
# if possible.
"mock_apple_keychain.cc",
"mock_apple_keychain.h",
"mock_apple_keychain_ios.cc",
"mock_apple_keychain_mac.cc",
"nss_key_util.cc",
"nss_key_util.h",
"nss_util.cc",
"nss_util.h",
"nss_util_internal.h",
"openssl_bio_string.cc",
"openssl_bio_string.h",
"openssl_util.cc",
"openssl_util.h",
"p224.cc",
"p224.h",
"p224_spake.cc",
"p224_spake.h",
"random.cc",
"random.h",
"rsa_private_key.cc",
"rsa_private_key.h",
"rsa_private_key_nss.cc",
"rsa_private_key_openssl.cc",
"scoped_capi_types.h",
"scoped_nss_types.h",
"secure_hash.h",
"secure_hash_default.cc",
"secure_hash_openssl.cc",
"secure_util.cc",
"secure_util.h",
"sha2.cc",
"sha2.h",
"signature_creator.h",
"signature_creator_nss.cc",
"signature_creator_openssl.cc",
"signature_verifier.h",
"signature_verifier_nss.cc",
"signature_verifier_openssl.cc",
"symmetric_key.h",
"symmetric_key_nss.cc",
"symmetric_key_openssl.cc",
"third_party/nss/chromium-blapi.h",
"third_party/nss/chromium-blapit.h",
"third_party/nss/chromium-nss.h",
"third_party/nss/chromium-sha256.h",
"third_party/nss/pk11akey.cc",
"third_party/nss/rsawrapr.c",
"third_party/nss/secsign.cc",
"third_party/nss/sha512.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":platform",
"//base",
"//base/third_party/dynamic_annotations",
]
if (!is_mac && !is_ios) {
sources -= [
"apple_keychain.h",
"mock_apple_keychain.cc",
"mock_apple_keychain.h",
]
}
if (!is_mac) {
sources -= [
"cssm_init.cc",
"cssm_init.h",
"mac_security_services_lock.cc",
"mac_security_services_lock.h",
]
}
if (!is_win) {
sources -= [
"capi_util.cc",
"capi_util.h",
]
}
if (is_android) {
deps += [ "//third_party/android_tools:cpu_features" ]
}
if (use_openssl) {
# Remove NSS files when using OpenSSL
sources -= [
"aes_128_gcm_helpers_nss.cc",
"aes_128_gcm_helpers_nss.h",
"ec_private_key_nss.cc",
"ec_signature_creator_nss.cc",
"encryptor_nss.cc",
"hmac_nss.cc",
"rsa_private_key_nss.cc",
"secure_hash_default.cc",
"signature_creator_nss.cc",
"signature_verifier_nss.cc",
"symmetric_key_nss.cc",
"third_party/nss/chromium-blapi.h",
"third_party/nss/chromium-blapit.h",
"third_party/nss/chromium-nss.h",
"third_party/nss/pk11akey.cc",
"third_party/nss/rsawrapr.c",
"third_party/nss/secsign.cc",
]
} else {
# Remove OpenSSL when using NSS.
sources -= [
"aead_openssl.cc",
"aead_openssl.h",
"ec_private_key_openssl.cc",
"ec_signature_creator_openssl.cc",
"encryptor_openssl.cc",
"hmac_openssl.cc",
"openssl_bio_string.cc",
"openssl_bio_string.h",
"openssl_util.cc",
"openssl_util.h",
"rsa_private_key_openssl.cc",
"secure_hash_openssl.cc",
"signature_creator_openssl.cc",
"signature_verifier_openssl.cc",
"symmetric_key_openssl.cc",
]
}
# Some files are built when NSS is used at all, either for the internal crypto
# library or the platform certificate library.
if (use_openssl && !use_nss_certs) {
sources -= [
"nss_key_util.cc",
"nss_key_util.h",
"nss_util.cc",
"nss_util.h",
"nss_util_internal.h",
]
}
defines = [ "CRYPTO_IMPLEMENTATION" ]
}
}
# TODO(GYP): TODO(dpranke), fix the compile errors for this stuff
# and make it work.
if (false && is_win) {
# A minimal crypto subset for hmac-related stuff that small standalone
# targets can use to reduce code size on Windows. This does not depend on
# OpenSSL/NSS but will use Windows APIs for that functionality.
source_set("crypto_minimal_win") {
sources = [
"crypto_export.h",
"hmac.cc",
"hmac.h",
"hmac_win.cc",
"scoped_capi_types.h",
"scoped_nss_types.h",
"secure_util.cc",
"secure_util.h",
"symmetric_key.h",
"symmetric_key_win.cc",
"third_party/nss/chromium-blapi.h",
"third_party/nss/chromium-sha256.h",
"third_party/nss/sha512.cc",
]
deps = [
"//base",
"//base/third_party/dynamic_annotations",
]
defines = [ "CRYPTO_IMPLEMENTATION" ]
}
}
test("crypto_unittests") {
sources = [
# Tests.
"aes_128_gcm_helpers_nss_unittest.cc",
"curve25519_unittest.cc",
"ec_private_key_unittest.cc",
"ec_signature_creator_unittest.cc",
"encryptor_unittest.cc",
"ghash_unittest.cc",
"hkdf_unittest.cc",
"hmac_unittest.cc",
"nss_key_util_unittest.cc",
"nss_util_unittest.cc",
"openssl_bio_string_unittest.cc",
"p224_spake_unittest.cc",
"p224_unittest.cc",
"random_unittest.cc",
"rsa_private_key_unittest.cc",
"secure_hash_unittest.cc",
"sha2_unittest.cc",
"signature_creator_unittest.cc",
"signature_verifier_unittest.cc",
"symmetric_key_unittest.cc",
]
# Some files are built when NSS is used at all, either for the internal crypto
# library or the platform certificate library.
if (use_openssl && !use_nss_certs) {
sources -= [
"nss_key_util_unittest.cc",
"nss_util_unittest.cc",
]
}
if (use_openssl) {
sources -= [ "aes_128_gcm_helpers_nss_unittest.cc" ]
} else {
sources -= [ "openssl_bio_string_unittest.cc" ]
}
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":crypto",
":platform",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
source_set("test_support") {
component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
"random.cc",
"random.h",
]
deps = [
":crypto",
":platform",
"//base",
]
if (!use_nss_certs) {
sources -= [
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
]
}
if (!is_chromeos) {
sources -= [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
]
}
}
config("platform_config") {
if ((!use_openssl || use_nss_certs) && is_clang) {
# There is a broken header guard in /usr/include/nss/secmod.h:
# https://bugzilla.mozilla.org/show_bug.cgi?id=884072
cflags = [ "-Wno-header-guard" ]
}
}
# This is a meta-target that forwards to NSS's SSL library or OpenSSL,
# according to the state of the crypto flags. A target just wanting to depend
# on the current SSL library should just depend on this.
group("platform") {
if (use_openssl) {
deps = [
"//third_party/boringssl",
]
} else {
deps = [
"//net/third_party/nss/ssl:libssl",
]
}
# Link in NSS if it is used for either the internal crypto library
# (!use_openssl) or platform certificate library (use_nss_certs).
if (!use_openssl || use_nss_certs) {
if (is_linux) {
# On Linux, we use the system NSS (excepting SSL where we always use our
# own).
public_configs = [ ":platform_config" ]
if (!use_openssl) {
# If using a bundled copy of NSS's SSL library, ensure the bundled SSL
# header search path comes before the system one so our versions are
# used. The libssl target will add the search path we want, but
# according to GN's ordering rules, public_configs' search path will get
# applied before ones inherited from our dependencies. Therefore, we
# need to explicitly list our custom libssl's config here before the
# system one.
public_configs += [ "//net/third_party/nss/ssl:ssl_config" ]
}
public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
} else {
# Non-Linux platforms use the hermetic NSS from the tree.
public_deps = [
"//third_party/nss:nspr",
"//third_party/nss:nss",
]
}
}
}
......@@ -2,39 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# GYP-to-GN project mappings:
#
# gpu.gyp:command_buffer_client => //gpu/command_buffer/client
#
# gpu.gyp:command_buffer_common => //gpu/command_buffer/common
#
# gpu.gyp:command_buffer_service => //gpu/command_buffer/service
# gpu/gpu.gyp:gl_in_process_context =>
# //gpu/command_buffer/client:gl_in_process_context
#
# gpu.gyp:gles2_cmd_helper => //gpu/command_buffer/client:gles2_cmd_helper
#
# gpu.gyp:gles2_c_lib => //gpu/command_buffer/client:gles2_c_lib
#
# gpu.gyp:gles2_implementation =>
# //gpu/command_buffer/client:gles2_implementation
#
# gpu.gyp:gpu_config => //gpu/config
#
#
# gpu.gyp:disk_cache_proto => //gpu/command_buffer/service:disk_cache_proto
#
# command_buffer/command_buffer.gyp:gles2_utils =>
# //gpu/command_buffer/common
# (Merged in to here because the separate file exists in GYP only to break
# a .gyp file dependency cycle which GN doesn't have.)
#
# gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings => //gpu/skia_bindings
import("//testing/test.gni")
import("//build/config/ui.gni")
config("gpu_implementation") {
defines = [ "GPU_IMPLEMENTATION" ]
}
......@@ -42,275 +9,7 @@ config("gpu_implementation") {
component("gpu") {
public_deps = [
"//gpu/command_buffer/client",
"//gpu/command_buffer/client:gles2_cmd_helper_sources",
"//gpu/command_buffer/common",
"//gpu/command_buffer/service",
"//gpu/config",
]
}
source_set("test_support") {
testonly = true
sources = [
"command_buffer/client/gles2_interface_stub.cc",
"command_buffer/client/gles2_interface_stub.h",
"command_buffer/service/error_state_mock.cc",
"command_buffer/service/gles2_cmd_decoder_mock.cc",
]
configs += [ ":gpu_implementation" ]
public_deps = [
":gpu",
"//gpu/command_buffer/client:gles2_interface",
]
deps = [
"//testing/gmock",
"//testing/gtest",
"//ui/gl:gl_unittest_utils",
]
}
test("gl_tests") {
sources = [
"command_buffer/tests/compressed_texture_test.cc",
"command_buffer/tests/gl_bind_uniform_location_unittest.cc",
"command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc",
"command_buffer/tests/gl_chromium_path_rendering_unittest.cc",
"command_buffer/tests/gl_clear_framebuffer_unittest.cc",
"command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc",
"command_buffer/tests/gl_depth_texture_unittest.cc",
"command_buffer/tests/gl_gpu_memory_buffer_unittest.cc",
"command_buffer/tests/gl_lose_context_chromium_unittest.cc",
"command_buffer/tests/gl_manager.cc",
"command_buffer/tests/gl_manager.h",
"command_buffer/tests/gl_pointcoord_unittest.cc",
"command_buffer/tests/gl_program_unittest.cc",
"command_buffer/tests/gl_query_unittest.cc",
"command_buffer/tests/gl_readback_unittest.cc",
"command_buffer/tests/gl_shared_resources_unittest.cc",
"command_buffer/tests/gl_stream_draw_unittest.cc",
"command_buffer/tests/gl_test_utils.cc",
"command_buffer/tests/gl_test_utils.h",
"command_buffer/tests/gl_tests_main.cc",
"command_buffer/tests/gl_texture_mailbox_unittest.cc",
"command_buffer/tests/gl_texture_storage_unittest.cc",
"command_buffer/tests/gl_unittest.cc",
"command_buffer/tests/gl_unittests_android.cc",
"command_buffer/tests/gl_virtual_contexts_unittest.cc",
"command_buffer/tests/occlusion_query_unittest.cc",
]
defines = [ "GL_GLEXT_PROTOTYPES" ]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":gpu",
":test_support",
"//base",
"//base/test:test_support",
"//base/third_party/dynamic_annotations",
"//testing/gmock",
"//testing/gtest",
"//third_party/angle:translator",
"//ui/gfx",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
"//ui/gl",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_implementation",
]
libs = []
if (is_android) {
deps += [ "//testing/android/native_test:native_test_native_code" ]
libs += [ "android" ]
}
# TODO(GYP)
# ['OS == "win"', {
# 'dependencies': [
# '../third_party/angle/src/build_angle.gyp:libEGL',
# '../third_party/angle/src/build_angle.gyp:libGLESv2',
# ],
# }],
}
test("gpu_unittests") {
sources = [
"command_buffer/client/buffer_tracker_unittest.cc",
"command_buffer/client/client_test_helper.cc",
"command_buffer/client/client_test_helper.h",
"command_buffer/client/cmd_buffer_helper_test.cc",
"command_buffer/client/fenced_allocator_test.cc",
"command_buffer/client/gles2_implementation_unittest.cc",
"command_buffer/client/mapped_memory_unittest.cc",
"command_buffer/client/program_info_manager_unittest.cc",
"command_buffer/client/query_tracker_unittest.cc",
"command_buffer/client/ring_buffer_test.cc",
"command_buffer/client/transfer_buffer_unittest.cc",
"command_buffer/client/vertex_array_object_manager_unittest.cc",
"command_buffer/common/bitfield_helpers_test.cc",
"command_buffer/common/command_buffer_mock.cc",
"command_buffer/common/command_buffer_mock.h",
"command_buffer/common/command_buffer_shared_test.cc",
"command_buffer/common/debug_marker_manager_unittest.cc",
"command_buffer/common/gles2_cmd_format_test.cc",
"command_buffer/common/gles2_cmd_format_test_autogen.h",
"command_buffer/common/gles2_cmd_utils_unittest.cc",
"command_buffer/common/id_allocator_test.cc",
"command_buffer/common/trace_event.h",
"command_buffer/common/unittest_main.cc",
"command_buffer/service/async_pixel_transfer_delegate_mock.cc",
"command_buffer/service/async_pixel_transfer_delegate_mock.h",
"command_buffer/service/async_pixel_transfer_manager_mock.cc",
"command_buffer/service/async_pixel_transfer_manager_mock.h",
"command_buffer/service/buffer_manager_unittest.cc",
"command_buffer/service/cmd_parser_test.cc",
"command_buffer/service/command_buffer_service_unittest.cc",
"command_buffer/service/common_decoder_unittest.cc",
"command_buffer/service/context_group_unittest.cc",
"command_buffer/service/feature_info_unittest.cc",
"command_buffer/service/framebuffer_manager_unittest.cc",
"command_buffer/service/gl_context_mock.cc",
"command_buffer/service/gl_context_mock.h",
"command_buffer/service/gl_surface_mock.cc",
"command_buffer/service/gl_surface_mock.h",
"command_buffer/service/gles2_cmd_decoder_unittest.cc",
"command_buffer/service/gles2_cmd_decoder_unittest.h",
"command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h",
"command_buffer/service/gles2_cmd_decoder_unittest_1.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h",
"command_buffer/service/gles2_cmd_decoder_unittest_2.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h",
"command_buffer/service/gles2_cmd_decoder_unittest_3.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h",
"command_buffer/service/gles2_cmd_decoder_unittest_async_pixel.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_base.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_base.h",
"command_buffer/service/gles2_cmd_decoder_unittest_buffers.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_context_lost.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_context_state.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_programs.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_textures.cc",
"command_buffer/service/gles2_cmd_decoder_unittest_valuebuffer.cc",
"command_buffer/service/gpu_scheduler_unittest.cc",
"command_buffer/service/gpu_service_test.cc",
"command_buffer/service/gpu_service_test.h",
"command_buffer/service/gpu_tracer_unittest.cc",
"command_buffer/service/id_manager_unittest.cc",
"command_buffer/service/mailbox_manager_unittest.cc",
"command_buffer/service/memory_program_cache_unittest.cc",
"command_buffer/service/mocks.cc",
"command_buffer/service/mocks.h",
"command_buffer/service/program_cache_unittest.cc",
"command_buffer/service/program_manager_unittest.cc",
"command_buffer/service/query_manager_unittest.cc",
"command_buffer/service/renderbuffer_manager_unittest.cc",
"command_buffer/service/shader_manager_unittest.cc",
"command_buffer/service/shader_translator_cache_unittest.cc",
"command_buffer/service/shader_translator_unittest.cc",
"command_buffer/service/test_helper.cc",
"command_buffer/service/test_helper.h",
"command_buffer/service/texture_manager_unittest.cc",
"command_buffer/service/transfer_buffer_manager_unittest.cc",
"command_buffer/service/valuebuffer_manager_unittest.cc",
"command_buffer/service/vertex_array_manager_unittest.cc",
"command_buffer/service/vertex_attrib_manager_unittest.cc",
"config/gpu_blacklist_unittest.cc",
"config/gpu_control_list_entry_unittest.cc",
"config/gpu_control_list_number_info_unittest.cc",
"config/gpu_control_list_os_info_unittest.cc",
"config/gpu_control_list_unittest.cc",
"config/gpu_control_list_version_info_unittest.cc",
"config/gpu_driver_bug_list_unittest.cc",
"config/gpu_info_collector_unittest.cc",
"config/gpu_info_unittest.cc",
"config/gpu_test_config_unittest.cc",
"config/gpu_test_expectations_parser_unittest.cc",
"config/gpu_util_unittest.cc",
]
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":gpu",
":test_support",
"//base",
"//base/test:test_support",
"//base/third_party/dynamic_annotations",
"//testing/gmock",
"//testing/gtest",
"//third_party/angle:translator",
"//ui/gfx",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
"//ui/gl",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_implementation",
]
}
test("gpu_perftests") {
sources = [
"perftests/measurements.cc",
"perftests/run_all_tests.cc",
"perftests/texture_upload_perftest.cc",
]
deps = [
"//base",
"//base/test:test_support",
"//gpu/command_buffer/service",
"//testing/gmock",
"//testing/gtest",
"//testing/perf",
"//ui/gfx/geometry",
"//ui/gl",
]
}
test("angle_unittests") {
sources = [
"angle_unittest_main.cc",
]
deps = [
"//base",
"//base/test:test_support",
"//base/third_party/dynamic_annotations",
"//testing/gmock",
"//testing/gtest",
"//third_party/angle:translator_static",
]
}
if (is_linux && target_cpu != "arm" && use_x11) {
executable("compositor_model_bench") {
sources = [
"tools/compositor_model_bench/compositor_model_bench.cc",
"tools/compositor_model_bench/forward_render_model.cc",
"tools/compositor_model_bench/render_model_utils.cc",
"tools/compositor_model_bench/render_models.cc",
"tools/compositor_model_bench/render_tree.cc",
"tools/compositor_model_bench/shaders.cc",
]
libs = [ "GL" ]
configs += [ "//build/config/linux:x11" ]
deps = [
"//base",
"//ui/gl",
]
}
}
......@@ -385,7 +385,6 @@ source_set("generated_bindings") {
"//skia",
"//sky/engine/core:core_names",
"//sky/engine/wtf",
"//third_party/angle:translator",
"//third_party/iccjpeg",
"//third_party/libpng",
"//third_party/ots",
......
......@@ -23,7 +23,6 @@ source_set("libraries") {
"//skia",
"//sky/engine/tonic:tonic",
"//sky/engine/wtf",
"//third_party/angle:translator",
"//third_party/iccjpeg",
"//third_party/libpng",
"//third_party/ots",
......
......@@ -38,11 +38,6 @@ _build_deps = [
'tools/valgrind',
]
# things used from //mojo/public
_mojo_sdk_deps = [
'third_party/cython',
]
_chromium_libs = [
'crypto',
'url',
......@@ -51,7 +46,6 @@ _chromium_libs = [
_third_party_deps = [
'third_party/android_platform',
'third_party/apple_apsl',
'third_party/boringssl',
'third_party/brotli',
'third_party/expat',
'third_party/freetype-android',
......@@ -73,12 +67,10 @@ _third_party_deps = [
'third_party/qcms',
'third_party/re2',
'third_party/robolectric',
'third_party/smhasher',
'third_party/yasm',
'third_party/zlib',
]
dirs_from_chromium = _base_deps + _build_deps + _mojo_sdk_deps + _chromium_libs + _third_party_deps
dirs_from_chromium = _base_deps + _build_deps + _chromium_libs + _third_party_deps
dirs_from_mojo = [
'gpu',
......@@ -97,11 +89,13 @@ files_not_to_roll = [
'build/config/ui.gni',
'build/ls.py',
'build/module_args/mojo.gni',
'crypto/BUILD.gn',
'gpu/BUILD.gn',
'tools/android/download_android_tools.py',
'tools/android/VERSION_LINUX_NDK',
'tools/android/VERSION_LINUX_SDK',
'tools/android/VERSION_MACOSX_NDK',
'tools/android/VERSION_MACOSX_SDK',
'tools/android/download_android_tools.py',
]
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Config for us and everybody else depending on BoringSSL.
config("openssl_config") {
include_dirs = []
include_dirs += [ "src/include" ]
if (is_component_build) {
defines = [ "BORINGSSL_SHARED_LIBRARY" ]
}
}
# Config internal to this build file.
config("openssl_internal_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
}
# The list of BoringSSL files is kept in boringssl.gypi.
gypi_values =
exec_script("//build/gypi_to_gn.py",
[ rebase_path("//third_party/boringssl/boringssl.gypi") ],
"scope",
[ "//third_party/boringssl/boringssl.gypi" ])
# Windows' assembly is built with Yasm. The other platforms use the platform
# assembler.
if (is_win && !is_msan) {
import("//third_party/yasm/yasm_assemble.gni")
yasm_assemble("boringssl_asm") {
if (current_cpu == "x64") {
sources = gypi_values.boringssl_win_x86_64_sources
} else if (current_cpu == "x86") {
sources = gypi_values.boringssl_win_x86_sources
}
}
}
component("boringssl") {
sources = gypi_values.boringssl_crypto_sources
sources += gypi_values.boringssl_ssl_sources
public_configs = [ ":openssl_config" ]
cflags = []
defines = [
"BORINGSSL_IMPLEMENTATION",
"BORINGSSL_NO_STATIC_INITIALIZER",
]
deps = []
if (is_component_build) {
defines += [ "BORINGSSL_SHARED_LIBRARY" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
"//build/config/compiler:no_size_t_to_int_warning",
]
# Also gets the include dirs from :openssl_config
include_dirs = [
"src/include",
# This is for arm_arch.h, which is needed by some asm files. Since the
# asm files are generated and kept in a different directory, they
# cannot use relative paths to find this file.
"src/crypto",
]
if (is_msan) {
defines += [ "OPENSSL_NO_ASM" ]
} else if (current_cpu == "x64") {
if (is_mac || is_ios) {
sources += gypi_values.boringssl_mac_x86_64_sources
} else if (is_linux || is_android) {
sources += gypi_values.boringssl_linux_x86_64_sources
} else if (is_win) {
deps += [ ":boringssl_asm" ]
} else {
defines += [ "OPENSSL_NO_ASM" ]
}
} else if (current_cpu == "x86") {
if (is_mac || is_ios) {
sources += gypi_values.boringssl_mac_x86_sources
} else if (is_linux || is_android) {
sources += gypi_values.boringssl_linux_x86_sources
} else if (is_win) {
deps += [ ":boringssl_asm" ]
} else {
defines += [ "OPENSSL_NO_ASM" ]
}
} else if (current_cpu == "arm" && (is_linux || is_android)) {
sources += gypi_values.boringssl_linux_arm_sources
} else if (current_cpu == "arm64" && (is_linux || is_android)) {
sources += gypi_values.boringssl_linux_aarch64_sources
} else {
defines += [ "OPENSSL_NO_ASM" ]
}
}
specific_include_rules = {
"boringssl_unittest\.cc": [
"+base",
"+testing",
],
}
LICENSE ISSUES
==============
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 for the actual license texts. Actually both licenses are BSD-style
Open Source licenses. In case of any license issues related to OpenSSL
please contact openssl-core@openssl.org.
OpenSSL License
---------------
/* ====================================================================
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
Original SSLeay License
-----------------------
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
agl@chromium.org
davidben@chromium.org
rsleevi@chromium.org
Name: boringssl
URL: https://boringssl.googlesource.com/boringssl
Version: git
License: BSDish
License File: NOTICE
License Android Compatible: yes
Security Critical: yes
Description:
This is BoringSSL, a fork of OpenSSL. See
https://www.imperialviolet.org/2014/06/20/boringssl.html
Note: when rolling DEPS forward, remember to run
cd third_party/boringssl
python src/util/generate_build_files.py chromium
from a system with both Perl and Go installed.
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'boringssl',
'type': '<(component)',
'includes': [
'boringssl.gypi',
],
'sources': [
'<@(boringssl_crypto_sources)',
'<@(boringssl_ssl_sources)',
],
'defines': [
'BORINGSSL_IMPLEMENTATION',
'BORINGSSL_NO_STATIC_INITIALIZER',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
'conditions': [
['component == "shared_library"', {
'defines': [
'BORINGSSL_SHARED_LIBRARY',
],
}],
['target_arch == "arm" and msan == 0', {
'conditions': [
['OS == "linux" or OS == "android"', {
'sources': [ '<@(boringssl_linux_arm_sources)' ],
}, {
'defines': [ 'OPENSSL_NO_ASM' ],
}],
],
}],
['target_arch == "arm64" and msan == 0', {
'conditions': [
['OS == "linux" or OS == "android"', {
'sources': [ '<@(boringssl_linux_aarch64_sources)' ],
}, {
'defines': [ 'OPENSSL_NO_ASM' ],
}],
],
}],
['target_arch == "ia32" and msan == 0', {
'conditions': [
['OS == "mac" or OS == "ios"', {
'sources': [ '<@(boringssl_mac_x86_sources)' ],
}],
['OS == "linux" or OS == "android"', {
'sources': [ '<@(boringssl_linux_x86_sources)' ],
}],
['OS == "win"', {
'sources': [ '<@(boringssl_win_x86_sources)' ],
# Windows' assembly is built with Yasm. The other platforms use
# the platform assembler.
'variables': {
'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/boringssl',
},
'includes': [
'../yasm/yasm_compile.gypi',
],
}],
['OS != "mac" and OS != "ios" and OS != "linux" and OS != "win" and OS != "android"', {
'defines': [ 'OPENSSL_NO_ASM' ],
}],
]
}],
['target_arch == "x64" and msan == 0', {
'conditions': [
['OS == "mac" or OS == "ios"', {
'sources': [ '<@(boringssl_mac_x86_64_sources)' ],
}],
['OS == "linux" or OS == "android"', {
'sources': [ '<@(boringssl_linux_x86_64_sources)' ],
}],
['OS == "win"', {
'sources': [ '<@(boringssl_win_x86_64_sources)' ],
# Windows' assembly is built with Yasm. The other platforms use
# the platform assembler.
'variables': {
'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/boringssl',
},
'includes': [
'../yasm/yasm_compile.gypi',
],
}],
['OS != "mac" and OS != "ios" and OS != "linux" and OS != "win" and OS != "android"', {
'defines': [ 'OPENSSL_NO_ASM' ],
}],
]
}],
['msan == 1 or (target_arch != "arm" and target_arch != "ia32" and target_arch != "x64" and target_arch != "arm64")', {
'defines': [ 'OPENSSL_NO_ASM' ],
}],
],
'include_dirs': [
'src/include',
# This is for arm_arch.h, which is needed by some asm files. Since the
# asm files are generated and kept in a different directory, they
# cannot use relative paths to find this file.
'src/crypto',
],
'direct_dependent_settings': {
'include_dirs': [
'src/include',
],
'conditions': [
['component == "shared_library"', {
'defines': [
'BORINGSSL_SHARED_LIBRARY',
],
}],
],
},
},
],
}
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is created by generate_build_files.py. Do not edit manually.
{
'variables': {
'boringssl_ssl_sources': [
'src/ssl/d1_both.c',
'src/ssl/d1_clnt.c',
'src/ssl/d1_lib.c',
'src/ssl/d1_meth.c',
'src/ssl/d1_pkt.c',
'src/ssl/d1_srtp.c',
'src/ssl/d1_srvr.c',
'src/ssl/pqueue/pqueue.c',
'src/ssl/s3_both.c',
'src/ssl/s3_clnt.c',
'src/ssl/s3_enc.c',
'src/ssl/s3_lib.c',
'src/ssl/s3_meth.c',
'src/ssl/s3_pkt.c',
'src/ssl/s3_srvr.c',
'src/ssl/ssl_aead_ctx.c',
'src/ssl/ssl_algs.c',
'src/ssl/ssl_asn1.c',
'src/ssl/ssl_cert.c',
'src/ssl/ssl_cipher.c',
'src/ssl/ssl_lib.c',
'src/ssl/ssl_rsa.c',
'src/ssl/ssl_sess.c',
'src/ssl/ssl_stat.c',
'src/ssl/ssl_txt.c',
'src/ssl/t1_enc.c',
'src/ssl/t1_lib.c',
],
'boringssl_crypto_sources': [
'err_data.c',
'src/crypto/aes/aes.c',
'src/crypto/aes/mode_wrappers.c',
'src/crypto/asn1/a_bitstr.c',
'src/crypto/asn1/a_bool.c',
'src/crypto/asn1/a_bytes.c',
'src/crypto/asn1/a_d2i_fp.c',
'src/crypto/asn1/a_dup.c',
'src/crypto/asn1/a_enum.c',
'src/crypto/asn1/a_gentm.c',
'src/crypto/asn1/a_i2d_fp.c',
'src/crypto/asn1/a_int.c',
'src/crypto/asn1/a_mbstr.c',
'src/crypto/asn1/a_object.c',
'src/crypto/asn1/a_octet.c',
'src/crypto/asn1/a_print.c',
'src/crypto/asn1/a_strnid.c',
'src/crypto/asn1/a_time.c',
'src/crypto/asn1/a_type.c',
'src/crypto/asn1/a_utctm.c',
'src/crypto/asn1/a_utf8.c',
'src/crypto/asn1/asn1_lib.c',
'src/crypto/asn1/asn1_par.c',
'src/crypto/asn1/asn_pack.c',
'src/crypto/asn1/bio_asn1.c',
'src/crypto/asn1/bio_ndef.c',
'src/crypto/asn1/f_enum.c',
'src/crypto/asn1/f_int.c',
'src/crypto/asn1/f_string.c',
'src/crypto/asn1/t_bitst.c',
'src/crypto/asn1/t_pkey.c',
'src/crypto/asn1/tasn_dec.c',
'src/crypto/asn1/tasn_enc.c',
'src/crypto/asn1/tasn_fre.c',
'src/crypto/asn1/tasn_new.c',
'src/crypto/asn1/tasn_prn.c',
'src/crypto/asn1/tasn_typ.c',
'src/crypto/asn1/tasn_utl.c',
'src/crypto/asn1/x_bignum.c',
'src/crypto/asn1/x_long.c',
'src/crypto/base64/base64.c',
'src/crypto/bio/bio.c',
'src/crypto/bio/bio_mem.c',
'src/crypto/bio/buffer.c',
'src/crypto/bio/connect.c',
'src/crypto/bio/fd.c',
'src/crypto/bio/file.c',
'src/crypto/bio/hexdump.c',
'src/crypto/bio/pair.c',
'src/crypto/bio/printf.c',
'src/crypto/bio/socket.c',
'src/crypto/bio/socket_helper.c',
'src/crypto/bn/add.c',
'src/crypto/bn/asm/x86_64-gcc.c',
'src/crypto/bn/bn.c',
'src/crypto/bn/bn_asn1.c',
'src/crypto/bn/cmp.c',
'src/crypto/bn/convert.c',
'src/crypto/bn/ctx.c',
'src/crypto/bn/div.c',
'src/crypto/bn/exponentiation.c',
'src/crypto/bn/gcd.c',
'src/crypto/bn/generic.c',
'src/crypto/bn/kronecker.c',
'src/crypto/bn/montgomery.c',
'src/crypto/bn/mul.c',
'src/crypto/bn/prime.c',
'src/crypto/bn/random.c',
'src/crypto/bn/rsaz_exp.c',
'src/crypto/bn/shift.c',
'src/crypto/bn/sqrt.c',
'src/crypto/buf/buf.c',
'src/crypto/bytestring/ber.c',
'src/crypto/bytestring/cbb.c',
'src/crypto/bytestring/cbs.c',
'src/crypto/chacha/chacha_generic.c',
'src/crypto/chacha/chacha_vec.c',
'src/crypto/cipher/aead.c',
'src/crypto/cipher/cipher.c',
'src/crypto/cipher/derive_key.c',
'src/crypto/cipher/e_aes.c',
'src/crypto/cipher/e_chacha20poly1305.c',
'src/crypto/cipher/e_des.c',
'src/crypto/cipher/e_null.c',
'src/crypto/cipher/e_rc2.c',
'src/crypto/cipher/e_rc4.c',
'src/crypto/cipher/e_ssl3.c',
'src/crypto/cipher/e_tls.c',
'src/crypto/cipher/tls_cbc.c',
'src/crypto/cmac/cmac.c',
'src/crypto/conf/conf.c',
'src/crypto/cpu-arm.c',
'src/crypto/cpu-intel.c',
'src/crypto/crypto.c',
'src/crypto/des/des.c',
'src/crypto/dh/check.c',
'src/crypto/dh/dh.c',
'src/crypto/dh/dh_asn1.c',
'src/crypto/dh/dh_impl.c',
'src/crypto/dh/params.c',
'src/crypto/digest/digest.c',
'src/crypto/digest/digests.c',
'src/crypto/directory_posix.c',
'src/crypto/directory_win.c',
'src/crypto/dsa/dsa.c',
'src/crypto/dsa/dsa_asn1.c',
'src/crypto/dsa/dsa_impl.c',
'src/crypto/ec/ec.c',
'src/crypto/ec/ec_asn1.c',
'src/crypto/ec/ec_key.c',
'src/crypto/ec/ec_montgomery.c',
'src/crypto/ec/oct.c',
'src/crypto/ec/p256-64.c',
'src/crypto/ec/simple.c',
'src/crypto/ec/util-64.c',
'src/crypto/ec/wnaf.c',
'src/crypto/ecdh/ecdh.c',
'src/crypto/ecdsa/ecdsa.c',
'src/crypto/ecdsa/ecdsa_asn1.c',
'src/crypto/engine/engine.c',
'src/crypto/err/err.c',
'src/crypto/evp/algorithm.c',
'src/crypto/evp/digestsign.c',
'src/crypto/evp/evp.c',
'src/crypto/evp/evp_asn1.c',
'src/crypto/evp/evp_ctx.c',
'src/crypto/evp/p_dsa_asn1.c',
'src/crypto/evp/p_ec.c',
'src/crypto/evp/p_ec_asn1.c',
'src/crypto/evp/p_rsa.c',
'src/crypto/evp/p_rsa_asn1.c',
'src/crypto/evp/pbkdf.c',
'src/crypto/evp/sign.c',
'src/crypto/ex_data.c',
'src/crypto/hkdf/hkdf.c',
'src/crypto/hmac/hmac.c',
'src/crypto/lhash/lhash.c',
'src/crypto/md4/md4.c',
'src/crypto/md5/md5.c',
'src/crypto/mem.c',
'src/crypto/modes/cbc.c',
'src/crypto/modes/cfb.c',
'src/crypto/modes/ctr.c',
'src/crypto/modes/gcm.c',
'src/crypto/modes/ofb.c',
'src/crypto/obj/obj.c',
'src/crypto/obj/obj_xref.c',
'src/crypto/pem/pem_all.c',
'src/crypto/pem/pem_info.c',
'src/crypto/pem/pem_lib.c',
'src/crypto/pem/pem_oth.c',
'src/crypto/pem/pem_pk8.c',
'src/crypto/pem/pem_pkey.c',
'src/crypto/pem/pem_x509.c',
'src/crypto/pem/pem_xaux.c',
'src/crypto/pkcs8/p5_pbe.c',
'src/crypto/pkcs8/p5_pbev2.c',
'src/crypto/pkcs8/p8_pkey.c',
'src/crypto/pkcs8/pkcs8.c',
'src/crypto/poly1305/poly1305.c',
'src/crypto/poly1305/poly1305_arm.c',
'src/crypto/poly1305/poly1305_vec.c',
'src/crypto/rand/hwrand.c',
'src/crypto/rand/rand.c',
'src/crypto/rand/urandom.c',
'src/crypto/rand/windows.c',
'src/crypto/rc4/rc4.c',
'src/crypto/refcount_c11.c',
'src/crypto/refcount_lock.c',
'src/crypto/rsa/blinding.c',
'src/crypto/rsa/padding.c',
'src/crypto/rsa/rsa.c',
'src/crypto/rsa/rsa_asn1.c',
'src/crypto/rsa/rsa_impl.c',
'src/crypto/sha/sha1.c',
'src/crypto/sha/sha256.c',
'src/crypto/sha/sha512.c',
'src/crypto/stack/stack.c',
'src/crypto/thread.c',
'src/crypto/thread_none.c',
'src/crypto/thread_pthread.c',
'src/crypto/thread_win.c',
'src/crypto/time_support.c',
'src/crypto/x509/a_digest.c',
'src/crypto/x509/a_sign.c',
'src/crypto/x509/a_strex.c',
'src/crypto/x509/a_verify.c',
'src/crypto/x509/asn1_gen.c',
'src/crypto/x509/by_dir.c',
'src/crypto/x509/by_file.c',
'src/crypto/x509/i2d_pr.c',
'src/crypto/x509/pkcs7.c',
'src/crypto/x509/t_crl.c',
'src/crypto/x509/t_req.c',
'src/crypto/x509/t_x509.c',
'src/crypto/x509/t_x509a.c',
'src/crypto/x509/x509.c',
'src/crypto/x509/x509_att.c',
'src/crypto/x509/x509_cmp.c',
'src/crypto/x509/x509_d2.c',
'src/crypto/x509/x509_def.c',
'src/crypto/x509/x509_ext.c',
'src/crypto/x509/x509_lu.c',
'src/crypto/x509/x509_obj.c',
'src/crypto/x509/x509_r2x.c',
'src/crypto/x509/x509_req.c',
'src/crypto/x509/x509_set.c',
'src/crypto/x509/x509_trs.c',
'src/crypto/x509/x509_txt.c',
'src/crypto/x509/x509_v3.c',
'src/crypto/x509/x509_vfy.c',
'src/crypto/x509/x509_vpm.c',
'src/crypto/x509/x509cset.c',
'src/crypto/x509/x509name.c',
'src/crypto/x509/x509rset.c',
'src/crypto/x509/x509spki.c',
'src/crypto/x509/x509type.c',
'src/crypto/x509/x_algor.c',
'src/crypto/x509/x_all.c',
'src/crypto/x509/x_attrib.c',
'src/crypto/x509/x_crl.c',
'src/crypto/x509/x_exten.c',
'src/crypto/x509/x_info.c',
'src/crypto/x509/x_name.c',
'src/crypto/x509/x_pkey.c',
'src/crypto/x509/x_pubkey.c',
'src/crypto/x509/x_req.c',
'src/crypto/x509/x_sig.c',
'src/crypto/x509/x_spki.c',
'src/crypto/x509/x_val.c',
'src/crypto/x509/x_x509.c',
'src/crypto/x509/x_x509a.c',
'src/crypto/x509v3/pcy_cache.c',
'src/crypto/x509v3/pcy_data.c',
'src/crypto/x509v3/pcy_lib.c',
'src/crypto/x509v3/pcy_map.c',
'src/crypto/x509v3/pcy_node.c',
'src/crypto/x509v3/pcy_tree.c',
'src/crypto/x509v3/v3_akey.c',
'src/crypto/x509v3/v3_akeya.c',
'src/crypto/x509v3/v3_alt.c',
'src/crypto/x509v3/v3_bcons.c',
'src/crypto/x509v3/v3_bitst.c',
'src/crypto/x509v3/v3_conf.c',
'src/crypto/x509v3/v3_cpols.c',
'src/crypto/x509v3/v3_crld.c',
'src/crypto/x509v3/v3_enum.c',
'src/crypto/x509v3/v3_extku.c',
'src/crypto/x509v3/v3_genn.c',
'src/crypto/x509v3/v3_ia5.c',
'src/crypto/x509v3/v3_info.c',
'src/crypto/x509v3/v3_int.c',
'src/crypto/x509v3/v3_lib.c',
'src/crypto/x509v3/v3_ncons.c',
'src/crypto/x509v3/v3_pci.c',
'src/crypto/x509v3/v3_pcia.c',
'src/crypto/x509v3/v3_pcons.c',
'src/crypto/x509v3/v3_pku.c',
'src/crypto/x509v3/v3_pmaps.c',
'src/crypto/x509v3/v3_prn.c',
'src/crypto/x509v3/v3_purp.c',
'src/crypto/x509v3/v3_skey.c',
'src/crypto/x509v3/v3_sxnet.c',
'src/crypto/x509v3/v3_utl.c',
],
'boringssl_linux_aarch64_sources': [
'linux-aarch64/crypto/aes/aesv8-armx64.S',
'linux-aarch64/crypto/modes/ghashv8-armx64.S',
'linux-aarch64/crypto/sha/sha1-armv8.S',
'linux-aarch64/crypto/sha/sha256-armv8.S',
'linux-aarch64/crypto/sha/sha512-armv8.S',
],
'boringssl_linux_arm_sources': [
'linux-arm/crypto/aes/aes-armv4.S',
'linux-arm/crypto/aes/aesv8-armx32.S',
'linux-arm/crypto/aes/bsaes-armv7.S',
'linux-arm/crypto/bn/armv4-mont.S',
'linux-arm/crypto/modes/ghash-armv4.S',
'linux-arm/crypto/modes/ghashv8-armx32.S',
'linux-arm/crypto/sha/sha1-armv4-large.S',
'linux-arm/crypto/sha/sha256-armv4.S',
'linux-arm/crypto/sha/sha512-armv4.S',
'src/crypto/chacha/chacha_vec_arm.S',
'src/crypto/cpu-arm-asm.S',
'src/crypto/poly1305/poly1305_arm_asm.S',
],
'boringssl_linux_x86_sources': [
'linux-x86/crypto/aes/aes-586.S',
'linux-x86/crypto/aes/aesni-x86.S',
'linux-x86/crypto/aes/vpaes-x86.S',
'linux-x86/crypto/bn/bn-586.S',
'linux-x86/crypto/bn/co-586.S',
'linux-x86/crypto/bn/x86-mont.S',
'linux-x86/crypto/cpu-x86-asm.S',
'linux-x86/crypto/md5/md5-586.S',
'linux-x86/crypto/modes/ghash-x86.S',
'linux-x86/crypto/rc4/rc4-586.S',
'linux-x86/crypto/sha/sha1-586.S',
'linux-x86/crypto/sha/sha256-586.S',
'linux-x86/crypto/sha/sha512-586.S',
],
'boringssl_linux_x86_64_sources': [
'linux-x86_64/crypto/aes/aes-x86_64.S',
'linux-x86_64/crypto/aes/aesni-x86_64.S',
'linux-x86_64/crypto/aes/bsaes-x86_64.S',
'linux-x86_64/crypto/aes/vpaes-x86_64.S',
'linux-x86_64/crypto/bn/rsaz-avx2.S',
'linux-x86_64/crypto/bn/rsaz-x86_64.S',
'linux-x86_64/crypto/bn/x86_64-mont.S',
'linux-x86_64/crypto/bn/x86_64-mont5.S',
'linux-x86_64/crypto/cpu-x86_64-asm.S',
'linux-x86_64/crypto/md5/md5-x86_64.S',
'linux-x86_64/crypto/modes/aesni-gcm-x86_64.S',
'linux-x86_64/crypto/modes/ghash-x86_64.S',
'linux-x86_64/crypto/rand/rdrand-x86_64.S',
'linux-x86_64/crypto/rc4/rc4-md5-x86_64.S',
'linux-x86_64/crypto/rc4/rc4-x86_64.S',
'linux-x86_64/crypto/sha/sha1-x86_64.S',
'linux-x86_64/crypto/sha/sha256-x86_64.S',
'linux-x86_64/crypto/sha/sha512-x86_64.S',
],
'boringssl_mac_x86_sources': [
'mac-x86/crypto/aes/aes-586.S',
'mac-x86/crypto/aes/aesni-x86.S',
'mac-x86/crypto/aes/vpaes-x86.S',
'mac-x86/crypto/bn/bn-586.S',
'mac-x86/crypto/bn/co-586.S',
'mac-x86/crypto/bn/x86-mont.S',
'mac-x86/crypto/cpu-x86-asm.S',
'mac-x86/crypto/md5/md5-586.S',
'mac-x86/crypto/modes/ghash-x86.S',
'mac-x86/crypto/rc4/rc4-586.S',
'mac-x86/crypto/sha/sha1-586.S',
'mac-x86/crypto/sha/sha256-586.S',
'mac-x86/crypto/sha/sha512-586.S',
],
'boringssl_mac_x86_64_sources': [
'mac-x86_64/crypto/aes/aes-x86_64.S',
'mac-x86_64/crypto/aes/aesni-x86_64.S',
'mac-x86_64/crypto/aes/bsaes-x86_64.S',
'mac-x86_64/crypto/aes/vpaes-x86_64.S',
'mac-x86_64/crypto/bn/rsaz-avx2.S',
'mac-x86_64/crypto/bn/rsaz-x86_64.S',
'mac-x86_64/crypto/bn/x86_64-mont.S',
'mac-x86_64/crypto/bn/x86_64-mont5.S',
'mac-x86_64/crypto/cpu-x86_64-asm.S',
'mac-x86_64/crypto/md5/md5-x86_64.S',
'mac-x86_64/crypto/modes/aesni-gcm-x86_64.S',
'mac-x86_64/crypto/modes/ghash-x86_64.S',
'mac-x86_64/crypto/rand/rdrand-x86_64.S',
'mac-x86_64/crypto/rc4/rc4-md5-x86_64.S',
'mac-x86_64/crypto/rc4/rc4-x86_64.S',
'mac-x86_64/crypto/sha/sha1-x86_64.S',
'mac-x86_64/crypto/sha/sha256-x86_64.S',
'mac-x86_64/crypto/sha/sha512-x86_64.S',
],
'boringssl_win_x86_sources': [
'win-x86/crypto/aes/aes-586.asm',
'win-x86/crypto/aes/aesni-x86.asm',
'win-x86/crypto/aes/vpaes-x86.asm',
'win-x86/crypto/bn/bn-586.asm',
'win-x86/crypto/bn/co-586.asm',
'win-x86/crypto/bn/x86-mont.asm',
'win-x86/crypto/cpu-x86-asm.asm',
'win-x86/crypto/md5/md5-586.asm',
'win-x86/crypto/modes/ghash-x86.asm',
'win-x86/crypto/rc4/rc4-586.asm',
'win-x86/crypto/sha/sha1-586.asm',
'win-x86/crypto/sha/sha256-586.asm',
'win-x86/crypto/sha/sha512-586.asm',
],
'boringssl_win_x86_64_sources': [
'win-x86_64/crypto/aes/aes-x86_64.asm',
'win-x86_64/crypto/aes/aesni-x86_64.asm',
'win-x86_64/crypto/aes/bsaes-x86_64.asm',
'win-x86_64/crypto/aes/vpaes-x86_64.asm',
'win-x86_64/crypto/bn/rsaz-avx2.asm',
'win-x86_64/crypto/bn/rsaz-x86_64.asm',
'win-x86_64/crypto/bn/x86_64-mont.asm',
'win-x86_64/crypto/bn/x86_64-mont5.asm',
'win-x86_64/crypto/cpu-x86_64-asm.asm',
'win-x86_64/crypto/md5/md5-x86_64.asm',
'win-x86_64/crypto/modes/aesni-gcm-x86_64.asm',
'win-x86_64/crypto/modes/ghash-x86_64.asm',
'win-x86_64/crypto/rand/rdrand-x86_64.asm',
'win-x86_64/crypto/rc4/rc4-md5-x86_64.asm',
'win-x86_64/crypto/rc4/rc4-x86_64.asm',
'win-x86_64/crypto/sha/sha1-x86_64.asm',
'win-x86_64/crypto/sha/sha256-x86_64.asm',
'win-x86_64/crypto/sha/sha512-x86_64.asm',
],
}
}
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'../../native_client/build/untrusted.gypi',
],
'targets': [
{
'target_name': 'boringssl_nacl',
'type': 'none',
'variables': {
'nlib_target': 'libboringssl_nacl.a',
'build_glibc': 0,
'build_newlib': 0,
'build_pnacl_newlib': 1,
},
'dependencies': [
'<(DEPTH)/native_client_sdk/native_client_sdk_untrusted.gyp:nacl_io_untrusted',
],
'includes': [
# Include the auto-generated gypi file.
'boringssl.gypi'
],
'sources': [
'<@(boringssl_crypto_sources)',
'<@(boringssl_ssl_sources)',
],
'defines': [
'OPENSSL_NO_ASM',
],
'include_dirs': [
'src/include',
# This is for arm_arch.h, which is needed by some asm files. Since the
# asm files are generated and kept in a different directory, they
# cannot use relative paths to find this file.
'src/crypto',
],
'direct_dependent_settings': {
'include_dirs': [
'src/include',
],
},
'pnacl_compile_flags': [
'-Wno-sometimes-uninitialized',
'-Wno-unused-variable',
],
}, # target boringssl_nacl
],
}
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'boringssl_tests.gypi',
],
'targets': [
{
'target_name': 'boringssl_unittests',
'type': 'executable',
'sources': [
'boringssl_unittest.cc',
],
'dependencies': [
'<@(boringssl_test_targets)',
'../../base/base.gyp:base',
'../../base/base.gyp:run_all_unittests',
'../../base/base.gyp:test_support_base',
'../../testing/gtest.gyp:gtest',
],
},
],
}
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is created by generate_build_files.py. Do not edit manually.
{
'targets': [
{
'target_name': 'boringssl_aes_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/aes/aes_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_base64_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/base64/base64_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_bio_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/bio/bio_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_bn_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/bn/bn_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_bytestring_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/bytestring/bytestring_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_aead_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/cipher/aead_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_cipher_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/cipher/cipher_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_cmac_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/cmac/cmac_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_constant_time_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/constant_time_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_dh_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/dh/dh_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_digest_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/digest/digest_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_dsa_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/dsa/dsa_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_ec_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/ec/ec_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_example_mul',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/ec/example_mul.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_ecdsa_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/ecdsa/ecdsa_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_err_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/err/err_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_evp_extra_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/evp/evp_extra_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_evp_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/evp/evp_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_pbkdf_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/evp/pbkdf_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_hkdf_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/hkdf/hkdf_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_hmac_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/hmac/hmac_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_lhash_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/lhash/lhash_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_gcm_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/modes/gcm_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_pkcs12_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/pkcs8/pkcs12_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_poly1305_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/poly1305/poly1305_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_refcount_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/refcount_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_rsa_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/rsa/rsa_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_thread_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/thread_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_pkcs7_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/x509/pkcs7_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_tab_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/x509v3/tab_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_v3name_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/x509v3/v3name_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_pqueue_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/ssl/pqueue/pqueue_test.c',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_ssl_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/ssl/ssl_test.cc',
'<@(boringssl_test_support_sources)',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
],
'variables': {
'boringssl_test_support_sources': [
'src/crypto/test/file_test.cc',
'src/crypto/test/malloc.cc',
],
'boringssl_test_targets': [
'boringssl_aead_test',
'boringssl_aes_test',
'boringssl_base64_test',
'boringssl_bio_test',
'boringssl_bn_test',
'boringssl_bytestring_test',
'boringssl_cipher_test',
'boringssl_cmac_test',
'boringssl_constant_time_test',
'boringssl_dh_test',
'boringssl_digest_test',
'boringssl_dsa_test',
'boringssl_ec_test',
'boringssl_ecdsa_test',
'boringssl_err_test',
'boringssl_evp_extra_test',
'boringssl_evp_test',
'boringssl_example_mul',
'boringssl_gcm_test',
'boringssl_hkdf_test',
'boringssl_hmac_test',
'boringssl_lhash_test',
'boringssl_pbkdf_test',
'boringssl_pkcs12_test',
'boringssl_pkcs7_test',
'boringssl_poly1305_test',
'boringssl_pqueue_test',
'boringssl_refcount_test',
'boringssl_rsa_test',
'boringssl_ssl_test',
'boringssl_tab_test',
'boringssl_thread_test',
'boringssl_v3name_test',
],
}
}
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdarg.h>
#include <string>
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
void TestProcess(const std::string& name,
const std::vector<base::CommandLine::StringType>& args) {
base::FilePath exe_dir;
ASSERT_TRUE(PathService::Get(base::DIR_EXE, &exe_dir));
base::FilePath test_binary =
exe_dir.AppendASCII("boringssl_" + name);
base::CommandLine cmd(test_binary);
for (size_t i = 0; i < args.size(); ++i) {
cmd.AppendArgNative(args[i]);
}
std::string output;
EXPECT_TRUE(base::GetAppOutput(cmd, &output));
// Account for Windows line endings.
base::ReplaceSubstringsAfterOffset(&output, 0, "\r\n", "\n");
const bool ok = output.size() >= 5 &&
memcmp("PASS\n", &output[output.size() - 5], 5) == 0 &&
(output.size() == 5 || output[output.size() - 6] == '\n');
EXPECT_TRUE(ok) << output;
}
void TestSimple(const std::string& name) {
std::vector<base::CommandLine::StringType> empty;
TestProcess(name, empty);
}
bool BoringSSLPath(base::FilePath* result) {
if (!PathService::Get(base::DIR_SOURCE_ROOT, result))
return false;
*result = result->Append(FILE_PATH_LITERAL("third_party"));
*result = result->Append(FILE_PATH_LITERAL("boringssl"));
*result = result->Append(FILE_PATH_LITERAL("src"));
return true;
}
bool CryptoCipherTestPath(base::FilePath *result) {
if (!BoringSSLPath(result))
return false;
*result = result->Append(FILE_PATH_LITERAL("crypto"));
*result = result->Append(FILE_PATH_LITERAL("cipher"));
*result = result->Append(FILE_PATH_LITERAL("test"));
return true;
}
} // anonymous namespace
struct AEADTest {
const base::CommandLine::CharType *name;
const base::FilePath::CharType *test_vector_filename;
};
static const AEADTest kAEADTests[] = {
{FILE_PATH_LITERAL("aes-128-gcm"),
FILE_PATH_LITERAL("aes_128_gcm_tests.txt")},
{FILE_PATH_LITERAL("aes-128-key-wrap"),
FILE_PATH_LITERAL("aes_128_key_wrap_tests.txt")},
{FILE_PATH_LITERAL("aes-256-gcm"),
FILE_PATH_LITERAL("aes_256_gcm_tests.txt")},
{FILE_PATH_LITERAL("aes-256-key-wrap"),
FILE_PATH_LITERAL("aes_256_key_wrap_tests.txt")},
{FILE_PATH_LITERAL("chacha20-poly1305"),
FILE_PATH_LITERAL("chacha20_poly1305_tests.txt")},
{FILE_PATH_LITERAL("rc4-md5-tls"),
FILE_PATH_LITERAL("rc4_md5_tls_tests.txt")},
{FILE_PATH_LITERAL("rc4-sha1-tls"),
FILE_PATH_LITERAL("rc4_sha1_tls_tests.txt")},
{FILE_PATH_LITERAL("aes-128-cbc-sha1-tls"),
FILE_PATH_LITERAL("aes_128_cbc_sha1_tls_tests.txt")},
{FILE_PATH_LITERAL("aes-128-cbc-sha1-tls-implicit-iv"),
FILE_PATH_LITERAL("aes_128_cbc_sha1_tls_implicit_iv_tests.txt")},
{FILE_PATH_LITERAL("aes-128-cbc-sha256-tls"),
FILE_PATH_LITERAL("aes_128_cbc_sha256_tls_tests.txt")},
{FILE_PATH_LITERAL("aes-256-cbc-sha1-tls"),
FILE_PATH_LITERAL("aes_256_cbc_sha1_tls_tests.txt")},
{FILE_PATH_LITERAL("aes-256-cbc-sha1-tls-implicit-iv"),
FILE_PATH_LITERAL("aes_256_cbc_sha1_tls_implicit_iv_tests.txt")},
{FILE_PATH_LITERAL("aes-256-cbc-sha256-tls"),
FILE_PATH_LITERAL("aes_256_cbc_sha256_tls_tests.txt")},
{FILE_PATH_LITERAL("aes-256-cbc-sha384-tls"),
FILE_PATH_LITERAL("aes_256_cbc_sha384_tls_tests.txt")},
{FILE_PATH_LITERAL("des-ede3-cbc-sha1-tls"),
FILE_PATH_LITERAL("des_ede3_cbc_sha1_tls_tests.txt")},
{FILE_PATH_LITERAL("des-ede3-cbc-sha1-tls-implicit-iv"),
FILE_PATH_LITERAL("des_ede3_cbc_sha1_tls_implicit_iv_tests.txt")},
{FILE_PATH_LITERAL("rc4-md5-ssl3"),
FILE_PATH_LITERAL("rc4_md5_ssl3_tests.txt")},
{FILE_PATH_LITERAL("rc4-sha1-ssl3"),
FILE_PATH_LITERAL("rc4_sha1_ssl3_tests.txt")},
{FILE_PATH_LITERAL("aes-128-cbc-sha1-ssl3"),
FILE_PATH_LITERAL("aes_128_cbc_sha1_ssl3_tests.txt")},
{FILE_PATH_LITERAL("aes-256-cbc-sha1-ssl3"),
FILE_PATH_LITERAL("aes_256_cbc_sha1_ssl3_tests.txt")},
{FILE_PATH_LITERAL("des-ede3-cbc-sha1-ssl3"),
FILE_PATH_LITERAL("des_ede3_cbc_sha1_ssl3_tests.txt")},
{FILE_PATH_LITERAL("aes-128-ctr-hmac-sha256"),
FILE_PATH_LITERAL("aes_128_ctr_hmac_sha256.txt")},
{FILE_PATH_LITERAL("aes-256-ctr-hmac-sha256"),
FILE_PATH_LITERAL("aes_256_ctr_hmac_sha256.txt")},
};
TEST(BoringSSL, AEADs) {
base::FilePath test_vector_dir;
ASSERT_TRUE(CryptoCipherTestPath(&test_vector_dir));
for (size_t i = 0; i < arraysize(kAEADTests); i++) {
const AEADTest& test = kAEADTests[i];
SCOPED_TRACE(test.name);
base::FilePath test_vector_file =
test_vector_dir.Append(test.test_vector_filename);
std::vector<base::CommandLine::StringType> args;
args.push_back(test.name);
args.push_back(test_vector_file.value());
TestProcess("aead_test", args);
}
}
TEST(BoringSSL, AES) {
TestSimple("aes_test");
}
TEST(BoringSSL, Base64) {
TestSimple("base64_test");
}
TEST(BoringSSL, BIO) {
TestSimple("bio_test");
}
TEST(BoringSSL, BN) {
TestSimple("bn_test");
}
TEST(BoringSSL, ByteString) {
TestSimple("bytestring_test");
}
TEST(BoringSSL, Cipher) {
base::FilePath data_file;
ASSERT_TRUE(CryptoCipherTestPath(&data_file));
data_file = data_file.Append(FILE_PATH_LITERAL("cipher_test.txt"));
std::vector<base::CommandLine::StringType> args;
args.push_back(data_file.value());
TestProcess("cipher_test", args);
}
TEST(BoringSSL, CMAC) {
TestSimple("cmac_test");
}
TEST(BoringSSL, ConstantTime) {
TestSimple("constant_time_test");
}
TEST(BoringSSL, DH) {
TestSimple("dh_test");
}
TEST(BoringSSL, Digest) {
TestSimple("digest_test");
}
TEST(BoringSSL, DSA) {
TestSimple("dsa_test");
}
TEST(BoringSSL, EC) {
TestSimple("ec_test");
}
TEST(BoringSSL, ECDSA) {
TestSimple("ecdsa_test");
}
TEST(BoringSSL, ERR) {
TestSimple("err_test");
}
TEST(BoringSSL, EVP) {
base::FilePath data_file;
ASSERT_TRUE(BoringSSLPath(&data_file));
data_file = data_file.Append(FILE_PATH_LITERAL("crypto"));
data_file = data_file.Append(FILE_PATH_LITERAL("evp"));
data_file = data_file.Append(FILE_PATH_LITERAL("evp_tests.txt"));
std::vector<base::CommandLine::StringType> args;
args.push_back(data_file.value());
TestProcess("evp_test", args);
}
TEST(BoringSSL, EVPExtra) {
TestSimple("evp_extra_test");
}
TEST(BoringSSL, ExampleMul) {
TestSimple("example_mul");
}
TEST(BoringSSL, GCM) {
TestSimple("gcm_test");
}
TEST(BoringSSL, HKDF) {
TestSimple("hkdf_test");
}
TEST(BoringSSL, HMAC) {
base::FilePath data_file;
ASSERT_TRUE(BoringSSLPath(&data_file));
data_file = data_file.Append(FILE_PATH_LITERAL("crypto"));
data_file = data_file.Append(FILE_PATH_LITERAL("hmac"));
data_file = data_file.Append(FILE_PATH_LITERAL("hmac_tests.txt"));
std::vector<base::CommandLine::StringType> args;
args.push_back(data_file.value());
TestProcess("hmac_test", args);
}
TEST(BoringSSL, LH) {
TestSimple("lhash_test");
}
TEST(BoringSSL, PBKDF) {
TestSimple("pbkdf_test");
}
TEST(BoringSSL, Poly1305) {
base::FilePath data_file;
ASSERT_TRUE(BoringSSLPath(&data_file));
data_file = data_file.Append(FILE_PATH_LITERAL("crypto"));
data_file = data_file.Append(FILE_PATH_LITERAL("poly1305"));
data_file = data_file.Append(FILE_PATH_LITERAL("poly1305_test.txt"));
std::vector<base::CommandLine::StringType> args;
args.push_back(data_file.value());
TestProcess("poly1305_test", args);
}
TEST(BoringSSL, PKCS7) {
TestSimple("pkcs7_test");
}
TEST(BoringSSL, PKCS12) {
TestSimple("pkcs12_test");
}
TEST(BoringSSL, PQueue) {
TestSimple("pqueue_test");
}
TEST(BoringSSL, RefcountTest) {
TestSimple("refcount_test");
}
TEST(BoringSSL, RSA) {
TestSimple("rsa_test");
}
TEST(BoringSSL, SSL) {
TestSimple("ssl_test");
}
TEST(BoringSSL, TabTest) {
TestSimple("tab_test");
}
TEST(BoringSSL, Thread) {
TestSimple("thread_test");
}
TEST(BoringSSL, V3NameTest) {
TestSimple("v3name_test");
}
此差异已折叠。
#if defined(__aarch64__)
#include "arm_arch.h"
#if __ARM_MAX_ARCH__>=7
.text
#if !defined(__clang__)
.arch armv8-a+crypto
#endif
.align 5
.Lrcon:
.long 0x01,0x01,0x01,0x01
.long 0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d // rotate-n-splat
.long 0x1b,0x1b,0x1b,0x1b
.globl aes_v8_set_encrypt_key
.type aes_v8_set_encrypt_key,%function
.align 5
aes_v8_set_encrypt_key:
.Lenc_key:
stp x29,x30,[sp,#-16]!
add x29,sp,#0
mov x3,#-1
cmp x0,#0
b.eq .Lenc_key_abort
cmp x2,#0
b.eq .Lenc_key_abort
mov x3,#-2
cmp w1,#128
b.lt .Lenc_key_abort
cmp w1,#256
b.gt .Lenc_key_abort
tst w1,#0x3f
b.ne .Lenc_key_abort
adr x3,.Lrcon
cmp w1,#192
eor v0.16b,v0.16b,v0.16b
ld1 {v3.16b},[x0],#16
mov w1,#8 // reuse w1
ld1 {v1.4s,v2.4s},[x3],#32
b.lt .Loop128
b.eq .L192
b .L256
.align 4
.Loop128:
tbl v6.16b,{v3.16b},v2.16b
ext v5.16b,v0.16b,v3.16b,#12
st1 {v3.4s},[x2],#16
aese v6.16b,v0.16b
subs w1,w1,#1
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v6.16b,v6.16b,v1.16b
eor v3.16b,v3.16b,v5.16b
shl v1.16b,v1.16b,#1
eor v3.16b,v3.16b,v6.16b
b.ne .Loop128
ld1 {v1.4s},[x3]
tbl v6.16b,{v3.16b},v2.16b
ext v5.16b,v0.16b,v3.16b,#12
st1 {v3.4s},[x2],#16
aese v6.16b,v0.16b
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v6.16b,v6.16b,v1.16b
eor v3.16b,v3.16b,v5.16b
shl v1.16b,v1.16b,#1
eor v3.16b,v3.16b,v6.16b
tbl v6.16b,{v3.16b},v2.16b
ext v5.16b,v0.16b,v3.16b,#12
st1 {v3.4s},[x2],#16
aese v6.16b,v0.16b
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v6.16b,v6.16b,v1.16b
eor v3.16b,v3.16b,v5.16b
eor v3.16b,v3.16b,v6.16b
st1 {v3.4s},[x2]
add x2,x2,#0x50
mov w12,#10
b .Ldone
.align 4
.L192:
ld1 {v4.8b},[x0],#8
movi v6.16b,#8 // borrow v6.16b
st1 {v3.4s},[x2],#16
sub v2.16b,v2.16b,v6.16b // adjust the mask
.Loop192:
tbl v6.16b,{v4.16b},v2.16b
ext v5.16b,v0.16b,v3.16b,#12
st1 {v4.8b},[x2],#8
aese v6.16b,v0.16b
subs w1,w1,#1
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
dup v5.4s,v3.s[3]
eor v5.16b,v5.16b,v4.16b
eor v6.16b,v6.16b,v1.16b
ext v4.16b,v0.16b,v4.16b,#12
shl v1.16b,v1.16b,#1
eor v4.16b,v4.16b,v5.16b
eor v3.16b,v3.16b,v6.16b
eor v4.16b,v4.16b,v6.16b
st1 {v3.4s},[x2],#16
b.ne .Loop192
mov w12,#12
add x2,x2,#0x20
b .Ldone
.align 4
.L256:
ld1 {v4.16b},[x0]
mov w1,#7
mov w12,#14
st1 {v3.4s},[x2],#16
.Loop256:
tbl v6.16b,{v4.16b},v2.16b
ext v5.16b,v0.16b,v3.16b,#12
st1 {v4.4s},[x2],#16
aese v6.16b,v0.16b
subs w1,w1,#1
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v3.16b,v3.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v6.16b,v6.16b,v1.16b
eor v3.16b,v3.16b,v5.16b
shl v1.16b,v1.16b,#1
eor v3.16b,v3.16b,v6.16b
st1 {v3.4s},[x2],#16
b.eq .Ldone
dup v6.4s,v3.s[3] // just splat
ext v5.16b,v0.16b,v4.16b,#12
aese v6.16b,v0.16b
eor v4.16b,v4.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v4.16b,v4.16b,v5.16b
ext v5.16b,v0.16b,v5.16b,#12
eor v4.16b,v4.16b,v5.16b
eor v4.16b,v4.16b,v6.16b
b .Loop256
.Ldone:
str w12,[x2]
mov x3,#0
.Lenc_key_abort:
mov x0,x3 // return value
ldr x29,[sp],#16
ret
.size aes_v8_set_encrypt_key,.-aes_v8_set_encrypt_key
.globl aes_v8_set_decrypt_key
.type aes_v8_set_decrypt_key,%function
.align 5
aes_v8_set_decrypt_key:
stp x29,x30,[sp,#-16]!
add x29,sp,#0
bl .Lenc_key
cmp x0,#0
b.ne .Ldec_key_abort
sub x2,x2,#240 // restore original x2
mov x4,#-16
add x0,x2,x12,lsl#4 // end of key schedule
ld1 {v0.4s},[x2]
ld1 {v1.4s},[x0]
st1 {v0.4s},[x0],x4
st1 {v1.4s},[x2],#16
.Loop_imc:
ld1 {v0.4s},[x2]
ld1 {v1.4s},[x0]
aesimc v0.16b,v0.16b
aesimc v1.16b,v1.16b
st1 {v0.4s},[x0],x4
st1 {v1.4s},[x2],#16
cmp x0,x2
b.hi .Loop_imc
ld1 {v0.4s},[x2]
aesimc v0.16b,v0.16b
st1 {v0.4s},[x0]
eor x0,x0,x0 // return value
.Ldec_key_abort:
ldp x29,x30,[sp],#16
ret
.size aes_v8_set_decrypt_key,.-aes_v8_set_decrypt_key
.globl aes_v8_encrypt
.type aes_v8_encrypt,%function
.align 5
aes_v8_encrypt:
ldr w3,[x2,#240]
ld1 {v0.4s},[x2],#16
ld1 {v2.16b},[x0]
sub w3,w3,#2
ld1 {v1.4s},[x2],#16
.Loop_enc:
aese v2.16b,v0.16b
aesmc v2.16b,v2.16b
ld1 {v0.4s},[x2],#16
subs w3,w3,#2
aese v2.16b,v1.16b
aesmc v2.16b,v2.16b
ld1 {v1.4s},[x2],#16
b.gt .Loop_enc
aese v2.16b,v0.16b
aesmc v2.16b,v2.16b
ld1 {v0.4s},[x2]
aese v2.16b,v1.16b
eor v2.16b,v2.16b,v0.16b
st1 {v2.16b},[x1]
ret
.size aes_v8_encrypt,.-aes_v8_encrypt
.globl aes_v8_decrypt
.type aes_v8_decrypt,%function
.align 5
aes_v8_decrypt:
ldr w3,[x2,#240]
ld1 {v0.4s},[x2],#16
ld1 {v2.16b},[x0]
sub w3,w3,#2
ld1 {v1.4s},[x2],#16
.Loop_dec:
aesd v2.16b,v0.16b
aesimc v2.16b,v2.16b
ld1 {v0.4s},[x2],#16
subs w3,w3,#2
aesd v2.16b,v1.16b
aesimc v2.16b,v2.16b
ld1 {v1.4s},[x2],#16
b.gt .Loop_dec
aesd v2.16b,v0.16b
aesimc v2.16b,v2.16b
ld1 {v0.4s},[x2]
aesd v2.16b,v1.16b
eor v2.16b,v2.16b,v0.16b
st1 {v2.16b},[x1]
ret
.size aes_v8_decrypt,.-aes_v8_decrypt
.globl aes_v8_cbc_encrypt
.type aes_v8_cbc_encrypt,%function
.align 5
aes_v8_cbc_encrypt:
stp x29,x30,[sp,#-16]!
add x29,sp,#0
subs x2,x2,#16
mov x8,#16
b.lo .Lcbc_abort
csel x8,xzr,x8,eq
cmp w5,#0 // en- or decrypting?
ldr w5,[x3,#240]
and x2,x2,#-16
ld1 {v6.16b},[x4]
ld1 {v0.16b},[x0],x8
ld1 {v16.4s,v17.4s},[x3] // load key schedule...
sub w5,w5,#6
add x7,x3,x5,lsl#4 // pointer to last 7 round keys
sub w5,w5,#2
ld1 {v18.4s,v19.4s},[x7],#32
ld1 {v20.4s,v21.4s},[x7],#32
ld1 {v22.4s,v23.4s},[x7],#32
ld1 {v7.4s},[x7]
add x7,x3,#32
mov w6,w5
b.eq .Lcbc_dec
cmp w5,#2
eor v0.16b,v0.16b,v6.16b
eor v5.16b,v16.16b,v7.16b
b.eq .Lcbc_enc128
ld1 {v2.4s,v3.4s},[x7]
add x7,x3,#16
add x6,x3,#16*4
add x12,x3,#16*5
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
add x14,x3,#16*6
add x3,x3,#16*7
b .Lenter_cbc_enc
.align 4
.Loop_cbc_enc:
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
st1 {v6.16b},[x1],#16
.Lenter_cbc_enc:
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
aese v0.16b,v2.16b
aesmc v0.16b,v0.16b
ld1 {v16.4s},[x6]
cmp w5,#4
aese v0.16b,v3.16b
aesmc v0.16b,v0.16b
ld1 {v17.4s},[x12]
b.eq .Lcbc_enc192
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
ld1 {v16.4s},[x14]
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
ld1 {v17.4s},[x3]
nop
.Lcbc_enc192:
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
subs x2,x2,#16
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
csel x8,xzr,x8,eq
aese v0.16b,v18.16b
aesmc v0.16b,v0.16b
aese v0.16b,v19.16b
aesmc v0.16b,v0.16b
ld1 {v16.16b},[x0],x8
aese v0.16b,v20.16b
aesmc v0.16b,v0.16b
eor v16.16b,v16.16b,v5.16b
aese v0.16b,v21.16b
aesmc v0.16b,v0.16b
ld1 {v17.4s},[x7] // re-pre-load rndkey[1]
aese v0.16b,v22.16b
aesmc v0.16b,v0.16b
aese v0.16b,v23.16b
eor v6.16b,v0.16b,v7.16b
b.hs .Loop_cbc_enc
st1 {v6.16b},[x1],#16
b .Lcbc_done
.align 5
.Lcbc_enc128:
ld1 {v2.4s,v3.4s},[x7]
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
b .Lenter_cbc_enc128
.Loop_cbc_enc128:
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
st1 {v6.16b},[x1],#16
.Lenter_cbc_enc128:
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
subs x2,x2,#16
aese v0.16b,v2.16b
aesmc v0.16b,v0.16b
csel x8,xzr,x8,eq
aese v0.16b,v3.16b
aesmc v0.16b,v0.16b
aese v0.16b,v18.16b
aesmc v0.16b,v0.16b
aese v0.16b,v19.16b
aesmc v0.16b,v0.16b
ld1 {v16.16b},[x0],x8
aese v0.16b,v20.16b
aesmc v0.16b,v0.16b
aese v0.16b,v21.16b
aesmc v0.16b,v0.16b
aese v0.16b,v22.16b
aesmc v0.16b,v0.16b
eor v16.16b,v16.16b,v5.16b
aese v0.16b,v23.16b
eor v6.16b,v0.16b,v7.16b
b.hs .Loop_cbc_enc128
st1 {v6.16b},[x1],#16
b .Lcbc_done
.align 5
.Lcbc_dec:
ld1 {v18.16b},[x0],#16
subs x2,x2,#32 // bias
add w6,w5,#2
orr v3.16b,v0.16b,v0.16b
orr v1.16b,v0.16b,v0.16b
orr v19.16b,v18.16b,v18.16b
b.lo .Lcbc_dec_tail
orr v1.16b,v18.16b,v18.16b
ld1 {v18.16b},[x0],#16
orr v2.16b,v0.16b,v0.16b
orr v3.16b,v1.16b,v1.16b
orr v19.16b,v18.16b,v18.16b
.Loop3x_cbc_dec:
aesd v0.16b,v16.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v16.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v16.16b
aesimc v18.16b,v18.16b
ld1 {v16.4s},[x7],#16
subs w6,w6,#2
aesd v0.16b,v17.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v17.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v17.16b
aesimc v18.16b,v18.16b
ld1 {v17.4s},[x7],#16
b.gt .Loop3x_cbc_dec
aesd v0.16b,v16.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v16.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v16.16b
aesimc v18.16b,v18.16b
eor v4.16b,v6.16b,v7.16b
subs x2,x2,#0x30
eor v5.16b,v2.16b,v7.16b
csel x6,x2,x6,lo // x6, w6, is zero at this point
aesd v0.16b,v17.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v17.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v17.16b
aesimc v18.16b,v18.16b
eor v17.16b,v3.16b,v7.16b
add x0,x0,x6 // x0 is adjusted in such way that
// at exit from the loop v1.16b-v18.16b
// are loaded with last "words"
orr v6.16b,v19.16b,v19.16b
mov x7,x3
aesd v0.16b,v20.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v20.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v20.16b
aesimc v18.16b,v18.16b
ld1 {v2.16b},[x0],#16
aesd v0.16b,v21.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v21.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v21.16b
aesimc v18.16b,v18.16b
ld1 {v3.16b},[x0],#16
aesd v0.16b,v22.16b
aesimc v0.16b,v0.16b
aesd v1.16b,v22.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v22.16b
aesimc v18.16b,v18.16b
ld1 {v19.16b},[x0],#16
aesd v0.16b,v23.16b
aesd v1.16b,v23.16b
aesd v18.16b,v23.16b
ld1 {v16.4s},[x7],#16 // re-pre-load rndkey[0]
add w6,w5,#2
eor v4.16b,v4.16b,v0.16b
eor v5.16b,v5.16b,v1.16b
eor v18.16b,v18.16b,v17.16b
ld1 {v17.4s},[x7],#16 // re-pre-load rndkey[1]
st1 {v4.16b},[x1],#16
orr v0.16b,v2.16b,v2.16b
st1 {v5.16b},[x1],#16
orr v1.16b,v3.16b,v3.16b
st1 {v18.16b},[x1],#16
orr v18.16b,v19.16b,v19.16b
b.hs .Loop3x_cbc_dec
cmn x2,#0x30
b.eq .Lcbc_done
nop
.Lcbc_dec_tail:
aesd v1.16b,v16.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v16.16b
aesimc v18.16b,v18.16b
ld1 {v16.4s},[x7],#16
subs w6,w6,#2
aesd v1.16b,v17.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v17.16b
aesimc v18.16b,v18.16b
ld1 {v17.4s},[x7],#16
b.gt .Lcbc_dec_tail
aesd v1.16b,v16.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v16.16b
aesimc v18.16b,v18.16b
aesd v1.16b,v17.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v17.16b
aesimc v18.16b,v18.16b
aesd v1.16b,v20.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v20.16b
aesimc v18.16b,v18.16b
cmn x2,#0x20
aesd v1.16b,v21.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v21.16b
aesimc v18.16b,v18.16b
eor v5.16b,v6.16b,v7.16b
aesd v1.16b,v22.16b
aesimc v1.16b,v1.16b
aesd v18.16b,v22.16b
aesimc v18.16b,v18.16b
eor v17.16b,v3.16b,v7.16b
aesd v1.16b,v23.16b
aesd v18.16b,v23.16b
b.eq .Lcbc_dec_one
eor v5.16b,v5.16b,v1.16b
eor v17.16b,v17.16b,v18.16b
orr v6.16b,v19.16b,v19.16b
st1 {v5.16b},[x1],#16
st1 {v17.16b},[x1],#16
b .Lcbc_done
.Lcbc_dec_one:
eor v5.16b,v5.16b,v18.16b
orr v6.16b,v19.16b,v19.16b
st1 {v5.16b},[x1],#16
.Lcbc_done:
st1 {v6.16b},[x4]
.Lcbc_abort:
ldr x29,[sp],#16
ret
.size aes_v8_cbc_encrypt,.-aes_v8_cbc_encrypt
.globl aes_v8_ctr32_encrypt_blocks
.type aes_v8_ctr32_encrypt_blocks,%function
.align 5
aes_v8_ctr32_encrypt_blocks:
stp x29,x30,[sp,#-16]!
add x29,sp,#0
ldr w5,[x3,#240]
ldr w8, [x4, #12]
ld1 {v0.4s},[x4]
ld1 {v16.4s,v17.4s},[x3] // load key schedule...
sub w5,w5,#4
mov x12,#16
cmp x2,#2
add x7,x3,x5,lsl#4 // pointer to last 5 round keys
sub w5,w5,#2
ld1 {v20.4s,v21.4s},[x7],#32
ld1 {v22.4s,v23.4s},[x7],#32
ld1 {v7.4s},[x7]
add x7,x3,#32
mov w6,w5
csel x12,xzr,x12,lo
#ifndef __ARMEB__
rev w8, w8
#endif
orr v1.16b,v0.16b,v0.16b
add w10, w8, #1
orr v18.16b,v0.16b,v0.16b
add w8, w8, #2
orr v6.16b,v0.16b,v0.16b
rev w10, w10
mov v1.s[3],w10
b.ls .Lctr32_tail
rev w12, w8
sub x2,x2,#3 // bias
mov v18.s[3],w12
b .Loop3x_ctr32
.align 4
.Loop3x_ctr32:
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
aese v1.16b,v16.16b
aesmc v1.16b,v1.16b
aese v18.16b,v16.16b
aesmc v18.16b,v18.16b
ld1 {v16.4s},[x7],#16
subs w6,w6,#2
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
aese v1.16b,v17.16b
aesmc v1.16b,v1.16b
aese v18.16b,v17.16b
aesmc v18.16b,v18.16b
ld1 {v17.4s},[x7],#16
b.gt .Loop3x_ctr32
aese v0.16b,v16.16b
aesmc v4.16b,v0.16b
aese v1.16b,v16.16b
aesmc v5.16b,v1.16b
ld1 {v2.16b},[x0],#16
orr v0.16b,v6.16b,v6.16b
aese v18.16b,v16.16b
aesmc v18.16b,v18.16b
ld1 {v3.16b},[x0],#16
orr v1.16b,v6.16b,v6.16b
aese v4.16b,v17.16b
aesmc v4.16b,v4.16b
aese v5.16b,v17.16b
aesmc v5.16b,v5.16b
ld1 {v19.16b},[x0],#16
mov x7,x3
aese v18.16b,v17.16b
aesmc v17.16b,v18.16b
orr v18.16b,v6.16b,v6.16b
add w9,w8,#1
aese v4.16b,v20.16b
aesmc v4.16b,v4.16b
aese v5.16b,v20.16b
aesmc v5.16b,v5.16b
eor v2.16b,v2.16b,v7.16b
add w10,w8,#2
aese v17.16b,v20.16b
aesmc v17.16b,v17.16b
eor v3.16b,v3.16b,v7.16b
add w8,w8,#3
aese v4.16b,v21.16b
aesmc v4.16b,v4.16b
aese v5.16b,v21.16b
aesmc v5.16b,v5.16b
eor v19.16b,v19.16b,v7.16b
rev w9,w9
aese v17.16b,v21.16b
aesmc v17.16b,v17.16b
mov v0.s[3], w9
rev w10,w10
aese v4.16b,v22.16b
aesmc v4.16b,v4.16b
aese v5.16b,v22.16b
aesmc v5.16b,v5.16b
mov v1.s[3], w10
rev w12,w8
aese v17.16b,v22.16b
aesmc v17.16b,v17.16b
mov v18.s[3], w12
subs x2,x2,#3
aese v4.16b,v23.16b
aese v5.16b,v23.16b
aese v17.16b,v23.16b
eor v2.16b,v2.16b,v4.16b
ld1 {v16.4s},[x7],#16 // re-pre-load rndkey[0]
st1 {v2.16b},[x1],#16
eor v3.16b,v3.16b,v5.16b
mov w6,w5
st1 {v3.16b},[x1],#16
eor v19.16b,v19.16b,v17.16b
ld1 {v17.4s},[x7],#16 // re-pre-load rndkey[1]
st1 {v19.16b},[x1],#16
b.hs .Loop3x_ctr32
adds x2,x2,#3
b.eq .Lctr32_done
cmp x2,#1
mov x12,#16
csel x12,xzr,x12,eq
.Lctr32_tail:
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
aese v1.16b,v16.16b
aesmc v1.16b,v1.16b
ld1 {v16.4s},[x7],#16
subs w6,w6,#2
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
aese v1.16b,v17.16b
aesmc v1.16b,v1.16b
ld1 {v17.4s},[x7],#16
b.gt .Lctr32_tail
aese v0.16b,v16.16b
aesmc v0.16b,v0.16b
aese v1.16b,v16.16b
aesmc v1.16b,v1.16b
aese v0.16b,v17.16b
aesmc v0.16b,v0.16b
aese v1.16b,v17.16b
aesmc v1.16b,v1.16b
ld1 {v2.16b},[x0],x12
aese v0.16b,v20.16b
aesmc v0.16b,v0.16b
aese v1.16b,v20.16b
aesmc v1.16b,v1.16b
ld1 {v3.16b},[x0]
aese v0.16b,v21.16b
aesmc v0.16b,v0.16b
aese v1.16b,v21.16b
aesmc v1.16b,v1.16b
eor v2.16b,v2.16b,v7.16b
aese v0.16b,v22.16b
aesmc v0.16b,v0.16b
aese v1.16b,v22.16b
aesmc v1.16b,v1.16b
eor v3.16b,v3.16b,v7.16b
aese v0.16b,v23.16b
aese v1.16b,v23.16b
cmp x2,#1
eor v2.16b,v2.16b,v0.16b
eor v3.16b,v3.16b,v1.16b
st1 {v2.16b},[x1],#16
b.eq .Lctr32_done
st1 {v3.16b},[x1]
.Lctr32_done:
ldr x29,[sp],#16
ret
.size aes_v8_ctr32_encrypt_blocks,.-aes_v8_ctr32_encrypt_blocks
#endif
#endif
\ No newline at end of file
#if defined(__aarch64__)
#include "arm_arch.h"
.text
#if !defined(__clang__)
.arch armv8-a+crypto
#endif
.globl gcm_init_v8
.type gcm_init_v8,%function
.align 4
gcm_init_v8:
ld1 {v17.2d},[x1] //load input H
movi v19.16b,#0xe1
shl v19.2d,v19.2d,#57 //0xc2.0
ext v3.16b,v17.16b,v17.16b,#8
ushr v18.2d,v19.2d,#63
dup v17.4s,v17.s[1]
ext v16.16b,v18.16b,v19.16b,#8 //t0=0xc2....01
ushr v18.2d,v3.2d,#63
sshr v17.4s,v17.4s,#31 //broadcast carry bit
and v18.16b,v18.16b,v16.16b
shl v3.2d,v3.2d,#1
ext v18.16b,v18.16b,v18.16b,#8
and v16.16b,v16.16b,v17.16b
orr v3.16b,v3.16b,v18.16b //H<<<=1
eor v20.16b,v3.16b,v16.16b //twisted H
st1 {v20.2d},[x0],#16 //store Htable[0]
//calculate H^2
ext v16.16b,v20.16b,v20.16b,#8 //Karatsuba pre-processing
pmull v0.1q,v20.1d,v20.1d
eor v16.16b,v16.16b,v20.16b
pmull2 v2.1q,v20.2d,v20.2d
pmull v1.1q,v16.1d,v16.1d
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b
eor v1.16b,v1.16b,v17.16b
eor v1.16b,v1.16b,v18.16b
pmull v18.1q,v0.1d,v19.1d //1st phase
ins v2.d[0],v1.d[1]
ins v1.d[1],v0.d[0]
eor v0.16b,v1.16b,v18.16b
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase
pmull v0.1q,v0.1d,v19.1d
eor v18.16b,v18.16b,v2.16b
eor v22.16b,v0.16b,v18.16b
ext v17.16b,v22.16b,v22.16b,#8 //Karatsuba pre-processing
eor v17.16b,v17.16b,v22.16b
ext v21.16b,v16.16b,v17.16b,#8 //pack Karatsuba pre-processed
st1 {v21.2d,v22.2d},[x0] //store Htable[1..2]
ret
.size gcm_init_v8,.-gcm_init_v8
.globl gcm_gmult_v8
.type gcm_gmult_v8,%function
.align 4
gcm_gmult_v8:
ld1 {v17.2d},[x0] //load Xi
movi v19.16b,#0xe1
ld1 {v20.2d,v21.2d},[x1] //load twisted H, ...
shl v19.2d,v19.2d,#57
#ifndef __ARMEB__
rev64 v17.16b,v17.16b
#endif
ext v3.16b,v17.16b,v17.16b,#8
pmull v0.1q,v20.1d,v3.1d //H.loXi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiXi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b
eor v1.16b,v1.16b,v17.16b
eor v1.16b,v1.16b,v18.16b
pmull v18.1q,v0.1d,v19.1d //1st phase of reduction
ins v2.d[0],v1.d[1]
ins v1.d[1],v0.d[0]
eor v0.16b,v1.16b,v18.16b
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
pmull v0.1q,v0.1d,v19.1d
eor v18.16b,v18.16b,v2.16b
eor v0.16b,v0.16b,v18.16b
#ifndef __ARMEB__
rev64 v0.16b,v0.16b
#endif
ext v0.16b,v0.16b,v0.16b,#8
st1 {v0.2d},[x0] //write out Xi
ret
.size gcm_gmult_v8,.-gcm_gmult_v8
.globl gcm_ghash_v8
.type gcm_ghash_v8,%function
.align 4
gcm_ghash_v8:
ld1 {v0.2d},[x0] //load [rotated] Xi
//"[rotated]" means that
//loaded value would have
//to be rotated in order to
//make it appear as in
//alorithm specification
subs x3,x3,#32 //see if x3 is 32 or larger
mov x12,#16 //x12 is used as post-
//increment for input pointer;
//as loop is modulo-scheduled
//x12 is zeroed just in time
//to preclude oversteping
//inp[len], which means that
//last block[s] are actually
//loaded twice, but last
//copy is not processed
ld1 {v20.2d,v21.2d},[x1],#32 //load twisted H, ..., H^2
movi v19.16b,#0xe1
ld1 {v22.2d},[x1]
csel x12,xzr,x12,eq //is it time to zero x12?
ext v0.16b,v0.16b,v0.16b,#8 //rotate Xi
ld1 {v16.2d},[x2],#16 //load [rotated] I[0]
shl v19.2d,v19.2d,#57 //compose 0xc2.0 constant
#ifndef __ARMEB__
rev64 v16.16b,v16.16b
rev64 v0.16b,v0.16b
#endif
ext v3.16b,v16.16b,v16.16b,#8 //rotate I[0]
b.lo .Lodd_tail_v8 //x3 was less than 32
ld1 {v17.2d},[x2],x12 //load [rotated] I[1]
#ifndef __ARMEB__
rev64 v17.16b,v17.16b
#endif
ext v7.16b,v17.16b,v17.16b,#8
eor v3.16b,v3.16b,v0.16b //I[i]^=Xi
pmull v4.1q,v20.1d,v7.1d //HIi+1
eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing
pmull2 v6.1q,v20.2d,v7.2d
b .Loop_mod2x_v8
.align 4
.Loop_mod2x_v8:
ext v18.16b,v3.16b,v3.16b,#8
subs x3,x3,#32 //is there more data?
pmull v0.1q,v22.1d,v3.1d //H^2.loXi.lo
csel x12,xzr,x12,lo //is it time to zero x12?
pmull v5.1q,v21.1d,v17.1d
eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v22.2d,v3.2d //H^2.hiXi.hi
eor v0.16b,v0.16b,v4.16b //accumulate
pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)(Xi.lo+Xi.hi)
ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2]
eor v2.16b,v2.16b,v6.16b
csel x12,xzr,x12,eq //is it time to zero x12?
eor v1.16b,v1.16b,v5.16b
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b
eor v1.16b,v1.16b,v17.16b
ld1 {v17.2d},[x2],x12 //load [rotated] I[i+3]
#ifndef __ARMEB__
rev64 v16.16b,v16.16b
#endif
eor v1.16b,v1.16b,v18.16b
pmull v18.1q,v0.1d,v19.1d //1st phase of reduction
#ifndef __ARMEB__
rev64 v17.16b,v17.16b
#endif
ins v2.d[0],v1.d[1]
ins v1.d[1],v0.d[0]
ext v7.16b,v17.16b,v17.16b,#8
ext v3.16b,v16.16b,v16.16b,#8
eor v0.16b,v1.16b,v18.16b
pmull v4.1q,v20.1d,v7.1d //HIi+1
eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
pmull v0.1q,v0.1d,v19.1d
eor v3.16b,v3.16b,v18.16b
eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing
eor v3.16b,v3.16b,v0.16b
pmull2 v6.1q,v20.2d,v7.2d
b.hs .Loop_mod2x_v8 //there was at least 32 more bytes
eor v2.16b,v2.16b,v18.16b
ext v3.16b,v16.16b,v16.16b,#8 //re-construct v3.16b
adds x3,x3,#32 //re-construct x3
eor v0.16b,v0.16b,v2.16b //re-construct v0.16b
b.eq .Ldone_v8 //is x3 zero?
.Lodd_tail_v8:
ext v18.16b,v0.16b,v0.16b,#8
eor v3.16b,v3.16b,v0.16b //inp^=Xi
eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi
pmull v0.1q,v20.1d,v3.1d //H.loXi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiXi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b
eor v1.16b,v1.16b,v17.16b
eor v1.16b,v1.16b,v18.16b
pmull v18.1q,v0.1d,v19.1d //1st phase of reduction
ins v2.d[0],v1.d[1]
ins v1.d[1],v0.d[0]
eor v0.16b,v1.16b,v18.16b
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
pmull v0.1q,v0.1d,v19.1d
eor v18.16b,v18.16b,v2.16b
eor v0.16b,v0.16b,v18.16b
.Ldone_v8:
#ifndef __ARMEB__
rev64 v0.16b,v0.16b
#endif
ext v0.16b,v0.16b,v0.16b,#8
st1 {v0.2d},[x0] //write out Xi
ret
.size gcm_ghash_v8,.-gcm_ghash_v8
.byte 71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.align 2
.align 2
#endif
\ No newline at end of file
#if defined(__arm__)
#include "arm_arch.h"
.text
.fpu neon
.code 32
.globl gcm_init_v8
.type gcm_init_v8,%function
.align 4
gcm_init_v8:
vld1.64 {q9},[r1] @ load input H
vmov.i8 q11,#0xe1
vshl.i64 q11,q11,#57 @ 0xc2.0
vext.8 q3,q9,q9,#8
vshr.u64 q10,q11,#63
vdup.32 q9,d18[1]
vext.8 q8,q10,q11,#8 @ t0=0xc2....01
vshr.u64 q10,q3,#63
vshr.s32 q9,q9,#31 @ broadcast carry bit
vand q10,q10,q8
vshl.i64 q3,q3,#1
vext.8 q10,q10,q10,#8
vand q8,q8,q9
vorr q3,q3,q10 @ H<<<=1
veor q12,q3,q8 @ twisted H
vst1.64 {q12},[r0]! @ store Htable[0]
@ calculate H^2
vext.8 q8,q12,q12,#8 @ Karatsuba pre-processing
.byte 0xa8,0x0e,0xa8,0xf2 @ pmull q0,q12,q12
veor q8,q8,q12
.byte 0xa9,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q12
.byte 0xa0,0x2e,0xa0,0xf2 @ pmull q1,q8,q8
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2
veor q1,q1,q9
veor q1,q1,q10
.byte 0x26,0x4e,0xe0,0xf2 @ pmull q10,q0,q11 @ 1st phase
vmov d4,d3 @ Xh|Xm - 256-bit result
vmov d3,d0 @ Xm is rotated Xl
veor q0,q1,q10
vext.8 q10,q0,q0,#8 @ 2nd phase
.byte 0x26,0x0e,0xa0,0xf2 @ pmull q0,q0,q11
veor q10,q10,q2
veor q14,q0,q10
vext.8 q9,q14,q14,#8 @ Karatsuba pre-processing
veor q9,q9,q14
vext.8 q13,q8,q9,#8 @ pack Karatsuba pre-processed
vst1.64 {q13,q14},[r0] @ store Htable[1..2]
bx lr
.size gcm_init_v8,.-gcm_init_v8
.globl gcm_gmult_v8
.type gcm_gmult_v8,%function
.align 4
gcm_gmult_v8:
vld1.64 {q9},[r0] @ load Xi
vmov.i8 q11,#0xe1
vld1.64 {q12,q13},[r1] @ load twisted H, ...
vshl.u64 q11,q11,#57
#ifndef __ARMEB__
vrev64.8 q9,q9
#endif
vext.8 q3,q9,q9,#8
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.loXi.lo
veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hiXi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2
veor q1,q1,q9
veor q1,q1,q10
.byte 0x26,0x4e,0xe0,0xf2 @ pmull q10,q0,q11 @ 1st phase of reduction
vmov d4,d3 @ Xh|Xm - 256-bit result
vmov d3,d0 @ Xm is rotated Xl
veor q0,q1,q10
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
.byte 0x26,0x0e,0xa0,0xf2 @ pmull q0,q0,q11
veor q10,q10,q2
veor q0,q0,q10
#ifndef __ARMEB__
vrev64.8 q0,q0
#endif
vext.8 q0,q0,q0,#8
vst1.64 {q0},[r0] @ write out Xi
bx lr
.size gcm_gmult_v8,.-gcm_gmult_v8
.globl gcm_ghash_v8
.type gcm_ghash_v8,%function
.align 4
gcm_ghash_v8:
vstmdb sp!,{d8,d9,d10,d11,d12,d13,d14,d15} @ 32-bit ABI says so
vld1.64 {q0},[r0] @ load [rotated] Xi
@ "[rotated]" means that
@ loaded value would have
@ to be rotated in order to
@ make it appear as in
@ alorithm specification
subs r3,r3,#32 @ see if r3 is 32 or larger
mov r12,#16 @ r12 is used as post-
@ increment for input pointer;
@ as loop is modulo-scheduled
@ r12 is zeroed just in time
@ to preclude oversteping
@ inp[len], which means that
@ last block[s] are actually
@ loaded twice, but last
@ copy is not processed
vld1.64 {q12,q13},[r1]! @ load twisted H, ..., H^2
vmov.i8 q11,#0xe1
vld1.64 {q14},[r1]
moveq r12,#0 @ is it time to zero r12?
vext.8 q0,q0,q0,#8 @ rotate Xi
vld1.64 {q8},[r2]! @ load [rotated] I[0]
vshl.u64 q11,q11,#57 @ compose 0xc2.0 constant
#ifndef __ARMEB__
vrev64.8 q8,q8
vrev64.8 q0,q0
#endif
vext.8 q3,q8,q8,#8 @ rotate I[0]
blo .Lodd_tail_v8 @ r3 was less than 32
vld1.64 {q9},[r2],r12 @ load [rotated] I[1]
#ifndef __ARMEB__
vrev64.8 q9,q9
#endif
vext.8 q7,q9,q9,#8
veor q3,q3,q0 @ I[i]^=Xi
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ HIi+1
veor q9,q9,q7 @ Karatsuba pre-processing
.byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7
b .Loop_mod2x_v8
.align 4
.Loop_mod2x_v8:
vext.8 q10,q3,q3,#8
subs r3,r3,#32 @ is there more data?
.byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.loXi.lo
movlo r12,#0 @ is it time to zero r12?
.byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9
veor q10,q10,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hiXi.hi
veor q0,q0,q4 @ accumulate
.byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)(Xi.lo+Xi.hi)
vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2]
veor q2,q2,q6
moveq r12,#0 @ is it time to zero r12?
veor q1,q1,q5
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2
veor q1,q1,q9
vld1.64 {q9},[r2],r12 @ load [rotated] I[i+3]
#ifndef __ARMEB__
vrev64.8 q8,q8
#endif
veor q1,q1,q10
.byte 0x26,0x4e,0xe0,0xf2 @ pmull q10,q0,q11 @ 1st phase of reduction
#ifndef __ARMEB__
vrev64.8 q9,q9
#endif
vmov d4,d3 @ Xh|Xm - 256-bit result
vmov d3,d0 @ Xm is rotated Xl
vext.8 q7,q9,q9,#8
vext.8 q3,q8,q8,#8
veor q0,q1,q10
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ HIi+1
veor q3,q3,q2 @ accumulate q3 early
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
.byte 0x26,0x0e,0xa0,0xf2 @ pmull q0,q0,q11
veor q3,q3,q10
veor q9,q9,q7 @ Karatsuba pre-processing
veor q3,q3,q0
.byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7
bhs .Loop_mod2x_v8 @ there was at least 32 more bytes
veor q2,q2,q10
vext.8 q3,q8,q8,#8 @ re-construct q3
adds r3,r3,#32 @ re-construct r3
veor q0,q0,q2 @ re-construct q0
beq .Ldone_v8 @ is r3 zero?
.Lodd_tail_v8:
vext.8 q10,q0,q0,#8
veor q3,q3,q0 @ inp^=Xi
veor q9,q8,q10 @ q9 is rotated inp^Xi
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.loXi.lo
veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hiXi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2
veor q1,q1,q9
veor q1,q1,q10
.byte 0x26,0x4e,0xe0,0xf2 @ pmull q10,q0,q11 @ 1st phase of reduction
vmov d4,d3 @ Xh|Xm - 256-bit result
vmov d3,d0 @ Xm is rotated Xl
veor q0,q1,q10
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
.byte 0x26,0x0e,0xa0,0xf2 @ pmull q0,q0,q11
veor q10,q10,q2
veor q0,q0,q10
.Ldone_v8:
#ifndef __ARMEB__
vrev64.8 q0,q0
#endif
vext.8 q0,q0,q0,#8
vst1.64 {q0},[r0] @ write out Xi
vldmia sp!,{d8,d9,d10,d11,d12,d13,d14,d15} @ 32-bit ABI says so
bx lr
.size gcm_ghash_v8,.-gcm_ghash_v8
.byte 71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.align 2
.align 2
#endif
\ No newline at end of file
#if defined(__x86_64__)
.text
.globl rsaz_avx2_eligible
.hidden rsaz_avx2_eligible
.type rsaz_avx2_eligible,@function
rsaz_avx2_eligible:
xorl %eax,%eax
.byte 0xf3,0xc3
.size rsaz_avx2_eligible,.-rsaz_avx2_eligible
.globl rsaz_1024_sqr_avx2
.hidden rsaz_1024_sqr_avx2
.globl rsaz_1024_mul_avx2
.hidden rsaz_1024_mul_avx2
.globl rsaz_1024_norm2red_avx2
.hidden rsaz_1024_norm2red_avx2
.globl rsaz_1024_red2norm_avx2
.hidden rsaz_1024_red2norm_avx2
.globl rsaz_1024_scatter5_avx2
.hidden rsaz_1024_scatter5_avx2
.globl rsaz_1024_gather5_avx2
.hidden rsaz_1024_gather5_avx2
.type rsaz_1024_sqr_avx2,@function
rsaz_1024_sqr_avx2:
rsaz_1024_mul_avx2:
rsaz_1024_norm2red_avx2:
rsaz_1024_red2norm_avx2:
rsaz_1024_scatter5_avx2:
rsaz_1024_gather5_avx2:
.byte 0x0f,0x0b
.byte 0xf3,0xc3
.size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2
#endif
#if defined(__x86_64__)
.text
.globl aesni_gcm_encrypt
.hidden aesni_gcm_encrypt
.type aesni_gcm_encrypt,@function
aesni_gcm_encrypt:
xorl %eax,%eax
.byte 0xf3,0xc3
.size aesni_gcm_encrypt,.-aesni_gcm_encrypt
.globl aesni_gcm_decrypt
.hidden aesni_gcm_decrypt
.type aesni_gcm_decrypt,@function
aesni_gcm_decrypt:
xorl %eax,%eax
.byte 0xf3,0xc3
.size aesni_gcm_decrypt,.-aesni_gcm_decrypt
#endif
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册