Skip to content

Commit

Permalink
New version 0.4.0 (#75)
Browse files Browse the repository at this point in the history
* Removed hardcoded rust version (#73)

* Removed hardcoded rust version

* Fixed typo in readme.md and build.md

* Updated dependency and version to 0.4.0 (#74)

* Updated dependency

* New version

* Remove fixed dependencies (#67)

---------

Co-authored-by: nicholas-mainardi <[email protected]>
  • Loading branch information
la10736 and nicholas-mainardi authored Jun 29, 2023
1 parent 273e699 commit 7a14963
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 157 deletions.
72 changes: 36 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ script: ci/script.sh

jobs:
include:
#- name: bionic_rust-1.51.0_latest
# env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='*' RUSTFLAGS=' '
#- name: bionic_rust-1.51.0_latest_asm
# env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='*' RUSTFLAGS='--emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_build
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='006,007,008' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_cargo-test
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='001' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_examples
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='002' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_mc-test-cert
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='003' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_mc-test-cert-keyrot
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='004' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-1.51.0_latest_asm_target-feature_mc-test-csw
env: IMAGE_TAG=bionic_rust-1.51.0_latest TESTS='005' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: bionic_rust-nightly-2021-04-25_latest
# env: IMAGE_TAG=bionic_rust-nightly-2021-04-25_latest TESTS='*' CARGOARGS='+nightly-2021-04-25' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: focal_rust-1.51.0_latest
# env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='*' RUSTFLAGS=' '
#- name: focal_rust-1.51.0_latest_asm
# env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='*' RUSTFLAGS='--emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_build
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='006,007,008' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_cargo-test
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='001' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_examples
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='002' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_mc-test-cert
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='003' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_mc-test-cert-keyrot
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='004' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-1.51.0_latest_asm_target-feature_mc-test-csw
env: IMAGE_TAG=focal_rust-1.51.0_latest TESTS='005' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: focal_rust-nightly-2021-04-25_latest
# env: IMAGE_TAG=focal_rust-nightly-2021-04-25_latest TESTS='*' CARGOARGS='+nightly-2021-04-25' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: bionic_rust-stable_latest
# env: IMAGE_TAG=bionic_rust-stable_latest TESTS='*' RUSTFLAGS=' '
#- name: bionic_rust-stable_latest_asm
# env: IMAGE_TAG=bionic_rust-stable_latest TESTS='*' RUSTFLAGS='--emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_build
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='006,007,008' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_cargo-test
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='001' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_examples
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='002' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_mc-test-cert
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='003' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_mc-test-cert-keyrot
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='004' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: bionic_rust-stable_latest_asm_target-feature_mc-test-csw
env: IMAGE_TAG=bionic_rust-stable_latest TESTS='005' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: bionic_rust-nightly_latest
# env: IMAGE_TAG=bionic_rust-nightly_latest TESTS='*' CARGOARGS='+nightly' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: focal_rust-stable_latest
# env: IMAGE_TAG=focal_rust-stable_latest TESTS='*' RUSTFLAGS=' '
#- name: focal_rust-stable_latest_asm
# env: IMAGE_TAG=focal_rust-stable_latest TESTS='*' RUSTFLAGS='--emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_build
env: IMAGE_TAG=focal_rust-stable_latest TESTS='006,007,008' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_cargo-test
env: IMAGE_TAG=focal_rust-stable_latest TESTS='001' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_examples
env: IMAGE_TAG=focal_rust-stable_latest TESTS='002' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_mc-test-cert
env: IMAGE_TAG=focal_rust-stable_latest TESTS='003' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_mc-test-cert-keyrot
env: IMAGE_TAG=focal_rust-stable_latest TESTS='004' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
- name: focal_rust-stable_latest_asm_target-feature_mc-test-csw
env: IMAGE_TAG=focal_rust-stable_latest TESTS='005' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: focal_rust-nightly_latest
# env: IMAGE_TAG=focal_rust-nightly_latest TESTS='*' CARGOARGS='+nightly' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
13 changes: 9 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# Build guide

The library compiles on the `1.51.0 stable` toolchain of the Rust compiler. To install Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the appropriate Rust toolchain by invoking:
```bash
rustup install 1.51.0
```
The library compiles on the `stable` Rust toolchain.
To install Rust, just install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager.

After that, use `cargo`, the standard Rust build tool, to build the library:

```bash
git clone https://github.com/HorizenOfficial/zendoo-mc-cryptolib.git
cd zendoo-mc-cryptolib
cargo build --release
```

This library comes with unit tests for each of the provided crates. Run the tests with:

```bash
cargo test --all-features
```

Compiling with `adcxq`, `adoxq` and `mulxq` instructions can lead to a 30-70% speedup. These are available on most `x86_64` platforms (Broadwell onwards for Intel and Ryzen onwards for AMD). Run the following command:

```bash
RUSTFLAGS="-C target-feature=+bmi2,+adx" cargo test/build/bench --features asm
```

Tip: If optimising for performance, your mileage may vary with passing `--emit=asm` to `RUSTFLAGS`.
Loading

0 comments on commit 7a14963

Please sign in to comment.