Skip to content

Commit 84c5416

Browse files
committed
Merge bitcoin/bitcoin#28093: subtree: update libsecp256k1 to latest master
5080c9c build: adapt Windows builds for libsecp256k1 build changes (fanquake) ff061fd Squashed 'src/secp256k1/' changes from 705ce7ed8c..c545fdc374 (fanquake) Pull request description: Includes bitcoin-core/secp256k1#1378. Which fixes #28079. Adapts Windows build for bitcoin-core/secp256k1#1367. ACKs for top commit: hebasto: ACK 5080c9c, I've made the `src/secp256k1` subtree update locally and got zero diff with this PR branch. jonasnick: ACK 5080c9c Tree-SHA512: 37915d420ebacefc6bc82c2511bff3d6884e01d5c92795f19cd61862f96b30aa1fe768aeabec128c9d25c1d8bc62b46b46969626067266074b39566ad9e2f5ba
2 parents 24d5cf9 + 5080c9c commit 84c5416

38 files changed

+376
-332
lines changed

build_msvc/common.init.vcxproj.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
9191
<DisableSpecificWarnings>4018;4244;4267;4715;4805</DisableSpecificWarnings>
9292
<TreatWarningAsError>true</TreatWarningAsError>
93-
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93+
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9494
<AdditionalIncludeDirectories>..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9595
</ClCompile>
9696
<Link>

configure.ac

+2
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ case $host in
714714
AC_MSG_ERROR([windres not found])
715715
fi
716716

717+
CORE_CPPFLAGS="$CORE_CPPFLAGS -DSECP256K1_STATIC"
718+
717719
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
718720
dnl Prevent the definition of min/max macros.
719721
dnl We always want to use the standard library.

src/secp256k1/.cirrus.yml

+25-29
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ cat_logs_snippet: &CAT_LOGS
5454
cat_ci_env_script:
5555
- env
5656

57-
merge_base_script_snippet: &MERGE_BASE
58-
merge_base_script:
59-
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
60-
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
61-
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
62-
6357
linux_container_snippet: &LINUX_CONTAINER
6458
container:
6559
dockerfile: ci/linux-debian.Dockerfile
@@ -68,12 +62,12 @@ linux_container_snippet: &LINUX_CONTAINER
6862
# Gives us more CPUs for free if they're available.
6963
greedy: true
7064
# More than enough for our scripts.
71-
memory: 1G
65+
memory: 2G
7266

7367
task:
7468
name: "x86_64: Linux (Debian stable)"
7569
<< : *LINUX_CONTAINER
76-
matrix: &ENV_MATRIX
70+
matrix:
7771
- env: {WIDEMUL: int64, RECOVERY: yes}
7872
- env: {WIDEMUL: int64, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
7973
- env: {WIDEMUL: int128}
@@ -86,14 +80,18 @@ task:
8680
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETESTS: no, BENCH: no}
8781
- env: {CPPFLAGS: -DDETERMINISTIC}
8882
- env: {CFLAGS: -O0, CTIMETESTS: no}
83+
- env: {CFLAGS: -O1, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
8984
- env: { ECMULTGENPRECISION: 2, ECMULTWINDOW: 2 }
9085
- env: { ECMULTGENPRECISION: 8, ECMULTWINDOW: 4 }
9186
matrix:
9287
- env:
9388
CC: gcc
9489
- env:
9590
CC: clang
96-
<< : *MERGE_BASE
91+
- env:
92+
CC: gcc-snapshot
93+
- env:
94+
CC: clang-snapshot
9795
test_script:
9896
- ./ci/cirrus.sh
9997
<< : *CAT_LOGS
@@ -111,7 +109,6 @@ task:
111109
CC: i686-linux-gnu-gcc
112110
- env:
113111
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
114-
<< : *MERGE_BASE
115112
test_script:
116113
- ./ci/cirrus.sh
117114
<< : *CAT_LOGS
@@ -125,20 +122,22 @@ task:
125122
HOMEBREW_NO_INSTALL_CLEANUP: 1
126123
# Cirrus gives us a fixed number of 4 virtual CPUs. Not that we even have that many jobs at the moment...
127124
MAKEFLAGS: -j5
128-
matrix:
129-
<< : *ENV_MATRIX
130125
env:
131126
ASM: no
132127
WITH_VALGRIND: no
133128
CTIMETESTS: no
129+
CC: clang
134130
matrix:
135-
- env:
136-
CC: gcc
137-
- env:
138-
CC: clang
131+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
132+
- env: {WIDEMUL: int64, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
133+
- env: {WIDEMUL: int128_struct, ECMULTGENPRECISION: 2, ECMULTWINDOW: 4}
134+
- env: {WIDEMUL: int128, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes}
135+
- env: {WIDEMUL: int128, RECOVERY: yes, SCHNORRSIG: yes}
136+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CC: gcc}
137+
- env: {WIDEMUL: int128, RECOVERY: yes, ECDH: yes, SCHNORRSIG: yes, ELLSWIFT: yes, CPPFLAGS: -DVERIFY}
138+
- env: {BUILD: distcheck}
139139
brew_script:
140140
- brew install automake libtool gcc
141-
<< : *MERGE_BASE
142141
test_script:
143142
- ./ci/cirrus.sh
144143
<< : *CAT_LOGS
@@ -157,7 +156,6 @@ task:
157156
SCHNORRSIG: yes
158157
ELLSWIFT: yes
159158
CTIMETESTS: no
160-
<< : *MERGE_BASE
161159
test_script:
162160
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
163161
- rm /etc/ld.so.cache
@@ -180,7 +178,6 @@ task:
180178
matrix:
181179
- env: {}
182180
- env: {EXPERIMENTAL: yes, ASM: arm32}
183-
<< : *MERGE_BASE
184181
test_script:
185182
- ./ci/cirrus.sh
186183
<< : *CAT_LOGS
@@ -198,7 +195,6 @@ task:
198195
SCHNORRSIG: yes
199196
ELLSWIFT: yes
200197
CTIMETESTS: no
201-
<< : *MERGE_BASE
202198
test_script:
203199
- ./ci/cirrus.sh
204200
<< : *CAT_LOGS
@@ -216,7 +212,6 @@ task:
216212
SCHNORRSIG: yes
217213
ELLSWIFT: yes
218214
CTIMETESTS: no
219-
<< : *MERGE_BASE
220215
test_script:
221216
- ./ci/cirrus.sh
222217
<< : *CAT_LOGS
@@ -237,7 +232,6 @@ task:
237232
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
238233
env:
239234
HOST: i686-w64-mingw32
240-
<< : *MERGE_BASE
241235
test_script:
242236
- ./ci/cirrus.sh
243237
<< : *CAT_LOGS
@@ -280,7 +274,6 @@ task:
280274
CC: /opt/msvc/bin/x86/cl
281275
AR: /opt/msvc/bin/x86/lib
282276
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
283-
<< : *MERGE_BASE
284277
test_script:
285278
- ./ci/cirrus.sh
286279
<< : *CAT_LOGS
@@ -325,7 +318,6 @@ task:
325318
- env:
326319
HOST: i686-linux-gnu
327320
CC: i686-linux-gnu-gcc
328-
<< : *MERGE_BASE
329321
test_script:
330322
- ./ci/cirrus.sh
331323
<< : *CAT_LOGS
@@ -352,7 +344,6 @@ task:
352344
ECMULTGENPRECISION: 2
353345
ECMULTWINDOW: 2
354346
CFLAGS: "-fsanitize=memory -g -O3"
355-
<< : *MERGE_BASE
356347
test_script:
357348
- ./ci/cirrus.sh
358349
<< : *CAT_LOGS
@@ -369,7 +360,6 @@ task:
369360
RECOVERY: yes
370361
SCHNORRSIG: yes
371362
ELLSWIFT: yes
372-
<< : *MERGE_BASE
373363
test_script:
374364
- ./ci/cirrus.sh
375365
<< : *CAT_LOGS
@@ -401,11 +391,17 @@ task:
401391
# Ignore MSBuild warning MSB8029.
402392
# See: https://learn.microsoft.com/en-us/visualstudio/msbuild/errors/msb8029?view=vs-2022
403393
IgnoreWarnIntDirInTempDetected: 'true'
404-
merge_script:
405-
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; }
394+
matrix:
395+
- env:
396+
BUILD_SHARED_LIBS: ON
397+
- env:
398+
BUILD_SHARED_LIBS: OFF
399+
git_show_script:
400+
# Print commit to allow reproducing the job outside of CI.
401+
- git show --no-patch
406402
configure_script:
407403
- '%x64_NATIVE_TOOLS%'
408-
- cmake -E env CFLAGS="/WX" cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON
404+
- cmake -E env CFLAGS="/WX" cmake -A x64 -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
409405
build_script:
410406
- '%x64_NATIVE_TOOLS%'
411407
- cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5

src/secp256k1/CHANGELOG.md

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

88
## [Unreleased]
99

10+
#### Added
11+
- New module `ellswift` implements ElligatorSwift encoding for public keys and x-only Diffie-Hellman key exchange for them.
12+
ElligatorSwift permits representing secp256k1 public keys as 64-byte arrays which cannot be distinguished from uniformly random. See:
13+
- Header file `include/secp256k1_ellswift.h` which defines the new API.
14+
- Document `doc/ellswift.md` which explains the mathematical background of the scheme.
15+
- The [paper](https://eprint.iacr.org/2022/759) on which the scheme is based.
16+
17+
#### Changed
18+
- When consuming libsecp256k1 as a static library on Windows, the user must now define the `SECP256K1_STATIC` macro before including `secp256k1.h`.
19+
1020
## [0.3.2] - 2023-05-13
1121
We strongly recommend updating to 0.3.2 if you use or plan to use GCC >=13 to compile libsecp256k1. When in doubt, check the GCC version using `gcc -v`.
1222

src/secp256k1/Makefile.am

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ endif
153153
if USE_EXAMPLES
154154
noinst_PROGRAMS += ecdsa_example
155155
ecdsa_example_SOURCES = examples/ecdsa.c
156-
ecdsa_example_CPPFLAGS = -I$(top_srcdir)/include
156+
ecdsa_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
157157
ecdsa_example_LDADD = libsecp256k1.la
158158
ecdsa_example_LDFLAGS = -static
159159
if BUILD_WINDOWS
@@ -163,7 +163,7 @@ TESTS += ecdsa_example
163163
if ENABLE_MODULE_ECDH
164164
noinst_PROGRAMS += ecdh_example
165165
ecdh_example_SOURCES = examples/ecdh.c
166-
ecdh_example_CPPFLAGS = -I$(top_srcdir)/include
166+
ecdh_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
167167
ecdh_example_LDADD = libsecp256k1.la
168168
ecdh_example_LDFLAGS = -static
169169
if BUILD_WINDOWS
@@ -174,7 +174,7 @@ endif
174174
if ENABLE_MODULE_SCHNORRSIG
175175
noinst_PROGRAMS += schnorr_example
176176
schnorr_example_SOURCES = examples/schnorr.c
177-
schnorr_example_CPPFLAGS = -I$(top_srcdir)/include
177+
schnorr_example_CPPFLAGS = -I$(top_srcdir)/include -DSECP256K1_STATIC
178178
schnorr_example_LDADD = libsecp256k1.la
179179
schnorr_example_LDFLAGS = -static
180180
if BUILD_WINDOWS

src/secp256k1/ci/cirrus.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set -eux
44

55
export LC_ALL=C
66

7-
# Print relevant CI environment to allow reproducing the job outside of CI.
7+
# Print commit and relevant CI environment to allow reproducing the job outside of CI.
8+
git show --no-patch
89
print_environment() {
910
# Turn off -x because it messes up the output
1011
set +x
@@ -53,6 +54,22 @@ if [ -n "$WRAPPER_CMD" ]; then
5354
$WRAPPER_CMD --version
5455
fi
5556

57+
# Workaround for https://bugs.kde.org/show_bug.cgi?id=452758 (fixed in valgrind 3.20.0).
58+
case "${CC:-undefined}" in
59+
clang*)
60+
if [ "$CTIMETESTS" = "yes" ] && [ "$WITH_VALGRIND" = "yes" ]
61+
then
62+
export CFLAGS="${CFLAGS:+$CFLAGS }-gdwarf-4"
63+
else
64+
case "$WRAPPER_CMD" in
65+
valgrind*)
66+
export CFLAGS="${CFLAGS:+$CFLAGS }-gdwarf-4"
67+
;;
68+
esac
69+
fi
70+
;;
71+
esac
72+
5673
./autogen.sh
5774

5875
./configure \

src/secp256k1/ci/linux-debian.Dockerfile

+41-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM debian:stable
22

3+
SHELL ["/bin/bash", "-c"]
4+
35
RUN dpkg --add-architecture i386 && \
46
dpkg --add-architecture s390x && \
57
dpkg --add-architecture armhf && \
@@ -9,11 +11,11 @@ RUN dpkg --add-architecture i386 && \
911
# dkpg-dev: to make pkg-config work in cross-builds
1012
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
1113
RUN apt-get update && apt-get install --no-install-recommends -y \
12-
git ca-certificates \
14+
git ca-certificates wget \
1315
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
14-
gcc clang llvm libc6-dbg \
16+
gcc clang llvm libclang-rt-dev libc6-dbg \
1517
g++ \
16-
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libubsan1:i386 libasan6:i386 \
18+
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libubsan1:i386 libasan8:i386 \
1719
gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x \
1820
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libc6-dbg:armhf \
1921
gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 \
@@ -23,9 +25,44 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2325
sagemath
2426

2527
WORKDIR /root
26-
# The "wine" package provides a convience wrapper that we need
28+
29+
# Build and install gcc snapshot
30+
ARG GCC_SNAPSHOT_MAJOR=14
31+
RUN wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \
32+
wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \
33+
sha512sum --check --ignore-missing sha512.sum && \
34+
# We should have downloaded exactly one tar.xz file
35+
ls && \
36+
[[ $(ls *.tar.xz | wc -l) -eq "1" ]] && \
37+
tar xf *.tar.xz && \
38+
mkdir gcc-build && cd gcc-build && \
39+
apt-get update && apt-get install --no-install-recommends -y libgmp-dev libmpfr-dev libmpc-dev flex && \
40+
../*/configure --prefix=/opt/gcc-snapshot --enable-languages=c --disable-bootstrap --disable-multilib --without-isl && \
41+
make -j $(nproc) && \
42+
make install && \
43+
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
44+
45+
# Install clang snapshot
46+
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
47+
# Add repository for this Debian release
48+
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
49+
# Install clang snapshot
50+
apt-get update && apt-get install --no-install-recommends -y clang && \
51+
# Remove just the "clang" symlink again
52+
apt-get remove -y clang && \
53+
# We should have exactly two clang versions now
54+
ls /usr/bin/clang* && \
55+
[[ $(ls /usr/bin/clang-?? | sort | wc -l) -eq "2" ]] && \
56+
# Create symlinks for them
57+
ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
58+
ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
59+
60+
# The "wine" package provides a convenience wrapper that we need
2761
RUN apt-get update && apt-get install --no-install-recommends -y \
2862
git ca-certificates wine64 wine python3-simplejson python3-six msitools winbind procps && \
63+
# Workaround for `wine` package failure to employ the Debian alternatives system properly.
64+
ln -s /usr/lib/wine/wine64 /usr/bin/wine64 && \
65+
# Set of tools for using MSVC on Linux.
2966
git clone https://github.com/mstorsjo/msvc-wine && \
3067
mkdir /opt/msvc && \
3168
python3 msvc-wine/vsdownload.py --accept-license --dest /opt/msvc Microsoft.VisualStudio.Workload.VCTools && \

src/secp256k1/configure.ac

-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
127127
SECP_TRY_APPEND_CFLAGS([-wd4267], $1) # Disable warning C4267 "'var' : conversion from 'size_t' to 'type', possible loss of data".
128128
# Eliminate deprecation warnings for the older, less secure functions.
129129
CPPFLAGS="-D_CRT_SECURE_NO_WARNINGS $CPPFLAGS"
130-
# We pass -ignore:4217 to the MSVC linker to suppress warning 4217 when
131-
# importing variables from a statically linked secp256k1.
132-
# (See the libtool manual, section "Windows DLLs" for background.)
133-
# Unfortunately, libtool tries to be too clever and strips "-Xlinker arg"
134-
# into "arg", so this will be " -Xlinker -ignore:4217" after stripping.
135-
LDFLAGS="-Xlinker -Xlinker -Xlinker -ignore:4217 $LDFLAGS"
136130
fi
137131
])
138132
SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)

src/secp256k1/doc/ellswift.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $$
8888
\begin{array}{lcl}
8989
X(u, t) & = & \left\\{\begin{array}{ll}
9090
\dfrac{g(u) - t^2}{2t} & a = 0 \\
91-
\dfrac{g(u) + h(u)(Y_0(u) + X_0(u)t)^2}{X_0(u)(1 + h(u)t^2)} & a \neq 0
91+
\dfrac{g(u) + h(u)(Y_0(u) - X_0(u)t)^2}{X_0(u)(1 + h(u)t^2)} & a \neq 0
9292
\end{array}\right. \\
9393
Y(u, t) & = & \left\\{\begin{array}{ll}
9494
\dfrac{X(u, t) + t}{u \sqrt{-3}} = \dfrac{g(u) + t^2}{2tu\sqrt{-3}} & a = 0 \\
@@ -329,7 +329,7 @@ $t$ value for multiple $c$ inputs (thereby biasing that encoding):
329329
it requires $g(u)=0$ which is already outlawed on even-ordered curves and impossible on others; in the second it would trigger division by zero.
330330
* Curve-specific special cases also exist that need to be rejected, because they result in $(u,t)$ which is invalid to the decoder, or because of division by zero in the encoder:
331331
* For $a=0$ curves, when $u=0$ or when $t=0$. The latter can only be reached by the encoder when $g(u)=0$, which requires an even-ordered curve.
332-
* For $a \neq 0$ curves, when $X_0(u)=0$, when $h(u)t^2 = -1$, or when $2w(u + 2v) = 2X_0(u)$ while also either $w \neq 2Y_0(u)$ or $h(u)=0$.
332+
* For $a \neq 0$ curves, when $X_0(u)=0$, when $h(u)t^2 = -1$, or when $w(u + 2v) = 2X_0(u)$ while also either $w \neq 2Y_0(u)$ or $h(u)=0$.
333333

334334
**Define** a version of $G_{c,u}(x)$ which deals with all these cases:
335335
* If $a=0$ and $u=0$, return $\bot.$

src/secp256k1/examples/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ target_link_libraries(example INTERFACE
66
secp256k1
77
$<$<PLATFORM_ID:Windows>:bcrypt>
88
)
9-
if(NOT BUILD_SHARED_LIBS AND MSVC)
10-
target_link_options(example INTERFACE /IGNORE:4217)
11-
endif()
129

1310
add_executable(ecdsa_example ecdsa.c)
1411
target_link_libraries(ecdsa_example example)

src/secp256k1/examples/examples_util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void secure_erase(void *ptr, size_t len) {
9595
* As best as we can tell, this is sufficient to break any optimisations that
9696
* might try to eliminate "superfluous" memsets.
9797
* This method used in memzero_explicit() the Linux kernel, too. Its advantage is that it is
98-
* pretty efficient, because the compiler can still implement the memset() efficently,
98+
* pretty efficient, because the compiler can still implement the memset() efficiently,
9999
* just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
100100
* Yang et al. (USENIX Security 2017) for more background.
101101
*/

0 commit comments

Comments
 (0)