diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9783251d65..c592ba6426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,7 @@ jobs: matrix: configuration: - env_vars: {} - - env_vars: { EXPERIMENTAL: 'yes', ASM: 'arm32' } + - env_vars: { ASM: 'arm32' } env: WRAPPER_CMD: 'qemu-arm' diff --git a/CMakeLists.txt b/CMakeLists.txt index 11dc3f6e53..f3e1ac82d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,36 +87,30 @@ if(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY) endif() mark_as_advanced(FORCE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY) -set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\" (experimental). [default=AUTO]") +set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\". [default=AUTO]") set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32") check_string_option_value(SECP256K1_ASM) -if(SECP256K1_ASM STREQUAL "arm32") +if(NOT SECP256K1_ASM STREQUAL "OFF") enable_language(ASM) + include(CheckX86_64Assembly) include(CheckArm32Assembly) + check_x86_64_assembly() check_arm32_assembly() - if(HAVE_ARM32_ASM) - add_compile_definitions(USE_EXTERNAL_ASM=1) - else() + if(SECP256K1_ASM STREQUAL "arm32" AND NOT HAVE_ARM32_ASM) message(FATAL_ERROR "ARM32 assembly requested but not available.") + elseif(SECP256K1_ASM STREQUAL "x86_64" AND NOT HAVE_X86_64_ASM) + message(FATAL_ERROR "x86_64 assembly requested but not available.") endif() -elseif(SECP256K1_ASM) - include(CheckX86_64Assembly) - check_x86_64_assembly() if(HAVE_X86_64_ASM) - set(SECP256K1_ASM "x86_64") add_compile_definitions(USE_ASM_X86_64=1) - elseif(SECP256K1_ASM STREQUAL "AUTO") - set(SECP256K1_ASM "OFF") - else() - message(FATAL_ERROR "x86_64 assembly requested but not available.") + elseif(HAVE_ARM32_ASM) + add_compile_definitions(USE_EXTERNAL_ASM=1) + set(SECP256K1_USE_EXTERNAL_ASM TRUE) endif() endif() option(SECP256K1_EXPERIMENTAL "Allow experimental configuration options." OFF) if(NOT SECP256K1_EXPERIMENTAL) - if(SECP256K1_ASM STREQUAL "arm32") - message(FATAL_ERROR "ARM32 assembly is experimental. Use -DSECP256K1_EXPERIMENTAL=ON to allow.") - endif() endif() set(SECP256K1_VALGRIND "AUTO" CACHE STRING "Build with extra checks for running inside Valgrind. [default=AUTO]") diff --git a/README.md b/README.md index 90edae1a2c..896763170a 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ Implementation details * Optimized implementation of arithmetic modulo the curve's field size (2^256 - 0x1000003D1). * Using 5 52-bit limbs * Using 10 26-bit limbs (including hand-optimized assembly for 32-bit ARM, by Wladimir J. van der Laan). - * This is an experimental feature that has not received enough scrutiny to satisfy the standard of quality of this library but is made available for testing and review by the community. * Scalar operations * Optimized implementation without data-dependent branches of arithmetic modulo the curve's order. * Using 4 64-bit limbs (relying on __int128 support in the compiler). diff --git a/configure.ac b/configure.ac index 2f156ddc25..efa9a4c40a 100644 --- a/configure.ac +++ b/configure.ac @@ -204,7 +204,7 @@ AC_ARG_ENABLE(external_default_callbacks, AC_ARG_WITH([test-override-wide-multiply], [] ,[set_widemul=$withval], [set_widemul=auto]) AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm32|no|auto], -[assembly to use (experimental: arm32) [default=auto]])],[req_asm=$withval], [req_asm=auto]) +[assembly to use [default=auto]])],[req_asm=$withval], [req_asm=auto]) AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE], [window size for ecmult precomputation for verification, specified as integer in range [2..24].] @@ -438,9 +438,7 @@ fi ### if test x"$enable_experimental" = x"no"; then - if test x"$set_asm" = x"arm32"; then - AC_MSG_ERROR([ARM32 assembly is experimental. Use --enable-experimental to allow.]) - fi + : fi ### diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa3b2903eb..6eca3455cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,7 +64,7 @@ add_library(secp256k1_objs INTERFACE) target_sources(secp256k1_objs INTERFACE $ $) add_library(secp256k1_asm INTERFACE) -if(SECP256K1_ASM STREQUAL "arm32") +if(SECP256K1_USE_EXTERNAL_ASM) add_library(secp256k1_asm_arm OBJECT EXCLUDE_FROM_ALL) target_sources(secp256k1_asm_arm PUBLIC asm/field_10x26_arm.s