Revert BoringSSL Roll

Review URL: https://codereview.chromium.org/1938433002 .
This commit is contained in:
Zachary Anderson 2016-04-29 10:14:33 -07:00
parent 974385bb48
commit 66ea8c98d5
39 changed files with 3335 additions and 21301 deletions

2
DEPS
View file

@ -37,7 +37,7 @@ vars = {
"barback_tag" : "@0.15.2+7",
"bazel_worker_tag": "@v0.1.0",
"boolean_selector_tag" : "@1.0.0",
"boringssl_rev" : "@c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9",
"boringssl_rev" : "@daeafc22c66ad48f6b32fc8d3362eb9ba31b774e",
"charcode_tag": "@1.1.0",
"chrome_rev" : "@19997",
"cli_util_tag" : "@0.0.1+2",

View file

@ -20,7 +20,7 @@ config("internal_config") {
defines = [
"BORINGSSL_IMPLEMENTATION",
"BORINGSSL_NO_STATIC_INITIALIZER",
"OPENSSL_SMALL",
"OPENSSL_SMALL_FOOTPRINT",
]
}
@ -44,8 +44,13 @@ boringssl_sources =
source_set("boringssl_asm") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = []
#asmflags = []
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 (current_cpu == "x64") {

View file

@ -7,7 +7,6 @@
{
'variables': {
'boringssl_ssl_sources': [
'src/ssl/custom_extensions.c',
'src/ssl/d1_both.c',
'src/ssl/d1_clnt.c',
'src/ssl/d1_lib.c',
@ -15,7 +14,6 @@
'src/ssl/d1_pkt.c',
'src/ssl/d1_srtp.c',
'src/ssl/d1_srvr.c',
'src/ssl/dtls_record.c',
'src/ssl/pqueue/pqueue.c',
'src/ssl/s3_both.c',
'src/ssl/s3_clnt.c',
@ -25,19 +23,18 @@
'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_buffer.c',
'src/ssl/ssl_cert.c',
'src/ssl/ssl_cipher.c',
'src/ssl/ssl_ecdh.c',
'src/ssl/ssl_file.c',
'src/ssl/ssl_lib.c',
'src/ssl/ssl_rsa.c',
'src/ssl/ssl_session.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',
'src/ssl/tls_record.c',
'src/ssl/t1_reneg.c',
],
'boringssl_crypto_sources': [
'err_data.c',
@ -95,7 +92,6 @@
'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',
@ -112,7 +108,6 @@
'src/crypto/bn/shift.c',
'src/crypto/bn/sqrt.c',
'src/crypto/buf/buf.c',
'src/crypto/bytestring/asn1_compat.c',
'src/crypto/bytestring/ber.c',
'src/crypto/bytestring/cbb.c',
'src/crypto/bytestring/cbs.c',
@ -135,12 +130,11 @@
'src/crypto/cpu-arm.c',
'src/crypto/cpu-intel.c',
'src/crypto/crypto.c',
'src/crypto/curve25519/curve25519.c',
'src/crypto/curve25519/x25519-x86_64.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',
@ -148,14 +142,13 @@
'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/p224-64.c',
'src/crypto/ec/p256-64.c',
'src/crypto/ec/p256-x86_64.c',
'src/crypto/ec/simple.c',
'src/crypto/ec/util-64.c',
'src/crypto/ec/wnaf.c',
@ -165,9 +158,9 @@
'src/crypto/engine/engine.c',
'src/crypto/err/err.c',
'src/crypto/evp/algorithm.c',
'src/crypto/evp/asn1.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',
@ -205,6 +198,7 @@
'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',
@ -309,7 +303,6 @@
],
'boringssl_linux_aarch64_sources': [
'linux-aarch64/crypto/aes/aesv8-armx64.S',
'linux-aarch64/crypto/bn/armv8-mont.S',
'linux-aarch64/crypto/modes/ghashv8-armx64.S',
'linux-aarch64/crypto/sha/sha1-armv8.S',
'linux-aarch64/crypto/sha/sha256-armv8.S',
@ -327,7 +320,6 @@
'linux-arm/crypto/sha/sha512-armv4.S',
'src/crypto/chacha/chacha_vec_arm.S',
'src/crypto/cpu-arm-asm.S',
'src/crypto/curve25519/asm/x25519-asm-arm.S',
'src/crypto/poly1305/poly1305_arm_asm.S',
],
'boringssl_linux_x86_sources': [
@ -337,6 +329,7 @@
'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',
@ -353,16 +346,16 @@
'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/ec/p256-x86_64-asm.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',
'src/crypto/curve25519/asm/x25519-asm-x86_64.S',
],
'boringssl_mac_x86_sources': [
'mac-x86/crypto/aes/aes-586.S',
@ -371,6 +364,7 @@
'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',
@ -387,11 +381,12 @@
'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/ec/p256-x86_64-asm.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',
@ -404,6 +399,7 @@
'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',
@ -420,11 +416,12 @@
'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/ec/p256-x86_64-asm.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',

View file

@ -4,10 +4,29 @@
# This file is included to modify the configurations to build third-party
# code from BoringSSL.
# This code is C code, not C++, and is not warning-free, so we need to remove
# C++-specific flags, and add flags to supress the warnings in the code.
{
'variables': {
# Used by third_party/nss, which is from Chromium.
# Include the built-in set of root certificate authorities.
'exclude_nss_root_certs': 0,
'os_posix%': 1,
'os_bsd%': 0,
'chromeos%': 0,
'clang%': 0,
},
'target_defaults': {
'cflags': [
'-w',
'-UHAVE_CVAR_BUILT_ON_SEM',
],
# Removes these flags from the list cflags.
'cflags!': [
# NSS code from upstream mozilla builds with warnings,
# so we must allow warnings without failing.
'-Werror',
'-Wall',
'-ansi',
# Not supported for C, only for C++.
'-Wnon-virtual-dtor',
@ -16,5 +35,93 @@
'-fvisibility-inlines-hidden',
'-Woverloaded-virtual',
],
'configurations': {
'Dart_Base': {
'xcode_settings': {
'WARNING_CFLAGS': [
'-w',
],
'WARNING_CFLAGS!': [
'-Wall',
'-Wextra',
],
},
},
# Dart_Macos_Debug and Dart_Macos_Release are merged after
# Dart_Macos_Base, so we can override the 'ansi' and '-Werror' flags set
# at the global level in tools/gyp/configurations_xcode.gypi.
'Dart_Macos_Debug': {
'abstract': 1,
'xcode_settings': {
# Remove 'ansi' setting.
'GCC_C_LANGUAGE_STANDARD': 'c99',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
},
},
'Dart_Macos_Release': {
'abstract': 1,
'xcode_settings': {
# Remove 'ansi' setting.
'GCC_C_LANGUAGE_STANDARD': 'c99',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
},
},
# Disable hand-coded assembly routines on ARMv6 and ARMv5TE.
'Dart_armv6_Base': {
'abstract': 1,
'defines': [
'OPENSSL_NO_ASM',
],
},
'Dart_armv5te_Base': {
'abstract': 1,
'defines': [
'OPENSSL_NO_ASM',
],
},
# TODO(24321): Also disable temporarily on arm64. Reenable after the next
# roll.
'Dart_arm64_Base': {
'abstract': 1,
'defines': [
'OPENSSL_NO_ASM',
],
},
# Android 64-bit dbc build is for arm64, disable temporarily as well.
'Dart_Android_arm64_Base': {
'abstract': 1,
'defines': [
'OPENSSL_NO_ASM',
],
},
# When being built for Android nss expects __linux__ to be defined.
'Dart_Android_Base': {
'target_conditions': [
['_toolset=="host"', {
'defines!': [
'ANDROID',
],
# Define __linux__ on Android build for NSS.
'defines': [
'__linux__',
],
'cflags!': [
'-U__linux__',
],
}],
['_toolset=="target"', {
'defines': [
'__linux__',
'CHECK_FORK_GETPID', # Android does not provide pthread_atfork.
'__USE_LARGEFILE64',
],
# Define __linux__ on Android build for NSS.
'cflags!': [
'-U__linux__',
],
}]
],
},
},
},
}

View file

@ -22,7 +22,6 @@
'defines': [
'BORINGSSL_IMPLEMENTATION',
'BORINGSSL_NO_STATIC_INITIALIZER',
'OPENSSL_SMALL',
],
# TODO(davidben): Fix size_t truncations in BoringSSL.
# https://crbug.com/429039
@ -48,6 +47,10 @@
],
'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': [

View file

@ -6,34 +6,6 @@
{
'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_asn1_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/asn1/asn1_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',
@ -146,34 +118,6 @@
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_ed25519_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/curve25519/ed25519_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_x25519_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/curve25519/x25519_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_dh_test',
'type': 'executable',
@ -384,34 +328,6 @@
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_pkcs8_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/pkcs8/pkcs8_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',
@ -468,20 +384,6 @@
# https://crbug.com/429039
'msvs_disabled_warnings': [ 4267, ],
},
{
'target_name': 'boringssl_x509_test',
'type': 'executable',
'dependencies': [
'boringssl.gyp:boringssl',
],
'sources': [
'src/crypto/x509/x509_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_tab_test',
'type': 'executable',
@ -543,12 +445,9 @@
'boringssl_test_support_sources': [
'src/crypto/test/file_test.cc',
'src/crypto/test/malloc.cc',
'src/crypto/test/test_util.cc',
],
'boringssl_test_targets': [
'boringssl_aead_test',
'boringssl_aes_test',
'boringssl_asn1_test',
'boringssl_base64_test',
'boringssl_bio_test',
'boringssl_bn_test',
@ -561,7 +460,6 @@
'boringssl_dsa_test',
'boringssl_ec_test',
'boringssl_ecdsa_test',
'boringssl_ed25519_test',
'boringssl_err_test',
'boringssl_evp_extra_test',
'boringssl_evp_test',
@ -573,8 +471,6 @@
'boringssl_pbkdf_test',
'boringssl_pkcs12_test',
'boringssl_pkcs7_test',
'boringssl_pkcs8_test',
'boringssl_poly1305_test',
'boringssl_pqueue_test',
'boringssl_refcount_test',
'boringssl_rsa_test',
@ -582,8 +478,6 @@
'boringssl_tab_test',
'boringssl_thread_test',
'boringssl_v3name_test',
'boringssl_x25519_test',
'boringssl_x509_test',
],
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
#if defined(__aarch64__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
#if __ARM_MAX_ARCH__>=7
.text
@ -13,7 +13,6 @@
.long 0x1b,0x1b,0x1b,0x1b
.globl aes_v8_set_encrypt_key
.hidden aes_v8_set_encrypt_key
.type aes_v8_set_encrypt_key,%function
.align 5
aes_v8_set_encrypt_key:
@ -181,7 +180,6 @@ aes_v8_set_encrypt_key:
.size aes_v8_set_encrypt_key,.-aes_v8_set_encrypt_key
.globl aes_v8_set_decrypt_key
.hidden aes_v8_set_decrypt_key
.type aes_v8_set_decrypt_key,%function
.align 5
aes_v8_set_decrypt_key:
@ -221,7 +219,6 @@ aes_v8_set_decrypt_key:
ret
.size aes_v8_set_decrypt_key,.-aes_v8_set_decrypt_key
.globl aes_v8_encrypt
.hidden aes_v8_encrypt
.type aes_v8_encrypt,%function
.align 5
aes_v8_encrypt:
@ -251,7 +248,6 @@ aes_v8_encrypt:
ret
.size aes_v8_encrypt,.-aes_v8_encrypt
.globl aes_v8_decrypt
.hidden aes_v8_decrypt
.type aes_v8_decrypt,%function
.align 5
aes_v8_decrypt:
@ -281,7 +277,6 @@ aes_v8_decrypt:
ret
.size aes_v8_decrypt,.-aes_v8_decrypt
.globl aes_v8_cbc_encrypt
.hidden aes_v8_cbc_encrypt
.type aes_v8_cbc_encrypt,%function
.align 5
aes_v8_cbc_encrypt:
@ -572,7 +567,6 @@ aes_v8_cbc_encrypt:
ret
.size aes_v8_cbc_encrypt,.-aes_v8_cbc_encrypt
.globl aes_v8_ctr32_encrypt_blocks
.hidden aes_v8_ctr32_encrypt_blocks
.type aes_v8_ctr32_encrypt_blocks,%function
.align 5
aes_v8_ctr32_encrypt_blocks:
@ -754,4 +748,4 @@ aes_v8_ctr32_encrypt_blocks:
ret
.size aes_v8_ctr32_encrypt_blocks,.-aes_v8_ctr32_encrypt_blocks
#endif
#endif
#endif

View file

@ -1,12 +1,11 @@
#if defined(__aarch64__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
#if !defined(__clang__)
.arch armv8-a+crypto
#endif
.globl gcm_init_v8
.hidden gcm_init_v8
.type gcm_init_v8,%function
.align 4
gcm_init_v8:
@ -57,7 +56,6 @@ gcm_init_v8:
ret
.size gcm_init_v8,.-gcm_init_v8
.globl gcm_gmult_v8
.hidden gcm_gmult_v8
.type gcm_gmult_v8,%function
.align 4
gcm_gmult_v8:
@ -70,10 +68,10 @@ gcm_gmult_v8:
#endif
ext v3.16b,v17.16b,v17.16b,#8
pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.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
@ -99,7 +97,6 @@ gcm_gmult_v8:
ret
.size gcm_gmult_v8,.-gcm_gmult_v8
.globl gcm_ghash_v8
.hidden gcm_ghash_v8
.type gcm_ghash_v8,%function
.align 4
gcm_ghash_v8:
@ -138,7 +135,7 @@ gcm_ghash_v8:
#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 //H·Ii+1
pmull v4.1q,v20.1d,v7.1d //HˇIi+1
eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing
pmull2 v6.1q,v20.2d,v7.2d
b .Loop_mod2x_v8
@ -147,14 +144,14 @@ gcm_ghash_v8:
.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.lo·Xi.lo
pmull v0.1q,v22.1d,v3.1d //H^2.loˇXi.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.hi·Xi.hi
pmull2 v2.1q,v22.2d,v3.2d //H^2.hiˇXi.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)
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
@ -179,7 +176,7 @@ gcm_ghash_v8:
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 //H·Ii+1
pmull v4.1q,v20.1d,v7.1d //HˇIi+1
eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
@ -200,10 +197,10 @@ gcm_ghash_v8:
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.lo·Xi.lo
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.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
@ -232,4 +229,4 @@ 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
#endif

View file

@ -1,11 +1,10 @@
#if defined(__aarch64__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.globl sha1_block_data_order
.hidden sha1_block_data_order
.type sha1_block_data_order,%function
.align 6
sha1_block_data_order:
@ -1213,4 +1212,4 @@ sha1_block_armv8:
.align 2
.align 2
.comm OPENSSL_armcap_P,4,4
#endif
#endif

View file

@ -1,11 +1,10 @@
#if defined(__aarch64__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.globl sha256_block_data_order
.hidden sha256_block_data_order
.type sha256_block_data_order,%function
.align 6
sha256_block_data_order:
@ -1143,4 +1142,4 @@ sha256_block_armv8:
ret
.size sha256_block_armv8,.-sha256_block_armv8
.comm OPENSSL_armcap_P,4,4
#endif
#endif

View file

@ -1,11 +1,10 @@
#if defined(__aarch64__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.globl sha512_block_data_order
.hidden sha512_block_data_order
.type sha512_block_data_order,%function
.align 6
sha512_block_data_order:
@ -1023,4 +1022,4 @@ sha512_block_data_order:
.align 2
.align 2
.comm OPENSSL_armcap_P,4,4
#endif
#endif

View file

@ -34,7 +34,7 @@
#if defined(__arm__)
#ifndef __KERNEL__
# include <openssl/arm_arch.h>
# include "arm_arch.h"
#else
# define __ARM_ARCH__ __LINUX_ARM_ARCH__
#endif
@ -1197,4 +1197,4 @@ _armv4_AES_decrypt:
.align 2
#endif
#endif
#endif

View file

@ -1,5 +1,5 @@
#if defined(__arm__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
#if __ARM_MAX_ARCH__>=7
.text
@ -13,7 +13,6 @@
.long 0x1b,0x1b,0x1b,0x1b
.globl aes_v8_set_encrypt_key
.hidden aes_v8_set_encrypt_key
.type aes_v8_set_encrypt_key,%function
.align 5
aes_v8_set_encrypt_key:
@ -184,7 +183,6 @@ aes_v8_set_encrypt_key:
.size aes_v8_set_encrypt_key,.-aes_v8_set_encrypt_key
.globl aes_v8_set_decrypt_key
.hidden aes_v8_set_decrypt_key
.type aes_v8_set_decrypt_key,%function
.align 5
aes_v8_set_decrypt_key:
@ -222,7 +220,6 @@ aes_v8_set_decrypt_key:
ldmia sp!,{r4,pc}
.size aes_v8_set_decrypt_key,.-aes_v8_set_decrypt_key
.globl aes_v8_encrypt
.hidden aes_v8_encrypt
.type aes_v8_encrypt,%function
.align 5
aes_v8_encrypt:
@ -252,7 +249,6 @@ aes_v8_encrypt:
bx lr
.size aes_v8_encrypt,.-aes_v8_encrypt
.globl aes_v8_decrypt
.hidden aes_v8_decrypt
.type aes_v8_decrypt,%function
.align 5
aes_v8_decrypt:
@ -282,7 +278,6 @@ aes_v8_decrypt:
bx lr
.size aes_v8_decrypt,.-aes_v8_decrypt
.globl aes_v8_cbc_encrypt
.hidden aes_v8_cbc_encrypt
.type aes_v8_cbc_encrypt,%function
.align 5
aes_v8_cbc_encrypt:
@ -575,7 +570,6 @@ aes_v8_cbc_encrypt:
ldmia sp!,{r4,r5,r6,r7,r8,pc}
.size aes_v8_cbc_encrypt,.-aes_v8_cbc_encrypt
.globl aes_v8_ctr32_encrypt_blocks
.hidden aes_v8_ctr32_encrypt_blocks
.type aes_v8_ctr32_encrypt_blocks,%function
.align 5
aes_v8_ctr32_encrypt_blocks:
@ -759,4 +753,4 @@ aes_v8_ctr32_encrypt_blocks:
ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,pc}
.size aes_v8_ctr32_encrypt_blocks,.-aes_v8_ctr32_encrypt_blocks
#endif
#endif
#endif

View file

@ -47,8 +47,9 @@
@
@ <ard.biesheuvel@linaro.org>
#if defined(__arm__)
#ifndef __KERNEL__
# include <openssl/arm_arch.h>
# include "arm_arch.h"
# define VFP_ABI_PUSH vstmdb sp!,{d8-d15}
# define VFP_ABI_POP vldmia sp!,{d8-d15}
@ -2575,3 +2576,4 @@ bsaes_xts_decrypt:
.size bsaes_xts_decrypt,.-bsaes_xts_decrypt
#endif
#endif
#endif

View file

@ -1,5 +1,5 @@
#if defined(__arm__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.code 32
@ -586,4 +586,4 @@ bn_mul8x_mont_neon:
.comm OPENSSL_armcap_P,4,4
.hidden OPENSSL_armcap_P
#endif
#endif
#endif

View file

@ -1,12 +1,13 @@
#if defined(__arm__)
#include <openssl/arm_arch.h>
#if defined(__arm__)
#include "arm_arch.h"
.syntax unified
.text
.code 32
#ifdef __clang__
#ifdef __APPLE__
#define ldrplb ldrbpl
#define ldrneb ldrbne
#endif
@ -535,4 +536,6 @@ gcm_ghash_neon:
.byte 71,72,65,83,72,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,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
#endif

View file

@ -1,11 +1,10 @@
#if defined(__arm__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.fpu neon
.code 32
.globl gcm_init_v8
.hidden gcm_init_v8
.type gcm_init_v8,%function
.align 4
gcm_init_v8:
@ -56,7 +55,6 @@ gcm_init_v8:
bx lr
.size gcm_init_v8,.-gcm_init_v8
.globl gcm_gmult_v8
.hidden gcm_gmult_v8
.type gcm_gmult_v8,%function
.align 4
gcm_gmult_v8:
@ -69,10 +67,10 @@ gcm_gmult_v8:
#endif
vext.8 q3,q9,q9,#8
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.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
@ -98,7 +96,6 @@ gcm_gmult_v8:
bx lr
.size gcm_gmult_v8,.-gcm_gmult_v8
.globl gcm_ghash_v8
.hidden gcm_ghash_v8
.type gcm_ghash_v8,%function
.align 4
gcm_ghash_v8:
@ -138,7 +135,7 @@ gcm_ghash_v8:
#endif
vext.8 q7,q9,q9,#8
veor q3,q3,q0 @ I[i]^=Xi
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q9,q9,q7 @ Karatsuba pre-processing
.byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7
b .Loop_mod2x_v8
@ -147,14 +144,14 @@ gcm_ghash_v8:
.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.lo·Xi.lo
.byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.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.hi·Xi.hi
.byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.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)
.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
@ -179,7 +176,7 @@ gcm_ghash_v8:
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 @ H·Ii+1
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q3,q3,q2 @ accumulate q3 early
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
@ -200,10 +197,10 @@ gcm_ghash_v8:
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.lo·Xi.lo
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.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
@ -233,4 +230,4 @@ 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
#endif

View file

@ -1,11 +1,10 @@
#if defined(__arm__)
#include <openssl/arm_arch.h>
#include "arm_arch.h"
.text
.code 32
.globl sha1_block_data_order
.hidden sha1_block_data_order
.type sha1_block_data_order,%function
.align 5
@ -1460,4 +1459,4 @@ sha1_block_data_order_armv8:
.comm OPENSSL_armcap_P,4,4
.hidden OPENSSL_armcap_P
#endif
#endif
#endif

View file

@ -38,7 +38,7 @@
@ Add ARMv8 code path performing at 2.0 cpb on Apple A7.
#ifndef __KERNEL__
# include <openssl/arm_arch.h>
# include "arm_arch.h"
#else
# define __ARM_ARCH__ __LINUX_ARM_ARCH__
# define __ARM_MAX_ARCH__ 7
@ -85,7 +85,6 @@ K256:
.align 5
.globl sha256_block_data_order
.hidden sha256_block_data_order
.type sha256_block_data_order,%function
sha256_block_data_order:
.Lsha256_block_data_order:
@ -1876,7 +1875,6 @@ sha256_block_data_order:
.fpu neon
.globl sha256_block_data_order_neon
.hidden sha256_block_data_order_neon
.type sha256_block_data_order_neon,%function
.align 4
sha256_block_data_order_neon:
@ -2817,4 +2815,4 @@ sha256_block_data_order_armv8:
.comm OPENSSL_armcap_P,4,4
.hidden OPENSSL_armcap_P
#endif
#endif
#endif

View file

@ -47,7 +47,7 @@
@ was reflected in below two parameters as 0 and 4. Now caller is
@ expected to maintain native byte order for whole 64-bit values.
#ifndef __KERNEL__
# include <openssl/arm_arch.h>
# include "arm_arch.h"
# define VFP_ABI_PUSH vstmdb sp!,{d8-d15}
# define VFP_ABI_POP vldmia sp!,{d8-d15}
#else
@ -133,7 +133,6 @@ K512:
#endif
.globl sha512_block_data_order
.hidden sha512_block_data_order
.type sha512_block_data_order,%function
sha512_block_data_order:
.Lsha512_block_data_order:
@ -534,7 +533,6 @@ sha512_block_data_order:
.fpu neon
.globl sha512_block_data_order_neon
.hidden sha512_block_data_order_neon
.type sha512_block_data_order_neon,%function
.align 4
sha512_block_data_order_neon:
@ -1868,4 +1866,4 @@ sha512_block_data_order_neon:
.comm OPENSSL_armcap_P,4,4
.hidden OPENSSL_armcap_P
#endif
#endif
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1561,15 +1561,6 @@ sqr8x_reduction:
.align 32
.L8x_tail_done:
addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax
negq %rsi

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1560,15 +1560,6 @@ L$8x_tail:
.p2align 5
L$8x_tail_done:
addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax
negq %rsi

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1616,15 +1616,6 @@ $L$8x_tail:
ALIGN 32
$L$8x_tail_done:
add r8,QWORD[rdx]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
xor rax,rax
neg rsi

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff