Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Jun 29, 2023
1 parent 4ceb904 commit 6e7ceaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ Now you're ready to generate a key!
```rust
use cggmp21::supported_curves::Secp256k1;

let eid = cggmp21::ExecutionId::new(b"execution id, unique per protocol execution");
let i = /* signer index (0 <= i < n) */;
let n = /* amount of signers taking part in key generation */;
let t = /* threshold */;
let eid = /* execution id, unique per protocol execution */;

let incomplete_key_share = cggmp21::keygen::<Secp256k1>(eid, i, n)
.set_threshold(t)
Expand All @@ -72,9 +72,9 @@ the same indexes as at keygen.
// Primes generation can take a while
let pregenerated_primes = cggmp21::PregeneratedPrimes::generate(&mut OsRng);

let eid = cggmp21::ExecutionId::new(b"execution id, unique per protocol execution");
let i = /* signer index, same as at keygen */;
let n = /* amount of signers */;
let eid = /* execution id, unique per protocol execution */;

let aux_info = cggmp21::aux_info_gen(eid, i, n, pregenerated_primes)
.start(&mut OsRng, party)
Expand Down
6 changes: 2 additions & 4 deletions cggmp21/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@
//! use cggmp21::supported_curves::Secp256k1;
//! # use rand_core::OsRng;
//!
//! let eid = cggmp21::ExecutionId::new(b"execution id, unique per protocol execution");
//! let i = /* signer index (0 <= i < n) */
//! # 0;
//! let n = /* amount of signers taking part in key generation */
//! # 3;
//! let t = /* threshold */
//! # 2;
//! let eid = /* execution id, unique per protocol execution */
//! # cggmp21::ExecutionId::new(b"some id");
//!
//! let incomplete_key_share = cggmp21::keygen::<Secp256k1>(eid, i, n)
//! .set_threshold(t)
Expand All @@ -96,12 +95,11 @@
//! // Primes generation can take a while
//! let pregenerated_primes = cggmp21::PregeneratedPrimes::generate(&mut OsRng);
//!
//! let eid = cggmp21::ExecutionId::new(b"execution id, unique per protocol execution");
//! let i = /* signer index, same as at keygen */
//! # 0;
//! let n = /* amount of signers */
//! # 3;
//! let eid = /* execution id, unique per protocol execution */
//! # cggmp21::ExecutionId::new(b"some id");
//!
//! let aux_info = cggmp21::aux_info_gen(eid, i, n, pregenerated_primes)
//! .start(&mut OsRng, party)
Expand Down

0 comments on commit 6e7ceaa

Please sign in to comment.