From 5c6c56094b665885586823151f0e218eb67de709 Mon Sep 17 00:00:00 2001 From: nickfarrow Date: Tue, 20 Sep 2022 19:58:39 +1000 Subject: [PATCH 1/2] reuse message and some doc grammar --- schnorr_fun/src/frost.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/schnorr_fun/src/frost.rs b/schnorr_fun/src/frost.rs index b0762b39..c9fb408d 100644 --- a/schnorr_fun/src/frost.rs +++ b/schnorr_fun/src/frost.rs @@ -75,7 +75,7 @@ //! # ) //! # .unwrap(); //! // signing parties must use a common set of nonces when creating signature shares. -//! // nonces can be derived from a session id that use includes publicly known values. +//! // nonces can be derived from a session id which is created from publicly known values. //! let verification_shares_bytes: Vec<_> = frost_key //! .verification_shares() //! .map(|share| share.to_bytes()) @@ -501,7 +501,7 @@ impl XOnlyFrostKey { /// /// ## Return value /// - /// A point (normalised to have an even Y coordinate). + /// A point (normalized to have an even Y coordinate). pub fn public_key(&self) -> Point { self.public_key } @@ -620,7 +620,7 @@ impl + Clone, NG> Frost { /// /// ## Return value /// - /// Returns `bool` true if the proof of possession matches the point + /// Returns `bool` true if the proof of possession matches the point polynomial fn verify_pop(&self, keygen: &KeyGen, point: Point, pop: Signature) -> bool { let (even_poly_point, _) = point.into_point_with_even_y(); @@ -1141,10 +1141,11 @@ mod test { received_nonces.push((*i, nonce.public())); } + let message = Message::plain("test", b"test"); let signing_session = frost.start_sign_session( &frost_keys[signer_indexes[0]], received_nonces.clone(), - Message::plain("test", b"test") + message ); let mut signatures = vec![]; @@ -1153,7 +1154,7 @@ mod test { let session = frost.start_sign_session( &frost_keys[signer_index], received_nonces.clone(), - Message::plain("test", b"test") + message ); let sig = frost.sign( &frost_keys[signer_index], @@ -1176,7 +1177,7 @@ mod test { assert!(frost.schnorr.verify( &frost_keys[signer_indexes[0]].public_key(), - Message::::plain("test", b"test"), + message, &combined_sig )); } From 690180e6c19775fe00b0fbc3998dd3fd61559f70 Mon Sep 17 00:00:00 2001 From: Lloyd Fournier Date: Thu, 6 Oct 2022 12:41:22 +0800 Subject: [PATCH 2/2] Remove erroneous doc change --- schnorr_fun/src/frost.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schnorr_fun/src/frost.rs b/schnorr_fun/src/frost.rs index c9fb408d..a5265d76 100644 --- a/schnorr_fun/src/frost.rs +++ b/schnorr_fun/src/frost.rs @@ -620,7 +620,7 @@ impl + Clone, NG> Frost { /// /// ## Return value /// - /// Returns `bool` true if the proof of possession matches the point polynomial + /// Returns `bool` true if the proof of possession matches the point fn verify_pop(&self, keygen: &KeyGen, point: Point, pop: Signature) -> bool { let (even_poly_point, _) = point.into_point_with_even_y();