BLS Threshold CryptoSignatures
This library provides primitives for (blind) threshold cryptography. Currently supported curves are BN254(alt_bn128) and BLS12-381.
Work In Progress: DO NOT EXPECT ANY STABLE API NOW
Group functionality
src/group.rs contains the definitions of generic trait to work
with scalars of prime fields and points on elliptic curves. The following
Element trait allows to get a generic implementation of a polynomial with lagrange interpolation for both scalars and points.
There is an implementation of these traits using the curve BLS12-381 in
src/bls12381.rs.
Polynomial functionality
src/poly.rs contains the implementation of a polynomial
suitable to be used for secret sharing schemes and the dkg protocol. It can
evaluates shares and interpolate private and public shares to their
corresponding polynomial.
The following (from the tests) shows how to interploate a set of private shares:
use crateScalar as Sc;
Curve Implementations
Curently there are two curves available, BLS12 381 and BN254. By default they are enabled both, but you can select which one you want to use using
the features bls12_381 and bn254.
You can use them like this when adding the dependency to your Cargo.toml file.
# Only bls12_381
= { = "0.1", = false, = ["bls12_381"] }
# Only bn254
= { = "0.1", = false, = ["bn254"] }
# Both
= { = "0.1" }