Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
deps: rm pairing cryptography library bn
Browse files Browse the repository at this point in the history
  • Loading branch information
Flouse committed Sep 30, 2022
1 parent a4a2be6 commit c662a89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
[submodule "deps/mbedtls"]
path = deps/mbedtls
url = https://github.com/nervosnetwork/mbedtls.git
[submodule "deps/bn"]
path = deps/bn
url = https://github.com/mohanson/bn
[submodule "deps/godwoken-scripts"]
path = deps/godwoken-scripts
url = https://github.com/nervosnetwork/godwoken-scripts.git
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ PROTOCOL_SCHEMA_URL := https://raw.githubusercontent.com/nervosnetwork/godwoken/

ALL_OBJS := build/execution_state.o build/baseline.o build/analysis.o build/instruction_metrics.o build/instruction_names.o build/execution.o build/instructions.o build/instructions_calls.o build/evmone.o \
build/keccak.o build/keccakf800.o \
build/sha256.o build/memzero.o build/ripemd160.o build/bignum.o build/platform_util.o \
build/libalt_bn128.a
build/sha256.o build/memzero.o build/ripemd160.o build/bignum.o build/platform_util.o
BIN_DEPS := c/contracts.h c/sudt_contracts.h c/other_contracts.h c/polyjuice.h c/polyjuice_utils.h build/secp256k1_data_info.h $(ALL_OBJS)
GENERATOR_DEPS := c/generator/secp256k1_helper.h $(BIN_DEPS)
VALIDATOR_DEPS := c/validator/secp256k1_helper.h $(BIN_DEPS)
Expand All @@ -58,15 +57,15 @@ all: build/blockchain.h build/godwoken.h \
build/generator build/validator \
build/generator_log build/validator_log

all-via-docker: generate-protocol fetch-gw-scripts build/libalt_bn128.a
all-via-docker: generate-protocol fetch-gw-scripts
mkdir -p build
docker run --rm -v `pwd`:/code -w /code ${BUILDER_DOCKER} make
make patch-generator && make patch-generator_log
log-version-via-docker: generate-protocol build/libalt_bn128.a
log-version-via-docker: generate-protocol
mkdir -p build
docker run --rm -v `pwd`:/code -w /code ${BUILDER_DOCKER} bash -c "make build/generator_log && make build/validator_log"

all-via-docker-in-debug-mode: generate-protocol build/libalt_bn128.a
all-via-docker-in-debug-mode: generate-protocol
docker run --rm -v `pwd`:/code -w /code ${BUILDER_DOCKER} make all-in-debug-mode
# Be aware that a given prerequisite will only be built once per invocation of make, at most.
all-in-debug-mode: LDFLAGS := -g # only use -O0 to decrease compile time while coding and debugging (O0 compile time: 1m58s)
Expand Down Expand Up @@ -196,12 +195,6 @@ build/platform_util.o: deps/mbedtls/library/platform_util.c
build/bignum.o: deps/mbedtls/library/bignum.c
$(CC) $(CFLAGS) $(LDFLAGS) -c -o $@ $<

# Pairing cryptography library in Rust
build/libalt_bn128.a:
cd deps/bn/alt_bn128_staticlib && rustup target add riscv64imac-unknown-none-elf
cd deps/bn/alt_bn128_staticlib && cargo build --release --target riscv64imac-unknown-none-elf
cp deps/bn/alt_bn128_staticlib/target/riscv64imac-unknown-none-elf/release/libalt_bn128.a build/

build/sha256.o: deps/crypto-algorithms/sha256.c
$(CXX) $(CFLAGS) $(LDFLAGS) -c -o $@ $<

Expand Down
1 change: 0 additions & 1 deletion deps/bn
Submodule bn deleted from 956783

0 comments on commit c662a89

Please sign in to comment.