aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/README.md
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2023-03-08 17:41:24 -0500
committerPieter Wuille <pieter@wuille.net>2023-03-08 17:41:24 -0500
commite5c7fcb361d3379c254a52104b4ba25907cd07bb (patch)
tree37e8e274f70f03efae813330d9e31c40a129d81b /src/secp256k1/README.md
parent710fd571ff4c3133e41d7f62922cb4cc816250d3 (diff)
parent763079a3f1b937f54e3c2d4166d296f596f7be1b (diff)
Update src/secp256k1 subtree to upstream libsecp256k1 v0.3.0
Diffstat (limited to 'src/secp256k1/README.md')
-rw-r--r--src/secp256k1/README.md43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/secp256k1/README.md b/src/secp256k1/README.md
index ffdc9aeaee..19dabe8505 100644
--- a/src/secp256k1/README.md
+++ b/src/secp256k1/README.md
@@ -60,10 +60,8 @@ Implementation details
* Optional runtime blinding which attempts to frustrate differential power analysis.
* The precomputed tables add and eventually subtract points for which no known scalar (secret key) is known, preventing even an attacker with control over the secret key used to control the data internally.
-Build steps
------------
-
-libsecp256k1 is built using autotools:
+Building with Autotools
+-----------------------
$ ./autogen.sh
$ ./configure
@@ -73,6 +71,43 @@ libsecp256k1 is built using autotools:
To compile optional modules (such as Schnorr signatures), you need to run `./configure` with additional flags (such as `--enable-module-schnorrsig`). Run `./configure --help` to see the full list of available flags.
+Building with CMake (experimental)
+----------------------------------
+
+To maintain a pristine source tree, CMake encourages to perform an out-of-source build by using a separate dedicated build tree.
+
+### Building on POSIX systems
+
+ $ mkdir build && cd build
+ $ cmake ..
+ $ make
+ $ make check # run the test suite
+ $ sudo make install # optional
+
+To compile optional modules (such as Schnorr signatures), you need to run `cmake` with additional flags (such as `-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON`). Run `cmake .. -LH` to see the full list of available flags.
+
+### Cross compiling
+
+To alleviate issues with cross compiling, preconfigured toolchain files are available in the `cmake` directory.
+For example, to cross compile for Windows:
+
+ $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-w64-mingw32.toolchain.cmake
+
+To cross compile for Android with [NDK](https://developer.android.com/ndk/guides/cmake) (using NDK's toolchain file, and assuming the `ANDROID_NDK_ROOT` environment variable has been set):
+
+ $ cmake .. -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28
+
+### Building on Windows
+
+To build on Windows with Visual Studio, a proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) must be specified for a new build tree.
+
+The following example assumes using of Visual Studio 2022 and CMake v3.21+.
+
+In "Developer Command Prompt for VS 2022":
+
+ >cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
+ >cmake --build build --config RelWithDebInfo
+
Usage examples
-----------
Usage examples can be found in the [examples](examples) directory. To compile them you need to configure with `--enable-examples`.