This is Algorand's implementation of Pixel signature, over the BLS12-381 curve. Useful links:
- Paper
- Spec
- Rust code: this repo
- Python code
- Another python code <- This code is only for generating test vectors and cross comparing with Rust's output. It should not be used for any other purpose.
- Pairing-plus library: Github, Crate.io
- A fork of zkcrypto's pairing library; with additional functions such as
hash to groups
andmembership testing
, etc. - We rely heavily on this library for underlying arithmetics.
- A fork of zkcrypto's pairing library; with additional functions such as
- Pixel_param: Github
- We use the default parameters generated from this crate.
- BLS_SIG: Github, Crate.io
- This library is only used for generating and verifying proof of possession.
- Version Alpha.
- This code has NOT been deployed in production.
- This code has been externally audited by two consulting firms.
cargo build
builds a debug version;cargo build --release
builds the release version;
cargo test [--release]
runs basic tests;cargo test -- --ignored [--release]
runs long tests;cargo bench
runs benchmarks.
test_vector
calls this rust library to generate a list of test vectors.pixel-python/test_vector.py
is a python script that generates a list of test vectors.test_vector.py
also compares the binary outputs of Rust and python match.
Following the guidelines from Facebook's libra source code and Rust API Guidelines.
cargo fmt
for coding stylecargo clippy --all-targets --all-features -- -D warnings
for lintcargo doc
for documentation.
Exceptions:
- Facebooks guidelines suggests to have a test file along with the source code. Pixel has a separate test folder that contains all test codes.
- Variables that storing secret data are named with a suffix
_sec
. Always ensure primitive types get cleaned withZeroize
crate; or get passed to the caller. Secret key related structures implementszeroing
on drop. - Avoiding using
clone()
function on secret data as possible - this will create two copies of the data. Ifclone()
is used, always clean it after use.
- Run
cargo doc --open
- See
target/doc/pixel/index.html