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 16:02:21 +0000 (18:02 +0200)
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 97fbb0c88c2f601f98e25e57b9f6f9679d14f3a8)

Resolved conflicts:
Configure
config

Configure
config
fips/fips_test_suite.c
fips/fipssyms.h

index 2785677a62a825c20263cc225d5b8b4802366101..65e06f330a50f886e65572d6fea0e005faeb0511 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -597,6 +597,7 @@ my %table=(
 # CROSS_SDK=iPhoneOS7.0.sdk
 #
 "iphoneos-cross","cc:-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 fc78a3068555bdc164191f724590d8301250bfc2..12f903048a9ea0b14828833695ab7e2c9ab22573 100755 (executable)
--- a/config
+++ b/config
@@ -576,7 +576,9 @@ case "$GUESSOS" in
   *-*-iphoneos)
        options="$options -arch%20${MACHINE}"
        OUT="iphoneos-cross" ;;
-  arm64-*-iphoneos|*-*-ios64)
+  armv7-*-ios)
+       OUT="ios-cross" ;;
+  arm64-*-ios*)
        OUT="ios64-cross" ;;
   alpha-*-linux2)
         ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
index c7054db74226e52fc220f4fe95ea5d18a28e6024..7813d25ee03b18c511e7b0d4962e3243d6e89bf8 100644 (file)
@@ -1611,6 +1611,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)