diff --git a/book/src/tutorial/refreshing-shares.md b/book/src/tutorial/refreshing-shares.md index cf898b83..0ef7c8e7 100644 --- a/book/src/tutorial/refreshing-shares.md +++ b/book/src/tutorial/refreshing-shares.md @@ -6,7 +6,7 @@ channel](https://frost.zfnd.org/terminology.html#peer-to-peer-channel). -The Trusted Dealer needs to first run `calculate_zero_key` where the new SecretShares are generated and then verified. +The Trusted Dealer needs to first run `compute_refreshing_shares` where the new SecretShares are generated and then verified. This is done with [`KeyPackage::try_from()`](https://docs.rs/frost-core/latest/frost_core/frost/keys/struct.KeyPackage.html#method.try_from): `caluclate_zero_key` returns a new SecretShare and PublicKeyPackage diff --git a/frost-core/src/keys/refresh.rs b/frost-core/src/keys/refresh.rs index b1d8c0f7..b6619785 100644 --- a/frost-core/src/keys/refresh.rs +++ b/frost-core/src/keys/refresh.rs @@ -19,7 +19,7 @@ use super::{KeyPackage, SecretShare, VerifiableSecretSharingCommitment}; /// Generates new zero key shares and a public key package using a trusted dealer /// Building a new public key package is done by taking the verifying shares from the new public key package and adding /// them to the original verifying shares -pub fn calculate_zero_key( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, diff --git a/frost-core/src/tests/refresh.rs b/frost-core/src/tests/refresh.rs index 8ff6a90e..29330b90 100644 --- a/frost-core/src/tests/refresh.rs +++ b/frost-core/src/tests/refresh.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use rand_core::{CryptoRng, RngCore}; use crate::keys::generate_with_dealer; -use crate::keys::refresh::{calculate_zero_key, refresh_share}; +use crate::keys::refresh::{compute_refreshing_shares, refresh_share}; use crate::{self as frost}; use crate::{ keys::{KeyPackage, PublicKeyPackage, SecretShare}, @@ -56,7 +56,7 @@ pub fn check_refresh_shares_with_dealer( // Trusted Dealer generates zero keys and new public key package - let (zero_shares, new_pub_key_package) = calculate_zero_key( + let (zero_shares, new_pub_key_package) = compute_refreshing_shares( pub_key_package, NEW_MAX_SIGNERS, MIN_SIGNERS, @@ -97,7 +97,7 @@ pub fn check_refresh_shares_with_dealer_fails_with_invalid_signers< ) { let (_old_shares, pub_key_package) = generate_with_dealer::(5, 2, frost::keys::IdentifierList::Default, &mut rng).unwrap(); - let out = calculate_zero_key( + let out = compute_refreshing_shares( pub_key_package, new_max_signers, min_signers, @@ -157,7 +157,7 @@ pub fn check_refresh_shares_with_dealer_fails_with_invalid_public_key_package< // Trusted Dealer generates zero keys and new public key package - let e = calculate_zero_key( + let e = compute_refreshing_shares( incorrect_pub_key_package, NEW_MAX_SIGNERS, MIN_SIGNERS, @@ -203,7 +203,7 @@ pub fn check_refresh_shares_with_dealer_serialisation( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, identifiers: &[Identifier], mut rng: &mut R, ) -> Result<(Vec, PublicKeyPackage), Error> { - frost::keys::refresh::calculate_zero_key( + frost::keys::refresh::compute_refreshing_shares( old_pub_key_package, max_signers, min_signers, diff --git a/frost-ed448/src/keys/refresh.rs b/frost-ed448/src/keys/refresh.rs index 303c2580..b336a9c8 100644 --- a/frost-ed448/src/keys/refresh.rs +++ b/frost-ed448/src/keys/refresh.rs @@ -9,14 +9,14 @@ use crate::{frost, Ciphersuite, CryptoRng, Error, Identifier, RngCore}; use super::{KeyPackage, PublicKeyPackage, SecretShare}; /// Refreshes shares using a trusted dealer -pub fn calculate_zero_key( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, identifiers: &[Identifier], mut rng: &mut R, ) -> Result<(Vec, PublicKeyPackage), Error> { - frost::keys::refresh::calculate_zero_key( + frost::keys::refresh::compute_refreshing_shares( old_pub_key_package, max_signers, min_signers, diff --git a/frost-p256/src/keys/refresh.rs b/frost-p256/src/keys/refresh.rs index 303c2580..b336a9c8 100644 --- a/frost-p256/src/keys/refresh.rs +++ b/frost-p256/src/keys/refresh.rs @@ -9,14 +9,14 @@ use crate::{frost, Ciphersuite, CryptoRng, Error, Identifier, RngCore}; use super::{KeyPackage, PublicKeyPackage, SecretShare}; /// Refreshes shares using a trusted dealer -pub fn calculate_zero_key( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, identifiers: &[Identifier], mut rng: &mut R, ) -> Result<(Vec, PublicKeyPackage), Error> { - frost::keys::refresh::calculate_zero_key( + frost::keys::refresh::compute_refreshing_shares( old_pub_key_package, max_signers, min_signers, diff --git a/frost-ristretto255/src/keys/refresh.rs b/frost-ristretto255/src/keys/refresh.rs index 303c2580..b336a9c8 100644 --- a/frost-ristretto255/src/keys/refresh.rs +++ b/frost-ristretto255/src/keys/refresh.rs @@ -9,14 +9,14 @@ use crate::{frost, Ciphersuite, CryptoRng, Error, Identifier, RngCore}; use super::{KeyPackage, PublicKeyPackage, SecretShare}; /// Refreshes shares using a trusted dealer -pub fn calculate_zero_key( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, identifiers: &[Identifier], mut rng: &mut R, ) -> Result<(Vec, PublicKeyPackage), Error> { - frost::keys::refresh::calculate_zero_key( + frost::keys::refresh::compute_refreshing_shares( old_pub_key_package, max_signers, min_signers, diff --git a/frost-secp256k1/src/keys/refresh.rs b/frost-secp256k1/src/keys/refresh.rs index 303c2580..b336a9c8 100644 --- a/frost-secp256k1/src/keys/refresh.rs +++ b/frost-secp256k1/src/keys/refresh.rs @@ -9,14 +9,14 @@ use crate::{frost, Ciphersuite, CryptoRng, Error, Identifier, RngCore}; use super::{KeyPackage, PublicKeyPackage, SecretShare}; /// Refreshes shares using a trusted dealer -pub fn calculate_zero_key( +pub fn compute_refreshing_shares( old_pub_key_package: PublicKeyPackage, max_signers: u16, min_signers: u16, identifiers: &[Identifier], mut rng: &mut R, ) -> Result<(Vec, PublicKeyPackage), Error> { - frost::keys::refresh::calculate_zero_key( + frost::keys::refresh::compute_refreshing_shares( old_pub_key_package, max_signers, min_signers,