AlexiaChen / mpvss-rs

The library implements a simple Publicly Verifiable Secret Sharing(PVSS) scheme in Rust.
Apache License 2.0
20 stars 3 forks source link

Public keys #6

Open charleschege opened 3 years ago

charleschege commented 3 years ago

How are the public keys for the participants generated? Would it be possible to switch them to a new algorithm like Ed25519 for Public Key generation?

charleschege commented 3 years ago

From what I can tell, currently, the generated public/private key pair is 2048 bit in length. Is it a custom implementation of a public key generation algorithm?

Can we speed it up by allowing public/private key pairs using more efficient algorithms like Ed25519?

AlexiaChen commented 3 years ago

public key generated on More Modular Exponential (MODP) Diffie-Hellman groups, it's also prime order group like ECC points cycle group https://tools.ietf.org/html/rfc3526 . I mentioned before, now, it does not meet the requirement for production enviroment. ECC groups are plan in the future. you can try to change code for Ed25519 using Rust trait, this can adding more curves including secp256k1 or twisted Edward Curve(Ed25519 Curve)

the impl is here https://github.com/AlexiaChen/mpvss-rs/blob/214c1d19a00494600cee1d8563a68c77dc69b6d9/src/mpvss.rs#L81-L100

There is no restriction on the specific structure of the group in the PVSS paper, It only needs to be a prime order group

AlexiaChen commented 3 years ago

Sorry. This was indeed my previous plan: to support more curves(you can check README), but since this project is an amateur one, that feature is not supported now. So there is no specific time point for this feature to be supported. Thank you for your feedback

AlexiaChen commented 3 years ago

Is this an urgent issue for you?

If you know something about cryptography, you should be able to check my implementation code and add a configurable function for generating a secret key pair algorithm (since many curves have Rust implementations already), but it takes quite a bit of time.

charleschege commented 3 years ago

Not urgent, I will keep you informed when I need a production implementation

AlexiaChen commented 3 years ago

Yes, this project is an implementation of the PVSS thesis, mainly because the PVSS algorithm does not focus on specific curves and was first done as an attempt to make a prototype. In fact, the PVSS paper is not too difficult, you can look at the README inside the references provided, in particular, \<how to share secret> which is an earlier paper that helps you understand the implementation code。 finally try to read \<A Simple Publicly Verifiable Secret Sharing Scheme and its Application to Electronic Voting>

AlexiaChen commented 3 years ago

But rest assured, the key pair algorithm here is not my own invention and is safe. It just may not meet your needs. If you need to be faster, you can consider using libgmp acceleration. Because here modpow these operations are slower.

hope these informations can help you.