lovesh / signature-schemes

Rust library for BLS signatures, MuSig, PS signatures
Apache License 2.0
64 stars 19 forks source link

Add BLS compression support #13

Open JayPavlina opened 4 years ago

JayPavlina commented 4 years ago

These are the expected sizes according to the BLS specification:

When I call to_bytes on each type, I get these sizes:

Edit: It looks like the sizes match the ones described here, except for the public key which is 97 instead of 96. So I guess this means they are uncompressed. Is there a way to compress them so they match the other sizes?

lovesh commented 4 years ago

Points in G1 can be compressed but points in G2 cannot be using amcl. But Miracl Core does support compression of G2. I don't know if copying the compression code from Miracl Core and submitting in amcl is acceptable. But if we do that, then we move compression feature to GroupElement trait.

lovesh commented 4 years ago

The author of AMCL is willing to make an exception for point compression and willing to allow moving Miracl Core's code over to AMCL provided we make the change for all languages. I started the work on this here and the code works for Rust as i checked here. Would appreciate help doing it for other languages.

lovesh commented 4 years ago

I just found out that Miracl Core has been released as Apache-2. So no point maintaining miracl/amcl. Need to replace miracl/amcl in https://github.com/lovesh/amcl_rust_wrapper with miracl/core