From f50d69cd6030489e9ca0cfec6570b9b8f9c8dbd1 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:49:36 +0800 Subject: [PATCH] Build libnettle with assembly code (#1292) * Build libnettle with assembler code * Add .gitattributes for shell script * Patch nettle for CPU feature detection on Android * Don't build libnettle at configuration time * Fix build * Refine --- .gitattributes | 1 + app/src/main/cpp/CMakeLists.txt | 33 ++- app/src/main/cpp/configure_nettle.sh | 6 + app/src/main/cpp/nettle.patch | 21 ++ app/src/main/cpp/nettle/CMakeLists.txt | 238 --------------------- app/src/main/cpp/nettle/config.h | 280 ------------------------- app/src/main/cpp/nettle/keymap.h | 1 - app/src/main/cpp/nettle/rotors.h | 1 - app/src/main/cpp/nettle/version.h | 64 ------ 9 files changed, 53 insertions(+), 592 deletions(-) create mode 100644 .gitattributes create mode 100644 app/src/main/cpp/configure_nettle.sh create mode 100644 app/src/main/cpp/nettle.patch delete mode 100644 app/src/main/cpp/nettle/CMakeLists.txt delete mode 100644 app/src/main/cpp/nettle/config.h delete mode 100644 app/src/main/cpp/nettle/keymap.h delete mode 100644 app/src/main/cpp/nettle/rotors.h delete mode 100644 app/src/main/cpp/nettle/version.h diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..50ca329f2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh eol=lf diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 8cef20529..6425f6124 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.14) project(ehviewer C) +include(ExternalProject) include(FetchContent) if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -29,20 +30,36 @@ FetchContent_MakeAvailable(liblzma) include_directories(${liblzma_SOURCE_DIR}/src/liblzma/api) # Build GNUTLS libnettle -FetchContent_Declare( +if (CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) + execute_process( + COMMAND wsl wslpath ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE CURRENT_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +else () + set(CURRENT_DIR ${CMAKE_CURRENT_LIST_DIR}) +endif () +set(NDK_VERSION "${ANDROID_NDK_MAJOR}.${ANDROID_NDK_MINOR}.${ANDROID_NDK_BUILD}") +ExternalProject_Add( nettle + PREFIX nettle URL https://ftp.gnu.org/gnu/nettle/nettle-3.9.1.tar.gz URL_MD5 29fcd2dec6bf5b48e5e3ffb3cbc4779e - SOURCE_DIR nettle-src/nettle + PATCH_COMMAND bash -c "patch -p1 < ${CURRENT_DIR}/nettle.patch" + CONFIGURE_COMMAND bash ${CURRENT_DIR}/configure_nettle.sh ${NDK_VERSION} ${CMAKE_C_COMPILER_TARGET} + BUILD_COMMAND bash -c "make libnettle.a CFLAGS='${CMAKE_C_FLAGS}'" + INSTALL_COMMAND "" + BUILD_IN_SOURCE 1 + BUILD_BYPRODUCTS nettle/src/nettle/libnettle.a ) -FetchContent_MakeAvailable(nettle) -set(NETTLE_DIR ${nettle_SOURCE_DIR}) -add_subdirectory(nettle) +ExternalProject_Get_Property(nettle SOURCE_DIR) +include_directories(${SOURCE_DIR}/..) +add_library(libnettle STATIC IMPORTED) +set_property(TARGET libnettle PROPERTY IMPORTED_LOCATION ${SOURCE_DIR}/libnettle.a) +add_dependencies(libnettle nettle) # Configure libnettle support for libarchive -include_directories(${CMAKE_CURRENT_BINARY_DIR}/nettle-src) -include_directories(.) set(HAVE_LIBNETTLE 1) set(HAVE_NETTLE_AES_H 1) set(HAVE_NETTLE_HMAC_H 1) @@ -65,7 +82,7 @@ option(ENABLE_UNZIP OFF) option(ENABLE_TEST OFF) # Configure libarchive link's static lib -SET(LIBARCHIVE_CUSTOM_LIBS "nettle" "liblzma") +SET(LIBARCHIVE_CUSTOM_LIBS "libnettle" "liblzma") FetchContent_Declare( libarchive diff --git a/app/src/main/cpp/configure_nettle.sh b/app/src/main/cpp/configure_nettle.sh new file mode 100644 index 000000000..b44b7aa98 --- /dev/null +++ b/app/src/main/cpp/configure_nettle.sh @@ -0,0 +1,6 @@ +TOOLCHAIN=$ANDROID_HOME/ndk/$1/toolchains/llvm/prebuilt/$(uname -s | tr '[:upper:]' '[:lower:]')-x86_64/bin +TARGET=$2 +./configure --host=$TARGET --disable-public-key --disable-dependency-tracking \ + AR=$TOOLCHAIN/llvm-ar \ + CC="$TOOLCHAIN/clang -target $TARGET" \ + RANLIB=$TOOLCHAIN/llvm-ranlib diff --git a/app/src/main/cpp/nettle.patch b/app/src/main/cpp/nettle.patch new file mode 100644 index 000000000..30f201095 --- /dev/null +++ b/app/src/main/cpp/nettle.patch @@ -0,0 +1,21 @@ +diff --git a/fat-arm64.c b/fat-arm64.c +index aec99f66..62b3adea 100644 +--- a/fat-arm64.c ++++ b/fat-arm64.c +@@ -43,9 +43,14 @@ + #if defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) + # if __GLIBC_PREREQ(2, 16) + # define USE_GETAUXVAL 1 +-# include +-# include + # endif ++#elif __ANDROID_API__ >= 18 ++# define USE_GETAUXVAL 1 ++#endif ++ ++#if USE_GETAUXVAL ++# include ++# include + #elif defined(__OpenBSD__) + # include + # include diff --git a/app/src/main/cpp/nettle/CMakeLists.txt b/app/src/main/cpp/nettle/CMakeLists.txt deleted file mode 100644 index 16d569cf5..000000000 --- a/app/src/main/cpp/nettle/CMakeLists.txt +++ /dev/null @@ -1,238 +0,0 @@ -cmake_minimum_required(VERSION 3.4.1) -project(nettle C) - -set(LIBNETTLE_DEFINITIONS - -DHAVE_CONFIG_H) - -set(LIBNETTLE_SOURCES - ${NETTLE_DIR}/aes-decrypt-internal.c - ${NETTLE_DIR}/aes-decrypt.c - ${NETTLE_DIR}/aes-decrypt-table.c - ${NETTLE_DIR}/aes128-decrypt.c - ${NETTLE_DIR}/aes192-decrypt.c - ${NETTLE_DIR}/aes256-decrypt.c - ${NETTLE_DIR}/aes-encrypt-internal.c - ${NETTLE_DIR}/aes-encrypt.c - ${NETTLE_DIR}/aes-encrypt-table.c - ${NETTLE_DIR}/aes128-encrypt.c - ${NETTLE_DIR}/aes192-encrypt.c - ${NETTLE_DIR}/aes256-encrypt.c - ${NETTLE_DIR}/aes-invert-internal.c - ${NETTLE_DIR}/aes-set-key-internal.c - ${NETTLE_DIR}/aes-set-encrypt-key.c - ${NETTLE_DIR}/aes-set-decrypt-key.c - ${NETTLE_DIR}/aes128-set-encrypt-key.c - ${NETTLE_DIR}/aes128-set-decrypt-key.c - ${NETTLE_DIR}/aes128-meta.c - ${NETTLE_DIR}/aes192-set-encrypt-key.c - ${NETTLE_DIR}/aes192-set-decrypt-key.c - ${NETTLE_DIR}/aes192-meta.c - ${NETTLE_DIR}/aes256-set-encrypt-key.c - ${NETTLE_DIR}/aes256-set-decrypt-key.c - ${NETTLE_DIR}/aes256-meta.c - ${NETTLE_DIR}/nist-keywrap.c - ${NETTLE_DIR}/arcfour.c - ${NETTLE_DIR}/arctwo.c - ${NETTLE_DIR}/arctwo-meta.c - ${NETTLE_DIR}/blowfish.c - ${NETTLE_DIR}/blowfish-bcrypt.c - ${NETTLE_DIR}/base16-encode.c - ${NETTLE_DIR}/base16-decode.c - ${NETTLE_DIR}/base16-meta.c - ${NETTLE_DIR}/base64-encode.c - ${NETTLE_DIR}/base64-decode.c - ${NETTLE_DIR}/base64-meta.c - ${NETTLE_DIR}/base64url-encode.c - ${NETTLE_DIR}/base64url-decode.c - ${NETTLE_DIR}/base64url-meta.c - ${NETTLE_DIR}/buffer.c - ${NETTLE_DIR}/buffer-init.c - ${NETTLE_DIR}/camellia-crypt-internal.c - ${NETTLE_DIR}/camellia-table.c - ${NETTLE_DIR}/camellia-absorb.c - ${NETTLE_DIR}/camellia-invert-key.c - ${NETTLE_DIR}/camellia128-set-encrypt-key.c - ${NETTLE_DIR}/camellia128-crypt.c - ${NETTLE_DIR}/camellia128-set-decrypt-key.c - ${NETTLE_DIR}/camellia128-meta.c - ${NETTLE_DIR}/camellia192-meta.c - ${NETTLE_DIR}/camellia256-set-encrypt-key.c - ${NETTLE_DIR}/camellia256-crypt.c - ${NETTLE_DIR}/camellia256-set-decrypt-key.c - ${NETTLE_DIR}/camellia256-meta.c - ${NETTLE_DIR}/cast128.c - ${NETTLE_DIR}/cast128-meta.c - ${NETTLE_DIR}/cbc.c - ${NETTLE_DIR}/cbc-aes128-encrypt.c - ${NETTLE_DIR}/cbc-aes192-encrypt.c - ${NETTLE_DIR}/cbc-aes256-encrypt.c - ${NETTLE_DIR}/ccm.c - ${NETTLE_DIR}/ccm-aes128.c - ${NETTLE_DIR}/ccm-aes192.c - ${NETTLE_DIR}/ccm-aes256.c - ${NETTLE_DIR}/cfb.c - ${NETTLE_DIR}/siv-cmac.c - ${NETTLE_DIR}/siv-cmac-aes128.c - ${NETTLE_DIR}/siv-cmac-aes256.c - ${NETTLE_DIR}/cnd-memcpy.c - ${NETTLE_DIR}/chacha-crypt.c - ${NETTLE_DIR}/chacha-core-internal.c - ${NETTLE_DIR}/chacha-poly1305.c - ${NETTLE_DIR}/chacha-poly1305-meta.c - ${NETTLE_DIR}/chacha-set-key.c - ${NETTLE_DIR}/chacha-set-nonce.c - ${NETTLE_DIR}/ctr.c - ${NETTLE_DIR}/ctr16.c - ${NETTLE_DIR}/des.c - ${NETTLE_DIR}/des3.c - ${NETTLE_DIR}/eax.c - ${NETTLE_DIR}/eax-aes128.c - ${NETTLE_DIR}/eax-aes128-meta.c - ${NETTLE_DIR}/ghash-set-key.c - ${NETTLE_DIR}/ghash-update.c - ${NETTLE_DIR}/gcm.c - ${NETTLE_DIR}/gcm-aes.c - ${NETTLE_DIR}/gcm-aes128.c - ${NETTLE_DIR}/gcm-aes128-meta.c - ${NETTLE_DIR}/gcm-aes192.c - ${NETTLE_DIR}/gcm-aes192-meta.c - ${NETTLE_DIR}/gcm-aes256.c - ${NETTLE_DIR}/gcm-aes256-meta.c - ${NETTLE_DIR}/gcm-camellia128.c - ${NETTLE_DIR}/gcm-camellia128-meta.c - ${NETTLE_DIR}/gcm-camellia256.c - ${NETTLE_DIR}/gcm-camellia256-meta.c - ${NETTLE_DIR}/cmac.c - ${NETTLE_DIR}/cmac64.c - ${NETTLE_DIR}/cmac-aes128.c - ${NETTLE_DIR}/cmac-aes256.c - ${NETTLE_DIR}/cmac-des3.c - ${NETTLE_DIR}/cmac-aes128-meta.c - ${NETTLE_DIR}/cmac-aes256-meta.c - ${NETTLE_DIR}/cmac-des3-meta.c - ${NETTLE_DIR}/gost28147.c - ${NETTLE_DIR}/gosthash94.c - ${NETTLE_DIR}/gosthash94-meta.c - ${NETTLE_DIR}/hmac.c - ${NETTLE_DIR}/hmac-gosthash94.c - ${NETTLE_DIR}/hmac-md5.c - ${NETTLE_DIR}/hmac-ripemd160.c - ${NETTLE_DIR}/hmac-sha1.c - ${NETTLE_DIR}/hmac-sha224.c - ${NETTLE_DIR}/hmac-sha256.c - ${NETTLE_DIR}/hmac-sha384.c - ${NETTLE_DIR}/hmac-sha512.c - ${NETTLE_DIR}/hmac-streebog.c - ${NETTLE_DIR}/hmac-sm3.c - ${NETTLE_DIR}/hmac-md5-meta.c - ${NETTLE_DIR}/hmac-ripemd160-meta.c - ${NETTLE_DIR}/hmac-sha1-meta.c - ${NETTLE_DIR}/hmac-sha224-meta.c - ${NETTLE_DIR}/hmac-sha256-meta.c - ${NETTLE_DIR}/hmac-sha384-meta.c - ${NETTLE_DIR}/hmac-sha512-meta.c - ${NETTLE_DIR}/hmac-streebog-meta.c - ${NETTLE_DIR}/hmac-sm3-meta.c - ${NETTLE_DIR}/knuth-lfib.c - ${NETTLE_DIR}/hkdf.c - ${NETTLE_DIR}/md2.c - ${NETTLE_DIR}/md2-meta.c - ${NETTLE_DIR}/md4.c - ${NETTLE_DIR}/md4-meta.c - ${NETTLE_DIR}/md5.c - ${NETTLE_DIR}/md5-compress.c - ${NETTLE_DIR}/md5-compat.c - ${NETTLE_DIR}/md5-meta.c - ${NETTLE_DIR}/memeql-sec.c - ${NETTLE_DIR}/memxor.c - ${NETTLE_DIR}/memxor3.c - ${NETTLE_DIR}/nettle-lookup-hash.c - ${NETTLE_DIR}/nettle-meta-aeads.c - ${NETTLE_DIR}/nettle-meta-armors.c - ${NETTLE_DIR}/nettle-meta-ciphers.c - ${NETTLE_DIR}/nettle-meta-hashes.c - ${NETTLE_DIR}/nettle-meta-macs.c - ${NETTLE_DIR}/pbkdf2.c - ${NETTLE_DIR}/pbkdf2-hmac-gosthash94.c - ${NETTLE_DIR}/pbkdf2-hmac-sha1.c - ${NETTLE_DIR}/pbkdf2-hmac-sha256.c - ${NETTLE_DIR}/pbkdf2-hmac-sha384.c - ${NETTLE_DIR}/pbkdf2-hmac-sha512.c - ${NETTLE_DIR}/poly1305-aes.c - ${NETTLE_DIR}/poly1305-internal.c - ${NETTLE_DIR}/realloc.c - ${NETTLE_DIR}/ripemd160.c - ${NETTLE_DIR}/ripemd160-compress.c - ${NETTLE_DIR}/ripemd160-meta.c - ${NETTLE_DIR}/salsa20-core-internal.c - ${NETTLE_DIR}/salsa20-crypt-internal.c - ${NETTLE_DIR}/salsa20-crypt.c - ${NETTLE_DIR}/salsa20r12-crypt.c - ${NETTLE_DIR}/salsa20-set-key.c - ${NETTLE_DIR}/salsa20-set-nonce.c - ${NETTLE_DIR}/salsa20-128-set-key.c - ${NETTLE_DIR}/salsa20-256-set-key.c - ${NETTLE_DIR}/sha1.c - ${NETTLE_DIR}/sha1-compress.c - ${NETTLE_DIR}/sha1-meta.c - ${NETTLE_DIR}/sha256.c - ${NETTLE_DIR}/sha256-compress-n.c - ${NETTLE_DIR}/sha224-meta.c - ${NETTLE_DIR}/sha256-meta.c - ${NETTLE_DIR}/sha512.c - ${NETTLE_DIR}/sha512-compress.c - ${NETTLE_DIR}/sha384-meta.c - ${NETTLE_DIR}/sha512-meta.c - ${NETTLE_DIR}/sha512-224-meta.c - ${NETTLE_DIR}/sha512-256-meta.c - ${NETTLE_DIR}/sha3.c - ${NETTLE_DIR}/sha3-permute.c - ${NETTLE_DIR}/sha3-224.c - ${NETTLE_DIR}/sha3-224-meta.c - ${NETTLE_DIR}/sha3-256.c - ${NETTLE_DIR}/sha3-256-meta.c - ${NETTLE_DIR}/sha3-384.c - ${NETTLE_DIR}/sha3-384-meta.c - ${NETTLE_DIR}/sha3-512.c - ${NETTLE_DIR}/sha3-512-meta.c - ${NETTLE_DIR}/shake256.c - ${NETTLE_DIR}/sm3.c - ${NETTLE_DIR}/sm3-meta.c - ${NETTLE_DIR}/serpent-set-key.c - ${NETTLE_DIR}/serpent-encrypt.c - ${NETTLE_DIR}/serpent-decrypt.c - ${NETTLE_DIR}/serpent-meta.c - ${NETTLE_DIR}/streebog.c - ${NETTLE_DIR}/streebog-meta.c - ${NETTLE_DIR}/twofish.c - ${NETTLE_DIR}/twofish-meta.c - ${NETTLE_DIR}/umac-nh.c - ${NETTLE_DIR}/umac-nh-n.c - ${NETTLE_DIR}/umac-l2.c - ${NETTLE_DIR}/umac-l3.c - ${NETTLE_DIR}/umac-poly64.c - ${NETTLE_DIR}/umac-poly128.c - ${NETTLE_DIR}/umac-set-key.c - ${NETTLE_DIR}/umac32.c - ${NETTLE_DIR}/umac64.c - ${NETTLE_DIR}/umac96.c - ${NETTLE_DIR}/umac128.c - ${NETTLE_DIR}/version.c - ${NETTLE_DIR}/write-be32.c - ${NETTLE_DIR}/write-le32.c - ${NETTLE_DIR}/write-le64.c - ${NETTLE_DIR}/yarrow256.c - ${NETTLE_DIR}/yarrow_key_event.c - ${NETTLE_DIR}/xts.c - ${NETTLE_DIR}/xts-aes128.c - ${NETTLE_DIR}/xts-aes256.c - ) - -set(LIBNETTLE_INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR} - ${NETTLE_DIR} - ) - -add_library(nettle STATIC ${LIBNETTLE_SOURCES}) -target_include_directories(nettle PUBLIC ${LIBNETTLE_INCLUDES}) -target_compile_definitions(nettle PRIVATE ${LIBNETTLE_DEFINITIONS}) \ No newline at end of file diff --git a/app/src/main/cpp/nettle/config.h b/app/src/main/cpp/nettle/config.h deleted file mode 100644 index f98d965fd..000000000 --- a/app/src/main/cpp/nettle/config.h +++ /dev/null @@ -1,280 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -/* #undef CRAY_STACKSEG_END */ - -/* Define to 1 if using `alloca.c'. */ -/* #undef C_ALLOCA */ - -/* Define to 1 if you have `alloca', as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#define HAVE_ALLOCA_H 1 - -/* Define if __builtin_bswap64 is available */ -#define HAVE_BUILTIN_BSWAP64 1 - -/* Define if clock_gettime is available */ -#define HAVE_CLOCK_GETTIME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define if fcntl file locking is available */ -#define HAVE_FCNTL_LOCKING 1 - -/* Define if the compiler understands __attribute__ */ -#define HAVE_GCC_ATTRIBUTE 1 - -/* Define to 1 if you have the `getline' function. */ -#define HAVE_GETLINE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have dlopen (with -ldl). */ -#define HAVE_LIBDL 1 - -/* Define to 1 if you have the `gmp' library (-lgmp). */ -/* #undef HAVE_LIBGMP */ - -/* Define if compiler and linker supports __attribute__ ifunc */ -#define HAVE_LINK_IFUNC 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 each of the following for which a native (ie. CPU specific) - implementation of the corresponding routine exists. */ -/* #undef HAVE_NATIVE_memxor3 */ -/* #undef HAVE_NATIVE_aes_decrypt */ -/* #undef HAVE_NATIVE_aes_encrypt */ -/* #undef HAVE_NATIVE_aes128_decrypt */ -/* #undef HAVE_NATIVE_aes128_encrypt */ -/* #undef HAVE_NATIVE_aes128_invert_key */ -/* #undef HAVE_NATIVE_aes128_set_decrypt_key */ -/* #undef HAVE_NATIVE_aes128_set_encrypt_key */ -/* #undef HAVE_NATIVE_aes192_decrypt */ -/* #undef HAVE_NATIVE_aes192_encrypt */ -/* #undef HAVE_NATIVE_aes192_invert_key */ -/* #undef HAVE_NATIVE_aes192_set_decrypt_key */ -/* #undef HAVE_NATIVE_aes192_set_encrypt_key */ -/* #undef HAVE_NATIVE_aes256_decrypt */ -/* #undef HAVE_NATIVE_aes256_encrypt */ -/* #undef HAVE_NATIVE_aes256_invert_key */ -/* #undef HAVE_NATIVE_aes256_set_decrypt_key */ -/* #undef HAVE_NATIVE_aes256_set_encrypt_key */ -/* #undef HAVE_NATIVE_cbc_aes128_encrypt */ -/* #undef HAVE_NATIVE_cbc_aes192_encrypt */ -/* #undef HAVE_NATIVE_cbc_aes256_encrypt */ -/* #undef HAVE_NATIVE_chacha_core */ -/* #undef HAVE_NATIVE_chacha_2core */ -#define HAVE_NATIVE_chacha_3core 1 -/* #undef HAVE_NATIVE_chacha_4core */ -/* #undef HAVE_NATIVE_fat_chacha_2core */ -/* #undef HAVE_NATIVE_fat_chacha_3core */ -/* #undef HAVE_NATIVE_fat_chacha_4core */ -/* #undef HAVE_NATIVE_ecc_curve25519_modp */ -/* #undef HAVE_NATIVE_ecc_curve448_modp */ -/* #undef HAVE_NATIVE_ecc_secp192r1_modp */ -/* #undef HAVE_NATIVE_ecc_secp192r1_redc */ -/* #undef HAVE_NATIVE_ecc_secp224r1_modp */ -/* #undef HAVE_NATIVE_ecc_secp224r1_redc */ -/* #undef HAVE_NATIVE_ecc_secp256r1_modp */ -/* #undef HAVE_NATIVE_ecc_secp256r1_redc */ -/* #undef HAVE_NATIVE_ecc_secp384r1_modp */ -/* #undef HAVE_NATIVE_ecc_secp384r1_redc */ -/* #undef HAVE_NATIVE_ecc_secp521r1_modp */ -/* #undef HAVE_NATIVE_ecc_secp521r1_redc */ -/* #undef HAVE_NATIVE_poly1305_set_key */ -/* #undef HAVE_NATIVE_poly1305_block */ -/* #undef HAVE_NATIVE_poly1305_digest */ -/* #undef HAVE_NATIVE_poly1305_blocks */ -/* #undef HAVE_NATIVE_fat_poly1305_blocks */ -/* #undef HAVE_NATIVE_ghash_set_key */ -/* #undef HAVE_NATIVE_ghash_update */ -/* #undef HAVE_NATIVE_salsa20_core */ -#define HAVE_NATIVE_salsa20_2core 1 -/* #undef HAVE_NATIVE_fat_salsa20_2core */ -/* #undef HAVE_NATIVE_sha1_compress */ -/* #undef HAVE_NATIVE_sha256_compress_n */ -/* #undef HAVE_NATIVE_sha512_compress */ -/* #undef HAVE_NATIVE_sha3_permute */ -/* #undef HAVE_NATIVE_umac_nh */ -/* #undef HAVE_NATIVE_umac_nh_n */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_ECDSA_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENSSL_EVP_H */ - -/* Define to 1 if you have the `secure_getenv' function. */ -#define HAVE_SECURE_GETENV 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_VALGRIND_MEMCHECK_H */ - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "nettle-bugs@lists.lysator.liu.se" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "nettle" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "nettle 3.9.1" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "nettle" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "3.9.1" - -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG __SIZEOF_LONG__ - -/* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T __SIZEOF_SIZE_T__ - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -/* #undef STACK_DIRECTION */ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Defined if public key features are enabled */ -/* #undef WITH_HOGWEED */ - -/* Define if you have openssl's libcrypto (used for benchmarking) */ -/* #undef WITH_OPENSSL */ - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `int' if doesn't define. */ -/* #undef gid_t */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* Define to `int' if doesn't define. */ -/* #undef uid_t */ - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -/* Needed for alloca on windows */ -# if HAVE_MALLOC_H -# include -# endif -# endif -#else /* defined __GNUC__ */ -# if HAVE_ALLOCA_H -# include -# else -/* Needed for alloca on windows, also with gcc */ -# if HAVE_MALLOC_H -# include -# endif -# endif -#endif - - -#if HAVE_STRERROR -#define STRERROR strerror -#else -#define STRERROR(x) (sys_errlist[x]) -#endif - - -#if __GNUC__ && HAVE_GCC_ATTRIBUTE -# define NORETURN __attribute__ ((__noreturn__)) -# define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a))) -# define UNUSED __attribute__ ((__unused__)) -#else -# define NORETURN -# define PRINTF_STYLE(f, a) -# define UNUSED -#endif - - -#if defined(__x86_64__) || defined(__arch64__) -# define HAVE_NATIVE_64_BIT 1 -#else -/* Needs include of before use. */ -# define HAVE_NATIVE_64_BIT (SIZEOF_LONG * CHAR_BIT >= 64) -#endif - diff --git a/app/src/main/cpp/nettle/keymap.h b/app/src/main/cpp/nettle/keymap.h deleted file mode 100644 index 8d1c8b69c..000000000 --- a/app/src/main/cpp/nettle/keymap.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/src/main/cpp/nettle/rotors.h b/app/src/main/cpp/nettle/rotors.h deleted file mode 100644 index 8d1c8b69c..000000000 --- a/app/src/main/cpp/nettle/rotors.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/src/main/cpp/nettle/version.h b/app/src/main/cpp/nettle/version.h deleted file mode 100644 index 6aa193c6a..000000000 --- a/app/src/main/cpp/nettle/version.h +++ /dev/null @@ -1,64 +0,0 @@ -/* version.h - - Information about library version. - - Copyright (C) 2015 Red Hat, Inc. - Copyright (C) 2015 Niels Möller - - This file is part of GNU Nettle. - - GNU Nettle is free software: you can redistribute it and/or - modify it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - - or - - * the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your - option) any later version. - - or both in parallel, as here. - - GNU Nettle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received copies of the GNU General Public License and - the GNU Lesser General Public License along with this program. If - not, see http://www.gnu.org/licenses/. -*/ - -#ifndef NETTLE_VERSION_H_INCLUDED -#define NETTLE_VERSION_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* Individual version numbers in decimal */ -#define NETTLE_VERSION_MAJOR 3 -#define NETTLE_VERSION_MINOR 9 - -#define NETTLE_USE_MINI_GMP 0 - -/* We need a preprocessor constant for GMP_NUMB_BITS, simply using - sizeof(mp_limb_t) * CHAR_BIT is not good enough. */ -#if NETTLE_USE_MINI_GMP -# define GMP_NUMB_BITS n/a -#endif - -int -nettle_version_major (void); - -int -nettle_version_minor (void); - -#ifdef __cplusplus -} -#endif - -#endif /* NETTLE_VERSION_H_INCLUDED */