Configure: add ios-cross target with ARM assembly support.
authorAndy Polyakov <appro@openssl.org>
Mon, 11 May 2015 09:53:41 +0000 (11:53 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 13 May 2015 14:47:21 +0000 (16:47 +0200)
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Configure
config
fips/fips_test_suite.c
fips/fipssyms.h

index 1d0b07d3ae359c96f3c31e05e15d7016b3a096c8..1959f98c67110183f6184f3f37eae39306c25db0 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -587,6 +587,7 @@ my %table=(
 "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 # iPhoneOS/iOS
 "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+"ios-cross","cc:-O3 -arch armv7 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:armcap.o armv4cpuid_ios.o:bn_asm.o armv4-mont.o armv4-gf2m.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o::ios32:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 "ios64-cross","cc:-O3 -arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR -RC4_CHUNK DES_INT DES_UNROLL -BF_PTR:${aarch64_asm}:ios64:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 
 ##### A/UX
diff --git a/config b/config
index b858d80696623f3375363f236f852364c2830399..db5fc82bcba3dbadc7348764ecd47ba0d5b86df3 100755 (executable)
--- a/config
+++ b/config
@@ -584,8 +584,9 @@ case "$GUESSOS" in
   *-*-iphoneos)
        options="$options -arch%20${MACHINE}"
        OUT="iphoneos-cross" ;;
-  arm64-*-ios64)
-       options="$options -arch%20${MACHINE}"
+  armv7-*-ios)
+       OUT="ios-cross" ;;
+  arm64-*-ios*)
        OUT="ios64-cross" ;;
   alpha-*-linux2)
         ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
index e2506ff2ae231a077f80340faa131fbd5ab5ab4f..647de96fa1ca83536e7e2370bb7380e198ef0035 100644 (file)
@@ -1325,6 +1325,12 @@ int main(int argc, char **argv)
 
     FIPS_post_set_callback(post_cb);
 
+#if defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__))
+    extern unsigned int OPENSSL_armcap_P;
+    if (0 == OPENSSL_armcap_P)
+       fprintf(stderr, "Optimizations disabled\n");
+#endif
+
     printf("\tFIPS-mode test application\n");
 
     printf("\t%s\n\n", FIPS_module_version_text());
index f5d04d073c649f8dd845c302d142265a9e94dd01..76db619cec151cd6ddc83773d353a90bf6e7100b 100644 (file)
 #define _sha1_block_data_order _fips_sha1_block_data_order
 #define _sha256_block_data_order _fips_sha256_block_data_order
 #define _sha512_block_data_order _fips_sha512_block_data_order
+#define _AES_decrypt _fips_aes_decrypt
+#define _AES_encrypt _fips_aes_encrypt
+#define _AES_set_decrypt_key _fips_aes_set_decrypt_key
+#define _AES_set_encrypt_key _fips_aes_set_encrypt_key
+#define _gcm_gmult_4bit _fips_gcm_gmult_4bit
+#define _gcm_ghash_4bit _fips_gcm_ghash_4bit
+#define _gcm_gmult_neon _fips_gcm_gmult_neon
+#define _gcm_ghash_neon _fips_gcm_ghash_neon
+#define _bn_GF2m_mul_2x2 _fips_bn_GF2m_mul_2x2
+#define _OPENSSL_cleanse _FIPS_openssl_cleanse
 #endif
 
 #if defined(_MSC_VER)