Skip to content

Commit 66aae90

Browse files
committed
deps: add blst and upgrade crypto deps
1 parent 9ba7ec8 commit 66aae90

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

deps.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ fetch () {
135135
fi
136136
checkout_repo zstd https://github.com/facebook/zstd "v1.5.6"
137137
checkout_repo lz4 https://github.com/lz4/lz4 "v1.10.0"
138-
checkout_repo s2n https://github.com/awslabs/s2n-bignum "" "efa579c"
138+
checkout_repo s2n https://github.com/awslabs/s2n-bignum "" "4d2e22a"
139139
#checkout_repo openssl https://github.com/openssl/openssl "openssl-3.3.1"
140140
checkout_repo secp256k1 https://github.com/bitcoin-core/secp256k1 "v0.6.0"
141141
if [[ $DEVMODE == 1 ]]; then
142+
checkout_repo blst https://github.com/supranational/blst "v0.3.14"
142143
checkout_repo rocksdb https://github.com/facebook/rocksdb "v9.7.4"
143144
checkout_repo snappy https://github.com/google/snappy "1.2.1"
144145
fi
@@ -393,13 +394,30 @@ install_s2n () {
393394
echo "[+] Successfully installed s2n-bignum"
394395
}
395396

397+
install_blst () {
398+
cd "$PREFIX/git/blst"
399+
400+
echo "[+] Installing blst to $PREFIX"
401+
402+
# this is copied from ./build.sh:27
403+
CFLAGS=${CFLAGS:--O2 -fno-builtin -fPIC -Wall -Wextra -Werror}
404+
# this adds our flags, e.g. for MSAN
405+
CFLAGS+=" $EXTRA_CFLAGS"
406+
407+
CFLAGS=$CFLAGS ./build.sh
408+
cp libblst.a "$PREFIX/lib"
409+
cp bindings/*.h "$PREFIX/include"
410+
echo "[+] Successfully installed blst"
411+
}
412+
396413
install_secp256k1 () {
397414
cd "$PREFIX/git/secp256k1"
398415

399416
echo "[+] Configuring secp256k1"
400417
rm -rf build
401418
mkdir build
402419
cd build
420+
# https://github.com/bitcoin-core/secp256k1/blob/master/CMakeLists.txt#L59
403421
cmake .. \
404422
-G"Unix Makefiles" \
405423
-DCMAKE_INSTALL_PREFIX:PATH="$PREFIX" \
@@ -410,6 +428,7 @@ install_secp256k1 () {
410428
-DSECP256K1_BUILD_BENCHMARK=OFF \
411429
-DSECP256K1_DISABLE_SHARED=OFF \
412430
-DBUILD_SHARED_LIBS=OFF \
431+
-DSECP256K1_ENABLE_MODULE_ECDH=OFF \
413432
-DSECP256K1_ENABLE_MODULE_RECOVERY=ON \
414433
-DSECP256K1_ENABLE_MODULE_EXTRAKEYS=OFF \
415434
-DSECP256K1_ENABLE_MODULE_SCHNORRSIG=OFF \
@@ -578,6 +597,7 @@ install () {
578597
#( install_openssl )
579598
( install_secp256k1 )
580599
if [[ $DEVMODE == 1 ]]; then
600+
( install_blst )
581601
( install_snappy )
582602
( install_rocksdb )
583603
fi

0 commit comments

Comments
 (0)