Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
- name: Update submodules
run: git submodule update --init
- name: Build contract
run: make all-via-docker
run: make all-via-docker && ls -alth build
- name: Run omni_lock tests
run: cd tests/omni_lock_rust && cargo test
- name: Run omni_lock simulator tests
run: cd tests/omni_lock && bash run.sh
run: cd tests/omni_lock_rust && cargo test benchmark -- --nocapture
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = master
[submodule "deps/secp256k1-20210801"]
path = deps/secp256k1-20210801
url = https://github.com/nervosnetwork/secp256k1.git
branch = schnorr
url = https://github.com/bitcoin-core/secp256k1.git
branch = master
2 changes: 1 addition & 1 deletion deps/secp256k1-20210801
Submodule secp256k1-20210801 updated 54 files
+0 −101 .cirrus.yml
+34 −0 .github/actions/print-logs/action.yml
+155 −274 .github/workflows/ci.yml
+4 −0 .gitignore
+25 −1 CHANGELOG.md
+16 −55 CMakeLists.txt
+0 −1 CMakePresets.json
+1 −0 CONTRIBUTING.md
+13 −2 Makefile.am
+53 −17 README.md
+17 −3 ci/ci.sh
+6 −2 ci/linux-debian.Dockerfile
+5 −5 configure.ac
+5 −4 examples/ecdh.c
+7 −6 examples/ecdsa.c
+6 −5 examples/ellswift.c
+8 −7 examples/musig.c
+7 −6 examples/schnorr.c
+54 −68 include/secp256k1.h
+4 −4 include/secp256k1_extrakeys.h
+74 −45 src/CMakeLists.txt
+16 −11 src/bench.c
+1 −1 src/bench.h
+35 −3 src/bench_ecmult.c
+3 −2 src/bench_internal.c
+3 −2 src/ctime_tests.c
+3 −0 src/eckey_impl.h
+2 −0 src/ecmult_const_impl.h
+5 −1 src/group.h
+38 −0 src/group_impl.h
+1 −0 src/modules/ecdh/Makefile.am.include
+41 −0 src/modules/ecdh/tests_impl.h
+13 −5 src/modules/musig/session_impl.h
+6 −7 src/modules/musig/tests_impl.h
+2 −0 src/modules/schnorrsig/main_impl.h
+3 −2 src/precompute_ecmult.c
+3 −2 src/precompute_ecmult_gen.c
+4 −2 src/precomputed_ecmult.h
+3 −1 src/precomputed_ecmult_gen.h
+2 −2 src/scalar_impl.h
+3 −15 src/secp256k1.c
+26 −30 src/tests.c
+2 −2 src/tests_exhaustive.c
+1 −1 src/util.h
+12 −0 src/util_local_visibility.h
+13 −4 src/wycheproof/WYCHEPROOF_COPYING
+2,008 −0 src/wycheproof/ecdh_secp256k1_test.h
+8,444 −0 src/wycheproof/ecdh_secp256k1_test.json
+1 −1 src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h
+2 −2 src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json
+72 −0 tools/symbol-check.py
+166 −0 tools/tests_wycheproof_generate_ecdh.py
+3 −7 tools/tests_wycheproof_generate_ecdsa.py
+12 −0 tools/wycheproof_utils.py
2 changes: 1 addition & 1 deletion tests/omni_lock_rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CKB_HASH_PERSONALIZATION: &[u8] = b"ckb-default-hash";
const BINARIES: &[(&str, &str)] = &[
(
"omni_lock",
"8f3e1e01b6d8fff5c9fe12f773912902397c733c23cdc42635081cd49326db68",
"01618e4bf2c438e95a82bfc0540bbf6594a54c829c11b97ef2ba7f9473883890",
),
];

Expand Down
8 changes: 7 additions & 1 deletion tests/omni_lock_rust/tests/test_omni_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ fn test_btc_success(vtype: u8) {

verifier.set_debug_printer(debug_printer);
let verify_result = verifier.verify(MAX_CYCLES);
verify_result.expect("pass verification");
let cycles = (verify_result.unwrap() as f64) / 1024. / 1024.;
println!("cycles = {:.2} M", cycles);
}

fn test_btc_err_pubkey(vtype: u8) {
Expand Down Expand Up @@ -556,6 +557,11 @@ fn test_btc(vtype: u8) {
test_btc_err_pubkey(vtype);
}

#[test]
fn test_btc_benchmark() {
test_btc_success(BITCOIN_V_TYPE_SEGWITBECH32);
}

#[test]
fn test_btc_unlock() {
test_btc(BITCOIN_V_TYPE_P2PKHUNCOMPRESSED);
Expand Down