#bls

bls_eth_rust

BLS signature library for Ethereum 2.0

1 unstable release

0.0.2 Feb 13, 2020

#1732 in Cryptography

BSD-3-Clause OR MIT OR Apache-2.0

19KB
378 lines

bls-eth for Rust

This is a wrapper library of bls with BLS_ETH=1.

How to build libbls384_256.a

copy from bls-eth-go-binary/bls/lib or build it at yourself according to readme.md.

News

The new eth2.0 functions are supported.

bls-eth-rust eth2.0 spec name
SecretKey::sign Sign
PublicKey::verify Verify
Signature::aggregate Aggregate
Signature::fast_aggregate_verify FastAggregateVerify
Signature::aggregate_verify_no_check AggregateVerify

Check functions:

  • verify_signature_order ; make deserialize check the correctness of the order
  • Signature::is_valid_order ; check the correctness of the order
  • verify_publickey_order ; make deserialize check the correctness of the order
  • PublicKey::is_valid_order ; check the correctness of the order
  • are_all_msg_different ; check that all messages are different each other

How to test

env RUSTFLAGS="-L<directory of libbls384_256.a>" cargo test

For example, on Linux,

mkdir work
cd work
git clone https://github.com/herumi/bls-eth-go-binary
git clone https://github.com/herumi/bls-eth-rust
cd bls-eth-rust
env RUSTFLAGS="-L../bls-eth-go-binary/bls/lib/linux/amd64/" cargo test

How to run benchs

env RUSTFLAGS="-L../bls-eth-go-binary/bls/lib/linux/amd64/" cargo bench

License

modified new BSD License http://opensource.org/licenses/BSD-3-Clause

Author

MITSUNARI Shigeo(herumi@nifty.com)

Dependencies

~8–12MB
~208K SLoC