diff --git a/README.md b/README.md index 6a66bbb..441bccc 100644 --- a/README.md +++ b/README.md @@ -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::(eid, i, n) .set_threshold(t) @@ -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) diff --git a/cggmp21/src/lib.rs b/cggmp21/src/lib.rs index 6204a47..af5e986 100644 --- a/cggmp21/src/lib.rs +++ b/cggmp21/src/lib.rs @@ -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::(eid, i, n) //! .set_threshold(t) @@ -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)