Skip to content
Browse files

openssl: use optimized asm code on x86 and x64

  • Loading branch information...
1 parent 5c82e5f commit 3e5b404a5d617e052ddc396c1e8306d5bd28eeee @piscisaureus piscisaureus committed with
View
3 deps/openssl/config/k8/openssl/opensslconf-posix.h
@@ -41,9 +41,6 @@
#ifndef OPENSSL_NO_SEED
# define OPENSSL_NO_SEED
#endif
-#ifndef OPENSSL_NO_ASM
-# define OPENSSL_NO_ASM
-#endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
View
3 deps/openssl/config/piii/openssl/opensslconf-posix.h
@@ -41,9 +41,6 @@
#ifndef OPENSSL_NO_SEED
# define OPENSSL_NO_SEED
#endif
-#ifndef OPENSSL_NO_ASM
-# define OPENSSL_NO_ASM
-#endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
View
3 deps/openssl/config/piii/openssl/opensslconf-win32.h
@@ -44,9 +44,6 @@
#ifndef OPENSSL_NO_SEED
# define OPENSSL_NO_SEED
#endif
-#ifndef OPENSSL_NO_ASM
-# define OPENSSL_NO_ASM
-#endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
View
216 deps/openssl/openssl.gyp
@@ -74,9 +74,7 @@
'openssl/ssl/t1_reneg.c',
'openssl/ssl/t1_srvr.c',
'openssl/ssl/tls_srp.c',
- 'openssl/crypto/aes/aes_cbc.c',
'openssl/crypto/aes/aes_cfb.c',
- 'openssl/crypto/aes/aes_core.c',
'openssl/crypto/aes/aes_ctr.c',
'openssl/crypto/aes/aes_ecb.c',
'openssl/crypto/aes/aes_ige.c',
@@ -162,8 +160,6 @@
'openssl/crypto/asn1/x_x509a.c',
'openssl/crypto/bf/bf_cfb64.c',
'openssl/crypto/bf/bf_ecb.c',
- 'openssl/crypto/bf/bf_enc.c',
- 'openssl/crypto/bf/bf_enc.c',
'openssl/crypto/bf/bf_ofb64.c',
'openssl/crypto/bf/bf_skey.c',
'openssl/crypto/bio/b_dump.c',
@@ -225,7 +221,6 @@
'openssl/crypto/camellia/cmll_utl.c',
'openssl/crypto/cast/c_cfb64.c',
'openssl/crypto/cast/c_ecb.c',
- 'openssl/crypto/cast/c_enc.c',
'openssl/crypto/cast/c_ofb64.c',
'openssl/crypto/cast/c_skey.c',
'openssl/crypto/cmac/cm_ameth.c',
@@ -263,7 +258,6 @@
'openssl/crypto/des/cfb64ede.c',
'openssl/crypto/des/cfb64enc.c',
'openssl/crypto/des/cfb_enc.c',
- 'openssl/crypto/des/des_enc.c',
'openssl/crypto/des/des_old.c',
'openssl/crypto/des/des_old2.c',
'openssl/crypto/des/ecb3_enc.c',
@@ -272,7 +266,6 @@
'openssl/crypto/des/enc_read.c',
'openssl/crypto/des/enc_writ.c',
'openssl/crypto/des/fcrypt.c',
- 'openssl/crypto/des/fcrypt_b.c',
'openssl/crypto/des/ofb64ede.c',
'openssl/crypto/des/ofb64enc.c',
'openssl/crypto/des/ofb_enc.c',
@@ -450,7 +443,6 @@
'openssl/crypto/mdc2/mdc2_one.c',
'openssl/crypto/mdc2/mdc2dgst.c',
'openssl/crypto/mem.c',
- 'openssl/crypto/mem_clr.c',
'openssl/crypto/mem_dbg.c',
'openssl/crypto/modes/cbc128.c',
'openssl/crypto/modes/ccm128.c',
@@ -529,9 +521,6 @@
'openssl/crypto/rc2/rc2_skey.c',
'openssl/crypto/rc2/rc2cfb64.c',
'openssl/crypto/rc2/rc2ofb64.c',
- 'openssl/crypto/rc4/rc4_enc.c',
- 'openssl/crypto/rc4/rc4_skey.c',
- 'openssl/crypto/rc4/rc4_utl.c',
'openssl/crypto/ripemd/rmd_dgst.c',
'openssl/crypto/ripemd/rmd_one.c',
'openssl/crypto/rsa/rsa_ameth.c',
@@ -656,14 +645,202 @@
'openssl/engines/e_gmp.c',
'openssl/engines/e_nuron.c',
'openssl/engines/e_sureware.c',
- 'openssl/engines/e_ubsec.c',
- ],
- 'sources/': [
- ['exclude', 'camellia/.*$'],
- ['exclude', 'cms/.*$'],
- ['exclude', 'mdc2/.*$'],
+ 'openssl/engines/e_ubsec.c'
],
'conditions': [
+ ['target_arch!="ia32" and target_arch!="x64"', {
+ # Disable asm
+ 'defines': [
+ 'OPENSSL_NO_ASM'
+ ],
+ 'sources': [
+ 'openssl/crypto/aes/aes_cbc.c',
+ 'openssl/crypto/aes/aes_core.c',
+ 'openssl/crypto/bf/bf_enc.c',
+ 'openssl/crypto/bn/bn_asm.c',
+ 'openssl/crypto/cast/c_enc.c',
+ 'openssl/crypto/des/des_enc.c',
+ 'openssl/crypto/des/fcrypt_b.c',
+ 'openssl/crypto/mem_clr.c',
+ 'openssl/crypto/rc4/rc4_enc.c',
+ 'openssl/crypto/rc4/rc4_skey.c',
+ 'openssl/crypto/rc4/rc4_utl.c',
+ ]
+ }, {
+ # Enable asm
+ 'defines': [
+ 'AES_ASM',
+ 'BF_ASM',
+ 'BNCO_ASM',
+ 'BN_ASM',
+ 'CPUID_ASM',
+ 'DES_ASM',
+ 'LIB_BN_ASM',
+ 'OPENSSL_BN_ASM',
+ 'OPENSSL_CPUID_OBJ',
+ 'RIP_ASM',
+ 'WHIRLPOOL_ASM',
+ 'WP_ASM'
+ ],
+ 'conditions': [
+ ['OS!="win" and OS!="mac" and target_arch=="ia32"', {
+ 'sources': [
+ 'asm/x86-elf-gas/aes/aes-586.s',
+ 'asm/x86-elf-gas/bf/bf-686.s',
+ 'asm/x86-elf-gas/bn/x86-mont.s',
+ 'asm/x86-elf-gas/bn/x86.s',
+ 'asm/x86-elf-gas/camellia/cmll-x86.s',
+ 'asm/x86-elf-gas/cast/cast-586.s',
+ 'asm/x86-elf-gas/des/crypt586.s',
+ 'asm/x86-elf-gas/des/des-586.s',
+ 'asm/x86-elf-gas/md5/md5-586.s',
+ 'asm/x86-elf-gas/rc4/rc4-586.s',
+ 'asm/x86-elf-gas/rc5/rc5-586.s',
+ 'asm/x86-elf-gas/ripemd/rmd-586.s',
+ 'asm/x86-elf-gas/sha/sha1-586.s',
+ 'asm/x86-elf-gas/sha/sha256-586.s',
+ 'asm/x86-elf-gas/sha/sha512-586.s',
+ 'asm/x86-elf-gas/whrlpool/wp-mmx.s',
+ 'asm/x86-elf-gas/x86cpuid.s'
+ ]
+ }],
+ ['OS!="win" and OS!="mac" and target_arch=="x64"', {
+ 'sources': [
+ 'asm/x64-elf-gas/aes/aes-x86_64.s',
+ 'asm/x64-elf-gas/bn/x86_64-mont.s',
+ 'asm/x64-elf-gas/camellia/cmll-x86_64.s',
+ 'asm/x64-elf-gas/md5/md5-x86_64.s',
+ 'asm/x64-elf-gas/rc4/rc4-x86_64.s',
+ 'asm/x64-elf-gas/sha/sha1-x86_64.s',
+ 'asm/x64-elf-gas/sha/sha512-x86_64.s',
+ 'asm/x64-elf-gas/whrlpool/wp-x86_64.s',
+ 'asm/x64-elf-gas/x86_64cpuid.s',
+ # Non-generated asm
+ 'openssl/crypto/bn/asm/x86_64-gcc.c',
+ # No asm available
+ 'openssl/crypto/cast/c_enc.c',
+ 'openssl/crypto/des/des_enc.c',
+ 'openssl/crypto/bf/bf_enc.c'
+ ]
+ }],
+ ['OS=="mac" and target_arch=="ia32"', {
+ 'sources': [
+ 'asm/x86-macosx-gas/aes/aes-586.s',
+ 'asm/x86-macosx-gas/bf/bf-686.s',
+ 'asm/x86-macosx-gas/bn/x86-mont.s',
+ 'asm/x86-macosx-gas/bn/x86.s',
+ 'asm/x86-macosx-gas/camellia/cmll-x86.s',
+ 'asm/x86-macosx-gas/cast/cast-586.s',
+ 'asm/x86-macosx-gas/des/crypt586.s',
+ 'asm/x86-macosx-gas/des/des-586.s',
+ 'asm/x86-macosx-gas/md5/md5-586.s',
+ 'asm/x86-macosx-gas/rc4/rc4-586.s',
+ 'asm/x86-macosx-gas/rc5/rc5-586.s',
+ 'asm/x86-macosx-gas/ripemd/rmd-586.s',
+ 'asm/x86-macosx-gas/sha/sha1-586.s',
+ 'asm/x86-macosx-gas/sha/sha256-586.s',
+ 'asm/x86-macosx-gas/sha/sha512-586.s',
+ 'asm/x86-macosx-gas/whrlpool/wp-mmx.s',
+ 'asm/x86-macosx-gas/x86cpuid.s'
+ ]
+ }],
+ ['OS=="mac" and target_arch=="x64"', {
+ 'sources': [
+ 'asm/x64-macosx-gas/aes/aes-x86_64.s',
+ 'asm/x64-macosx-gas/bn/x86_64-mont.s',
+ 'asm/x64-macosx-gas/camellia/cmll-x86_64.s',
+ 'asm/x64-macosx-gas/md5/md5-x86_64.s',
+ 'asm/x64-macosx-gas/rc4/rc4-x86_64.s',
+ 'asm/x64-macosx-gas/sha/sha1-x86_64.s',
+ 'asm/x64-macosx-gas/sha/sha512-x86_64.s',
+ 'asm/x64-macosx-gas/whrlpool/wp-x86_64.s',
+ 'asm/x64-macosx-gas/x86_64cpuid.s',
+ # Non-generated asm
+ 'openssl/crypto/bn/asm/x86_64-gcc.c',
+ # No asm available
+ 'openssl/crypto/cast/c_enc.c',
+ 'openssl/crypto/des/des_enc.c',
+ 'openssl/crypto/bf/bf_enc.c'
+ ]
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'sources': [
+ 'asm/x86-win32-masm/aes/aes-586.asm',
+ 'asm/x86-win32-masm/bf/bf-686.asm',
+ 'asm/x86-win32-masm/bn/x86-mont.asm',
+ 'asm/x86-win32-masm/bn/x86.asm',
+ 'asm/x86-win32-masm/camellia/cmll-x86.asm',
+ 'asm/x86-win32-masm/cast/cast-586.asm',
+ 'asm/x86-win32-masm/des/crypt586.asm',
+ 'asm/x86-win32-masm/des/des-586.asm',
+ 'asm/x86-win32-masm/md5/md5-586.asm',
+ 'asm/x86-win32-masm/rc4/rc4-586.asm',
+ 'asm/x86-win32-masm/rc5/rc5-586.asm',
+ 'asm/x86-win32-masm/ripemd/rmd-586.asm',
+ 'asm/x86-win32-masm/sha/sha1-586.asm',
+ 'asm/x86-win32-masm/sha/sha256-586.asm',
+ 'asm/x86-win32-masm/sha/sha512-586.asm',
+ 'asm/x86-win32-masm/whrlpool/wp-mmx.asm',
+ 'asm/x86-win32-masm/x86cpuid.asm'
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'Assemble',
+ 'extension': 'asm',
+ 'inputs': [],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ ],
+ 'action': [
+ 'ml.exe',
+ '/Zi',
+ '/Fo', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ '/c', '<(RULE_INPUT_PATH)',
+ ],
+ 'process_outputs_as_sources': 0,
+ 'message': 'Assembling <(RULE_INPUT_PATH) to <(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj.',
+ }
+ ]
+ }],
+ ['OS=="win" and target_arch=="x64"', {
+ 'sources': [
+ 'asm/x64-win32-masm/aes/aes-x86_64.asm',
+ 'asm/x64-win32-masm/bn/x86_64-mont.asm',
+ 'asm/x64-win32-masm/camellia/cmll-x86_64.asm',
+ 'asm/x64-win32-masm/md5/md5-x86_64.asm',
+ 'asm/x64-win32-masm/rc4/rc4-x86_64.asm',
+ 'asm/x64-win32-masm/sha/sha1-x86_64.asm',
+ 'asm/x64-win32-masm/sha/sha512-x86_64.asm',
+ 'asm/x64-win32-masm/whrlpool/wp-x86_64.asm',
+ 'asm/x64-win32-masm/x86_64cpuid.asm',
+ # Non-generated asm
+ 'openssl/crypto/bn/asm/x86_64-win32-masm.asm',
+ # No asm available
+ 'openssl/crypto/cast/c_enc.c',
+ 'openssl/crypto/des/des_enc.c',
+ 'openssl/crypto/bf/bf_enc.c'
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'Assemble',
+ 'extension': 'asm',
+ 'inputs': [],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ ],
+ 'action': [
+ 'ml64.exe',
+ '/Zi',
+ '/Fo', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ '/c', '<(RULE_INPUT_PATH)',
+ ],
+ 'process_outputs_as_sources': 0,
+ 'message': 'Assembling <(RULE_INPUT_PATH) to <(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj.',
+ }
+ ]
+ }]
+ ]
+ }],
['OS=="win"', {
'defines': [
'MK1MF_BUILD',
@@ -713,6 +890,11 @@
]
}]
],
+ 'sources/': [
+ ['exclude', 'camellia/.*$'],
+ ['exclude', 'cms/.*$'],
+ ['exclude', 'mdc2/.*$'],
+ ],
'include_dirs': [
'.',
'openssl',

0 comments on commit 3e5b404

Please sign in to comment.
Something went wrong with that request. Please try again.