OpenSSL Build 用户手册

国密+白盒算法SDK中的Android、iOS、C/C++以及Erlang Port依赖了OpenSSL,请使用我们修改过的OpenSSL进行编译:openssl-OpenSSL_1_1_1-pre9.tar.gz

1. Android Build

编译之前,需要设置好NDK_ROOT环境变量,NDK版本不宜过高,否则将不支持mips及armeabi

编译某个架构

sh openssl-build-android.sh armeabi

编译全部

sh openssl-build-android.sh

2. iOS Build

编译某个架构

sh openssl-build-ios.sh armv7

编译全部

sh openssl-build-ios.sh

3. Mac OS Build

编译之前,需要有xcode环境。

// 32bit
sh openssl-build-macos.sh x86
// 64bit
sh openssl-build-macos.sh x86_64
一般情况下,我们编译都是64bit,由于没有32bit环境,脚本支持,但未编译过,请知。

4. Linux Build

32bit

./openssl-build-linux.sh x86

64bit

./openssl-build-linux.sh x86_64

5. Windows Build

需要事先安装cmake及perl,编译环境建议用vs2015

  1. 产生makefile文件,注意将prefix目录改成你自己的。

perl Configure VC-WIN32 no-asm no-zlib no-shared no-unit-test no-ssl no-hw no-tls no-stdio no-des no-afalgeng no-aria no-asan no-async no-autoalginit no-autoerrinit no-autoload-config no-bf no-blake2 no-camellia no-capieng no-cast no-chacha no-cmac no-cms no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-ct no-deprecated no-devcryptoeng no-dgram no-dh no-dsa no-dso no-dtls no-dynamic-engine no-ec2m no-ecdh no-ecdsa no-ec_nistp_64_gcc_128 no-egd no-engine no-err no-external-tests no-filenames no-fuzz-libfuzzer no-fuzz-afl no-gost no-heartbeats no-idea no-makedepend no-md2 no-md4 no-mdc2 no-msan no-multiblock no-nextprotoneg no-ocb no-ocsp no-pic no-poly1305 no-posix-io no-psk no-rc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-rmd160 no-scrypt no-sctp no-seed no-siphash no-sm4 no-sock no-srp no-srtp no-sse2 no-ssl-trace no-static-engine no-tests no-ts no-ubsan no-ui-console no-whirlpool no-weak-ssl-ciphers –prefix=d:\openssl_32

  1. 编译 nmake

  2. 安装 nmake install_sw

可用架构,如果开启了汇编优化的,应该选择对应的架构,有助于提升算法效率

BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8 BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586 Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc UEFI UWIN VC-CE VC-WIN32 VC-WIN32-ARM VC-WIN32-ONECORE VC-WIN64-ARM VC-WIN64A VC-WIN64A-ONECORE VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc android-arm android-arm64 android-armeabi android-mips android-mips64 android-x86 android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64 bsdi-elf-gcc cc darwin-i386-cc darwin-ppc-cc darwin64-debug-test-64-clang darwin64-ppc-cc darwin64-x86_64-cc dist gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86 ios-cross ios-xcrun ios64-cross ios64-xcrun iossimulator-xcrun iphoneos-cross irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc linux-aarch64 linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 linux-c64xplus linux-elf linux-generic32 linux-generic64 linux-ia64 linux-mips32 linux-mips64 linux-ppc linux-ppc64 linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32 linux-x86 linux-x86-clang linux-x86_64 linux-x86_64-clang linux32-s390x linux64-mips64 linux64-s390x linux64-sparcv9 mingw mingw64 nextstep nextstep3.3 purify sco5-cc sco5-gcc solaris-sparcv7-cc solaris-sparcv7-gcc solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc solaris-sparcv9-gcc solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc solaris64-x86_64-cc solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc uClinux-dist uClinux-dist64 unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha vms-alpha-p32 vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vos-gcc vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug vxworks-ppc860 vxworks-ppcgen vxworks-simlinux debug debug-erbridge debug-linux-ia32-aes debug-linux-pentium debug-linux-ppro debug-test-64-clang