Skip to content

Commit ca3d945

Browse files
committed
Squashed 'src/secp256k1/' changes from d8311688bd..06bff6dec8
06bff6dec8 Merge bitcoin-core/secp256k1#1528: tests: call `secp256k1_ecmult_multi_var` with a non-`NULL` error callback 4155e62fcc Merge bitcoin-core/secp256k1#1526: cmake: Fix `check_arm32_assembly` when using as subproject 9554362b15 tests: call secp256k1_ecmult_multi_var with a non-NULL error callback 9f4c8cd730 cmake: Fix `check_arm32_assembly` when using as subproject 7712a53061 Merge bitcoin-core/secp256k1#1524: check-abi: explicitly provide public headers 7d0bc0870f Merge bitcoin-core/secp256k1#1525: changelog: Correct 0.5.0 release date d45d9b74bb changelog: Correct 0.5.0 release date d7f6613dbb Merge bitcoin-core/secp256k1#1523: release cleanup: bump version after 0.5.0 2f05e2da4b release cleanup: bump version after 0.5.0 e3a885d42a Merge bitcoin-core/secp256k1#1522: release: prepare for 0.5.0 dd695563e6 check-abi: explicitly provide public headers c0e4ec3fee release: prepare for 0.5.0 bb528cfb08 Merge bitcoin-core/secp256k1#1518: Add secp256k1_pubkey_sort 7d2591ce12 Add secp256k1_pubkey_sort da515074e3 Merge bitcoin-core/secp256k1#1058: Signed-digit multi-comb ecmult_gen algorithm 4c341f89ab Add changelog entry for SDMC a043940253 Permit COMB_BITS < 256 for exhaustive tests 39b2f2a321 Add test case for ecmult_gen recoded = {-1,0,1} 644e86de9a Reintroduce projective blinding 07810d9abb Reduce side channels from single-bit reads a0d32b597d Optimization: use Nx32 representation for recoded bits e03dcc44b5 Make secp256k1_scalar_get_bits support 32-bit reads 5005abee60 Rename scalar_get_bits -> scalar_get_bits_limb32; return uint32_t 6247f485b6 Optimization: avoid unnecessary doublings in precomputation 15d0cca2a6 Optimization: first table lookup needs no point addition 7a33db35cd Optimization: move (2^COMB_BITS-1)/2 term into ctx->scalar_offset ed2a056f3d Provide 3 configurations accessible through ./configure 5f7be9f6a5 Always generate tables for current (blocks,teeth) config fde1dfcd8d Signed-digit multi-comb ecmult_gen algorithm 486518b350 Make exhaustive tests's scalar_inverse(&x,&x) work ab45c3e089 Initial gej blinding -> final ge blinding aa00a6b892 Introduce CEIL_DIV macro and use it git-subtree-dir: src/secp256k1 git-subtree-split: 06bff6dec8d038f7b4112664a9b882293ebc5178
1 parent 53eec53 commit ca3d945

29 files changed

+2876
-9985
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
BUILD: check
1212
### secp256k1 config
1313
ECMULTWINDOW: auto
14-
ECMULTGENPRECISION: auto
14+
ECMULTGENKB: auto
1515
ASM: no
1616
WIDEMUL: auto
1717
WITH_VALGRIND: yes

.github/workflows/ci.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
BUILD: 'check'
2323
### secp256k1 config
2424
ECMULTWINDOW: 'auto'
25-
ECMULTGENPRECISION: 'auto'
25+
ECMULTGENKB: 'auto'
2626
ASM: 'no'
2727
WIDEMUL: 'auto'
2828
WITH_VALGRIND: 'yes'
@@ -83,8 +83,8 @@ jobs:
8383
- env_vars: { CPPFLAGS: '-DDETERMINISTIC' }
8484
- env_vars: { CFLAGS: '-O0', CTIMETESTS: 'no' }
8585
- env_vars: { CFLAGS: '-O1', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
86-
- env_vars: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
87-
- env_vars: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
86+
- env_vars: { ECMULTGENKB: 2, ECMULTWINDOW: 2 }
87+
- env_vars: { ECMULTGENKB: 86, ECMULTWINDOW: 4 }
8888
cc:
8989
- 'gcc'
9090
- 'clang'
@@ -377,8 +377,8 @@ jobs:
377377
configuration:
378378
- env_vars: { CC: 'clang', ASM: 'auto' }
379379
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
380-
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
381-
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
380+
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
381+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
382382

383383
env:
384384
# The `--error-exitcode` is required to make the test fail if valgrind found errors,
@@ -431,8 +431,8 @@ jobs:
431431
configuration:
432432
- env_vars: { CC: 'clang', ASM: 'auto' }
433433
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'auto' }
434-
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
435-
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
434+
- env_vars: { CC: 'clang', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
435+
- env_vars: { CC: 'i686-linux-gnu-gcc', HOST: 'i686-linux-gnu', ASM: 'no', ECMULTGENKB: 2, ECMULTWINDOW: 2 }
436436

437437
env:
438438
ECDH: 'yes'
@@ -487,7 +487,7 @@ jobs:
487487
- env_vars:
488488
CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g'
489489
- env_vars:
490-
ECMULTGENPRECISION: 2
490+
ECMULTGENKB: 2
491491
ECMULTWINDOW: 2
492492
CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g -O3'
493493

@@ -600,7 +600,7 @@ jobs:
600600
matrix:
601601
env_vars:
602602
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
603-
- { WIDEMUL: 'int128_struct', ECMULTGENPRECISION: 2, ECMULTWINDOW: 4 }
603+
- { WIDEMUL: 'int128_struct', ECMULTGENKB: 2, ECMULTWINDOW: 4 }
604604
- { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
605605
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
606606
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }

CHANGELOG.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.5.0] - 2024-05-06
11+
12+
#### Added
13+
- New function `secp256k1_ec_pubkey_sort` that sorts public keys using lexicographic (of compressed serialization) order.
14+
15+
#### Changed
16+
- The implementation of the point multiplication algorithm used for signing and public key generation was changed, resulting in improved performance for those operations.
17+
- The related configure option `--ecmult-gen-precision` was replaced with `--ecmult-gen-kb` (`ECMULT_GEN_KB` for CMake).
18+
- This changes the supported precomputed table sizes for these operations. The new supported sizes are 2 KiB, 22 KiB, or 86 KiB (while the old supported sizes were 32 KiB, 64 KiB, or 512 KiB).
19+
20+
#### ABI Compatibility
21+
The ABI is backward compatible with versions 0.4.x and 0.3.x.
22+
1023
## [0.4.1] - 2023-12-21
1124

1225
#### Changed
@@ -115,7 +128,8 @@ This version was in fact never released.
115128
The number was given by the build system since the introduction of autotools in Jan 2014 (ea0fe5a5bf0c04f9cc955b2966b614f5f378c6f6).
116129
Therefore, this version number does not uniquely identify a set of source files.
117130

118-
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.1...HEAD
131+
[unreleased]: https://github.com/bitcoin-core/secp256k1/compare/v0.5.0...HEAD
132+
[0.5.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.1...v0.5.0
119133
[0.4.1]: https://github.com/bitcoin-core/secp256k1/compare/v0.4.0...v0.4.1
120134
[0.4.0]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.2...v0.4.0
121135
[0.3.2]: https://github.com/bitcoin-core/secp256k1/compare/v0.3.1...v0.3.2

CMakeLists.txt

+20-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project(libsecp256k1
1111
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
1212
# the API. All changes in experimental modules are treated as
1313
# backwards-compatible and therefore at most increase the minor version.
14-
VERSION 0.4.2
14+
VERSION 0.5.1
1515
DESCRIPTION "Optimized C library for ECDSA signatures and secret/public key operations on curve secp256k1."
1616
HOMEPAGE_URL "https://github.com/bitcoin-core/secp256k1"
1717
LANGUAGES C
@@ -34,9 +34,9 @@ endif()
3434
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
3535
# All changes in experimental modules are treated as if they don't affect the
3636
# interface and therefore only increase the revision.
37-
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 3)
38-
set(${PROJECT_NAME}_LIB_VERSION_REVISION 2)
39-
set(${PROJECT_NAME}_LIB_VERSION_AGE 1)
37+
set(${PROJECT_NAME}_LIB_VERSION_CURRENT 4)
38+
set(${PROJECT_NAME}_LIB_VERSION_REVISION 1)
39+
set(${PROJECT_NAME}_LIB_VERSION_AGE 2)
4040

4141
set(CMAKE_C_STANDARD 90)
4242
set(CMAKE_C_EXTENSIONS OFF)
@@ -101,13 +101,22 @@ if(SECP256K1_ECMULT_WINDOW_SIZE STREQUAL "AUTO")
101101
endif()
102102
add_compile_definitions(ECMULT_WINDOW_SIZE=${SECP256K1_ECMULT_WINDOW_SIZE})
103103

104-
set(SECP256K1_ECMULT_GEN_PREC_BITS "AUTO" CACHE STRING "Precision bits to tune the precomputed table size for signing, specified as integer 2, 4 or 8. \"AUTO\" is a reasonable setting for desktop machines (currently 4). [default=AUTO]")
105-
set_property(CACHE SECP256K1_ECMULT_GEN_PREC_BITS PROPERTY STRINGS "AUTO" 2 4 8)
106-
check_string_option_value(SECP256K1_ECMULT_GEN_PREC_BITS)
107-
if(SECP256K1_ECMULT_GEN_PREC_BITS STREQUAL "AUTO")
108-
set(SECP256K1_ECMULT_GEN_PREC_BITS 4)
104+
set(SECP256K1_ECMULT_GEN_KB "AUTO" CACHE STRING "The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms). Larger values result in possibly better signing or key generation performance at the cost of a larger table. Valid choices are 2, 22, 86. \"AUTO\" is a reasonable setting for desktop machines (currently 22). [default=AUTO]")
105+
set_property(CACHE SECP256K1_ECMULT_GEN_KB PROPERTY STRINGS "AUTO" 2 22 86)
106+
check_string_option_value(SECP256K1_ECMULT_GEN_KB)
107+
if(SECP256K1_ECMULT_GEN_KB STREQUAL "AUTO")
108+
set(SECP256K1_ECMULT_GEN_KB 22)
109+
endif()
110+
if(SECP256K1_ECMULT_GEN_KB EQUAL 2)
111+
add_compile_definitions(COMB_BLOCKS=2)
112+
add_compile_definitions(COMB_TEETH=5)
113+
elseif(SECP256K1_ECMULT_GEN_KB EQUAL 22)
114+
add_compile_definitions(COMB_BLOCKS=11)
115+
add_compile_definitions(COMB_TEETH=6)
116+
elseif(SECP256K1_ECMULT_GEN_KB EQUAL 86)
117+
add_compile_definitions(COMB_BLOCKS=43)
118+
add_compile_definitions(COMB_TEETH=6)
109119
endif()
110-
add_compile_definitions(ECMULT_GEN_PREC_BITS=${SECP256K1_ECMULT_GEN_PREC_BITS})
111120

112121
set(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY "OFF" CACHE STRING "Test-only override of the (autodetected by the C code) \"widemul\" setting. Legal values are: \"OFF\", \"int128_struct\", \"int128\" or \"int64\". [default=OFF]")
113122
set_property(CACHE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY PROPERTY STRINGS "OFF" "int128_struct" "int128" "int64")
@@ -294,7 +303,7 @@ message(" schnorrsig .......................... ${SECP256K1_ENABLE_MODULE_SCHNO
294303
message(" ElligatorSwift ...................... ${SECP256K1_ENABLE_MODULE_ELLSWIFT}")
295304
message("Parameters:")
296305
message(" ecmult window size .................. ${SECP256K1_ECMULT_WINDOW_SIZE}")
297-
message(" ecmult gen precision bits ........... ${SECP256K1_ECMULT_GEN_PREC_BITS}")
306+
message(" ecmult gen table size ............... ${SECP256K1_ECMULT_GEN_KB} KiB")
298307
message("Optional features:")
299308
message(" assembly ............................ ${SECP256K1_ASM}")
300309
message(" external callbacks .................. ${SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS}")

Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ noinst_HEADERS += src/field.h
6464
noinst_HEADERS += src/field_impl.h
6565
noinst_HEADERS += src/bench.h
6666
noinst_HEADERS += src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h
67+
noinst_HEADERS += src/hsort.h
68+
noinst_HEADERS += src/hsort_impl.h
6769
noinst_HEADERS += contrib/lax_der_parsing.h
6870
noinst_HEADERS += contrib/lax_der_parsing.c
6971
noinst_HEADERS += contrib/lax_der_privatekey_parsing.h

ci/ci.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ print_environment() {
1212
# There are many ways to print variable names and their content. This one
1313
# does not rely on bash.
1414
for var in WERROR_CFLAGS MAKEFLAGS BUILD \
15-
ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
15+
ECMULTWINDOW ECMULTGENKB ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
1616
EXPERIMENTAL ECDH RECOVERY SCHNORRSIG ELLSWIFT \
1717
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
1818
EXAMPLES \
@@ -74,7 +74,7 @@ esac
7474
--enable-experimental="$EXPERIMENTAL" \
7575
--with-test-override-wide-multiply="$WIDEMUL" --with-asm="$ASM" \
7676
--with-ecmult-window="$ECMULTWINDOW" \
77-
--with-ecmult-gen-precision="$ECMULTGENPRECISION" \
77+
--with-ecmult-gen-kb="$ECMULTGENKB" \
7878
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
7979
--enable-module-ellswift="$ELLSWIFT" \
8080
--enable-module-schnorrsig="$SCHNORRSIG" \

cmake/CheckArm32Assembly.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function(check_arm32_assembly)
22
try_compile(HAVE_ARM32_ASM
3-
${CMAKE_BINARY_DIR}/check_arm32_assembly
4-
SOURCES ${CMAKE_SOURCE_DIR}/cmake/source_arm32.s
3+
${PROJECT_BINARY_DIR}/check_arm32_assembly
4+
SOURCES ${PROJECT_SOURCE_DIR}/cmake/source_arm32.s
55
)
66
endfunction()

configure.ac

+25-20
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ AC_PREREQ([2.60])
44
# the API. All changes in experimental modules are treated as
55
# backwards-compatible and therefore at most increase the minor version.
66
define(_PKG_VERSION_MAJOR, 0)
7-
define(_PKG_VERSION_MINOR, 4)
8-
define(_PKG_VERSION_PATCH, 2)
7+
define(_PKG_VERSION_MINOR, 5)
8+
define(_PKG_VERSION_PATCH, 1)
99
define(_PKG_VERSION_IS_RELEASE, false)
1010

1111
# The library version is based on libtool versioning of the ABI. The set of
1212
# rules for updating the version can be found here:
1313
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
1414
# All changes in experimental modules are treated as if they don't affect the
1515
# interface and therefore only increase the revision.
16-
define(_LIB_VERSION_CURRENT, 3)
17-
define(_LIB_VERSION_REVISION, 2)
18-
define(_LIB_VERSION_AGE, 1)
16+
define(_LIB_VERSION_CURRENT, 4)
17+
define(_LIB_VERSION_REVISION, 1)
18+
define(_LIB_VERSION_AGE, 2)
1919

2020
AC_INIT([libsecp256k1],m4_join([.], _PKG_VERSION_MAJOR, _PKG_VERSION_MINOR, _PKG_VERSION_PATCH)m4_if(_PKG_VERSION_IS_RELEASE, [true], [], [-dev]),[https://github.com/bitcoin-core/secp256k1/issues],[libsecp256k1],[https://github.com/bitcoin-core/secp256k1])
2121

@@ -213,13 +213,12 @@ AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto],
213213
)],
214214
[req_ecmult_window=$withval], [req_ecmult_window=auto])
215215

216-
AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision=2|4|8|auto],
217-
[Precision bits to tune the precomputed table size for signing.]
218-
[The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision.]
219-
[A larger table size usually results in possible faster signing.]
220-
["auto" is a reasonable setting for desktop machines (currently 4). [default=auto]]
216+
AC_ARG_WITH([ecmult-gen-kb], [AS_HELP_STRING([--with-ecmult-gen-kb=2|22|86|auto],
217+
[The size of the precomputed table for signing in multiples of 1024 bytes (on typical platforms).]
218+
[Larger values result in possibly better signing/keygeneration performance at the cost of a larger table.]
219+
["auto" is a reasonable setting for desktop machines (currently 22). [default=auto]]
221220
)],
222-
[req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto])
221+
[req_ecmult_gen_kb=$withval], [req_ecmult_gen_kb=auto])
223222

224223
AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto],
225224
[Build with extra checks for running inside Valgrind [default=auto]]
@@ -358,19 +357,25 @@ case $set_ecmult_window in
358357
;;
359358
esac
360359

361-
# Set ecmult gen precision
362-
if test x"$req_ecmult_gen_precision" = x"auto"; then
363-
set_ecmult_gen_precision=4
360+
# Set ecmult gen kb
361+
if test x"$req_ecmult_gen_kb" = x"auto"; then
362+
set_ecmult_gen_kb=22
364363
else
365-
set_ecmult_gen_precision=$req_ecmult_gen_precision
364+
set_ecmult_gen_kb=$req_ecmult_gen_kb
366365
fi
367366

368-
case $set_ecmult_gen_precision in
369-
2|4|8)
370-
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DECMULT_GEN_PREC_BITS=$set_ecmult_gen_precision"
367+
case $set_ecmult_gen_kb in
368+
2)
369+
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=2 -DCOMB_TEETH=5"
370+
;;
371+
22)
372+
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=11 -DCOMB_TEETH=6"
373+
;;
374+
86)
375+
SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=43 -DCOMB_TEETH=6"
371376
;;
372377
*)
373-
AC_MSG_ERROR(['ecmult gen precision not 2, 4, 8 or "auto"'])
378+
AC_MSG_ERROR(['ecmult gen table size not 2, 22, 86 or "auto"'])
374379
;;
375380
esac
376381

@@ -475,7 +480,7 @@ echo " module ellswift = $enable_module_ellswift"
475480
echo
476481
echo " asm = $set_asm"
477482
echo " ecmult window size = $set_ecmult_window"
478-
echo " ecmult gen prec. bits = $set_ecmult_gen_precision"
483+
echo " ecmult gen table size = $set_ecmult_gen_kb KiB"
479484
# Hide test-only options unless they're used.
480485
if test x"$set_widemul" != xauto; then
481486
echo " wide multiplication = $set_widemul"

include/secp256k1.h

+14
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,20 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_cmp(
474474
const secp256k1_pubkey *pubkey2
475475
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
476476

477+
/** Sort public keys using lexicographic (of compressed serialization) order
478+
*
479+
* Returns: 0 if the arguments are invalid. 1 otherwise.
480+
*
481+
* Args: ctx: pointer to a context object
482+
* In: pubkeys: array of pointers to pubkeys to sort
483+
* n_pubkeys: number of elements in the pubkeys array
484+
*/
485+
SECP256K1_API int secp256k1_ec_pubkey_sort(
486+
const secp256k1_context *ctx,
487+
const secp256k1_pubkey **pubkeys,
488+
size_t n_pubkeys
489+
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
490+
477491
/** Parse an ECDSA signature in compact (64 bytes) format.
478492
*
479493
* Returns: 1 when the signature could be parsed, 0 otherwise.

src/ecmult_const_impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, cons
214214
#ifdef VERIFY
215215
/* Verify that v1 and v2 are in range [0, 2^129-1]. */
216216
for (i = 129; i < 256; ++i) {
217-
VERIFY_CHECK(secp256k1_scalar_get_bits(&v1, i, 1) == 0);
218-
VERIFY_CHECK(secp256k1_scalar_get_bits(&v2, i, 1) == 0);
217+
VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&v1, i, 1) == 0);
218+
VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&v2, i, 1) == 0);
219219
}
220220
#endif
221221

0 commit comments

Comments
 (0)