Skip to content

Commit 88e2b6a

Browse files
committed
Add support for Ed25519 key generation
Fixes #6 Add support for Ed25519 key generation in the MPVSS implementation. * **src/mpvss.rs** - Import `ed25519_dalek` crate for Ed25519 key generation. - Add `KeyAlgorithm` enum to represent key generation algorithms. - Update `MPVSS` struct to include `key_algorithm` field. - Add `generate_ed25519_keypair` function to generate Ed25519 key pairs. - Update `generate_private_key` and `generate_public_key` functions to support both original and Ed25519 algorithms. * **README.md** - Update "Initialization" section to include Ed25519 key generation. - Add a note about Ed25519 key generation in the "In the futures" section. * **tests/mpvss_tests.rs** - Add `test_ed25519_key_generation` function to verify Ed25519 key generation. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/AlexiaChen/mpvss-rs/issues/6?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 98b8963 commit 88e2b6a

File tree

3 files changed

+62
-335
lines changed

3 files changed

+62
-335
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ p2.initialize();
5454
p3.initialize();
5555
```
5656

57+
To generate Ed25519 key pairs, you can use the `generate_ed25519_keypair` function:
58+
59+
```rust
60+
use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature, Signer};
61+
62+
let (secret_key, public_key) = generate_ed25519_keypair();
63+
```
64+
5765
#### Distribution & Verification
5866

5967
The dealer splits the secret into shares, encrypts them and creates a proof so that everybody can verify that the shares (once decrypted) can be used to reconstruct the secret. The threshold determines how many shares are necessary for the reconstruction. The encrypted shares and the proof are then bundled together.
@@ -143,6 +151,8 @@ assert_eq!(secret_message.clone(), r3_str);
143151

144152
Add more Elliptic Curves groups.
145153

154+
Note: Ed25519 key generation is now supported.
155+
146156
## Related References:
147157

148158
- Berry Schoenmakers. [A Simple Publicly Verifiable Secret Sharing Scheme and its Application to Electronic Voting](https://www.win.tue.nl/~berry/papers/crypto99.pdf)
@@ -168,4 +178,4 @@ Because the ploynomial commitments does not Pedersen commitment and DLEQ is only
168178
## License
169179
Dual-licensed to be compatible with the Rust project.
170180

171-
Licensed under the Apache License, Version 2.0 [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) or the MIT license [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT), at your option. This file may not be copied, modified, or distributed except according to those terms.
181+
Licensed under the Apache License, Version 2.0 [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) or the MIT license [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT), at your option. This file may not be copied, modified, or distributed except according to those terms.

0 commit comments

Comments
 (0)