Based on a fork of the Rust pairing library.
Tested with Rust 1.35.
You can use cargo test
to run the unit test suite. For testing against the supplied
test vectors, use the bls_sigs_test
crate.
From the bls_sigs_test
directory, you can run, for example,
cargo run --bin hash_g1 ../../test-vectors/hash_g1/rfc6979
The binaries hash_g1
, hash_g2
, sig_g1
, and sig_g2
are all available, and do more or less what you'd expect.
Each one takes one or more filenames as inputs. Files should follow the test vector format.
If no expected output is included in the test vector, the binary prints the result it got. Otherwise, it checks
the output against the expected output and panics if anything is amiss.
More examples:
cargo run --bin sig_g1 ../../test-vectors/sig_g1/*
cargo run --bin hash_g2 ../../test-vectors/rfc6979
Note that, especially when testing signatures, you probably want to run in release mode (cargo run --release --bin ...
),
otherwise things will be quite slow.
(C) 2019 Riad S. Wahby [email protected]
See the license in the toplevel directory of this repository.