#Zei: Findora's Cryptographic Library
Zei is a library that provide tools to create and verify public transaction with confidential data.
Support:
Benchmarks are available for XfrNote operations. To run them all:
cargo bench
The report is available at target/criterion/report/index.html
.
To run a specific benchmark:
cargo bench --bench {xfr_batch | xfr_{note|body}_{noidtracking|idtracking}_{assettracking|noassettracking}_{singleasset|multiasset}}_{time|cycles}
For example to run the benchmark for xfr notes with identity tracking, and no asset tracking for a single asset, run:
cargo bench --bench xfr_note_idtracking_noassettracking_singleasset_time
The benchmarks involving batch verification can be run with:
cargo bench --bench xfr_note_batch_time
Note that not all the combinations are implemented yet. So far the benchmarks available are
(replace time
by cycles
if you want the # of cpu cycles instead of seconds):
xfr_note_noidtracking_noassettracking_singleasset_time
xfr_note_idtracking_noassettracking_singleasset_time
xfr_note_idtracking_assettracking_multiasset_time
xfr_note_idtracking_assettracking_singleasset_time
xfr_body_idtracking_assettracking_singleasset_time
xfr_note_batch_time
Run the following script and select option 1)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
We use special hooks before committing. To enable these hooks, copy them to the .git
directory:
cp hooks/pre-commit .git/hooks/
The tests generate some parameters which are stored in the directory zei_api/data
.
If the tests fail, try first to remove the *.bin
files in this directory and launch the tests again.
We recommend using the option --release
for tests faster execution.
Run all the tests:
cargo test --all --release
Run only the documentation tests:
cargo test --doc --release
Tarpaulin is a test coverage tool for Rust. Note that Tarpaulin only supports x86_64 processors running Linux.
Install Tarpaulin:
cargo install cargo-tarpaulin
Run Tarpaulin, using a timeout of 120 seconds.
cargo tarpaulin --timeout 120
cargo doc --open
This tool allows to visualizes crates' dependencies as a tree.
To install:
cargo install cargo-tree
To run:
cargo tree
This tool allows to visualizes crates' dependencies as a graph.
First you need to install graphviz.
For ubuntu:
sudo apt install graphviz
Then install cargo-deps:
cargo install cargo-deps
Generate the graph of dependencies as an image:
cargo deps --no-transitive-deps | dot -Tpng > graph.png
Use the following command to install rustfmt, the tool that allows to format the code
according to some agreed standard defined in rustfmt.toml
.
rustup component add rustfmt
rustup self update
Then to format your code run
cargo fmt
To install, add the following to your project's Cargo.toml
:
[dependencies.zei]
version = "v0.1.4d"
Then, in your library or executable source, add:
extern crate zei;
By default, several zei
's tools uses curve25519-dalek
's u64_backend
feature, which uses Rust's i128
feature to achieve roughly double the speed as
the u32_backend
feature. When targetting 32-bit systems, however, you'll
likely want to compile with
cargo build --no-default-features --features="u32_backend"
.
If you're building for a machine with avx2 instructions, there's also the
experimental avx2_backend
. To use it, compile with
RUSTFLAGS="-C target_cpu=native" cargo build --no-default-features --features="avx2_backend"
If you want your project to point to a specific branch of zei do the following:
Cargo.toml
and replace the line (assume the branch name is refactor/api-module)zei = { git = "https://github.com/FindoraNetwork/zei"}
by
zei = { git = "https://github.com/FindoraNetwork/zei", tag = "v0.1.4d" }
The primary license for Zei is the Business Source License 1.1 (BUSL-1.1
), see LICENSE
.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。