From 5d9f1bbaec479b19ff7380437e29815a5fc10d67 Mon Sep 17 00:00:00 2001 From: curiecrypt Date: Wed, 2 Jul 2025 18:16:12 +0300 Subject: [PATCH 1/3] deprecate old struct names --- demo/protocol-demo/src/types.rs | 36 +++++++-------- .../cardano/key_certification.rs | 44 +++++++++---------- .../src/crypto_helper/codec/binary.rs | 38 ++++++++-------- .../src/crypto_helper/types/alias.rs | 22 +++++----- .../src/crypto_helper/types/protocol_key.rs | 21 +++++---- .../src/crypto_helper/types/wrappers.rs | 26 ++++++----- .../src/entities/single_signature.rs | 6 +-- mithril-common/src/protocol/multi_signer.rs | 6 +-- mithril-common/src/test_utils/fake_keys.rs | 29 +++++++----- mithril-stm/README.md | 4 +- mithril-stm/src/aggregate_signature/clerk.rs | 4 +- mithril-stm/src/key_registration.rs | 4 +- mithril-stm/src/lib.rs | 33 +++++++++++--- mithril-stm/src/parameters.rs | 2 +- mithril-stm/src/participant/initializer.rs | 14 +++--- mithril-stm/src/participant/mod.rs | 2 +- mithril-stm/src/participant/signer.rs | 8 ++-- mithril-stm/src/single_signature/signature.rs | 4 +- mithril-stm/tests/bytes_conversion.rs | 8 ++-- 19 files changed, 172 insertions(+), 139 deletions(-) diff --git a/demo/protocol-demo/src/types.rs b/demo/protocol-demo/src/types.rs index ae85366fe5b..731362b759b 100644 --- a/demo/protocol-demo/src/types.rs +++ b/demo/protocol-demo/src/types.rs @@ -1,6 +1,6 @@ use mithril_stm::{ - KeyReg, Stake, StmAggrSig, StmClerk, StmInitializer, StmParameters, StmSig, StmSigner, - StmVerificationKeyPoP, + AggregateSignature, Clerk, Initializer, KeyRegistration, Parameters, Signer, SingleSignature, + Stake, VerificationKeyProofOfPossession, }; use blake2::{Blake2b, digest::consts::U32}; @@ -14,26 +14,26 @@ pub type ProtocolPartyId = String; /// Alias of [MithrilStm:Stake](type@mithril_stm::Stake). pub type ProtocolStake = Stake; -/// Alias of [MithrilStm::StmParameters](struct@mithril_stm::StmParameters). -pub type ProtocolParameters = StmParameters; +/// Alias of [MithrilStm::Parameters](struct@mithril_stm::Parameters). +pub type ProtocolParameters = Parameters; -/// Alias of [MithrilStm:StmSigner](struct@mithril_stm::StmSigner). -pub type ProtocolSigner = StmSigner; +/// Alias of [MithrilStm:Signer](struct@mithril_stm::Signer). +pub type ProtocolSigner = Signer; -/// Alias of [MithrilStm:StmClerk](struct@mithril_stm::StmClerk). -pub type ProtocolClerk = StmClerk; +/// Alias of [MithrilStm:Clerk](struct@mithril_stm::Clerk). +pub type ProtocolClerk = Clerk; -/// Alias of [MithrilStm:StmInitializer](struct@mithril_stm::StmInitializer). -pub type ProtocolInitializerNotCertified = StmInitializer; +/// Alias of [MithrilStm:Initializer](struct@mithril_stm::Initializer). +pub type ProtocolInitializerNotCertified = Initializer; -/// Alias of [MithrilStm:KeyReg](struct@mithril_stm::KeyReg). (Test only) -pub type ProtocolKeyRegistrationNotCertified = KeyReg; +/// Alias of [MithrilStm:KeyRegistration](struct@mithril_stm::KeyRegistration). (Test only) +pub type ProtocolKeyRegistrationNotCertified = KeyRegistration; -/// Alias of [MithrilStm:StmSig](struct@mithril_stm::StmSig). -pub type ProtocolSingleSignature = StmSig; +/// Alias of [MithrilStm:SingleSignature](struct@mithril_stm::SingleSignature). +pub type ProtocolSingleSignature = SingleSignature; -/// Alias of [MithrilStm:StmAggrSig](struct@mithril_stm::StmAggrSig). -pub type ProtocolMultiSignature = StmAggrSig; +/// Alias of [MithrilStm:AggregateSignature](struct@mithril_stm::AggregateSignature). +pub type ProtocolMultiSignature = AggregateSignature; -/// Alias of [MithrilStm:StmVerificationKeyPoP](type@mithril_stm::StmVerificationKeyPoP). -pub type ProtocolSignerVerificationKey = StmVerificationKeyPoP; +/// Alias of [MithrilStm:VerificationKeyProofOfPossession](type@mithril_stm::VerificationKeyProofOfPossession). +pub type ProtocolSignerVerificationKey = VerificationKeyProofOfPossession; diff --git a/mithril-common/src/crypto_helper/cardano/key_certification.rs b/mithril-common/src/crypto_helper/cardano/key_certification.rs index b96e26a7471..760b2919192 100644 --- a/mithril-common/src/crypto_helper/cardano/key_certification.rs +++ b/mithril-common/src/crypto_helper/cardano/key_certification.rs @@ -1,5 +1,5 @@ //! API for mithril key certification. -//! Includes the wrappers for StmInitializer and KeyReg, and ProtocolRegistrationErrorWrapper. +//! Includes the wrappers for Initializer and KeyRegistration, and ProtocolRegistrationErrorWrapper. //! These wrappers allows keeping mithril-stm agnostic to Cardano, while providing some //! guarantees that mithril-stm will not be misused in the context of Cardano. @@ -15,8 +15,8 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use mithril_stm::{ - ClosedKeyReg, KeyReg, RegisterError, Stake, StmInitializer, StmParameters, StmSigner, - StmVerificationKeyPoP, + ClosedKeyRegistration, Initializer, KeyRegistration, Parameters, RegisterError, Signer, Stake, + VerificationKeyProofOfPossession, }; use crate::{ @@ -95,13 +95,13 @@ pub enum ProtocolInitializerErrorWrapper { KesMismatch(KesPeriod, KesPeriod), } -/// Wrapper structure for [MithrilStm:StmInitializer](mithril_stm::stm::StmInitializer). +/// Wrapper structure for [MithrilStm:Initializer](mithril_stm::stm::Initializer). /// It now obtains a KES signature over the Mithril key. This allows the signers prove /// their correct identity with respect to a Cardano PoolID. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct StmInitializerWrapper { - /// The StmInitializer - stm_initializer: StmInitializer, + /// The Initializer + stm_initializer: Initializer, /// The KES signature over the Mithril key /// @@ -110,17 +110,17 @@ pub struct StmInitializerWrapper { } impl StmInitializerWrapper { - /// Builds an `StmInitializer` that is ready to register with the key registration service. + /// Builds an `Initializer` that is ready to register with the key registration service. /// This function generates the signing and verification key with a PoP, signs the verification /// key with a provided KES signer implementation, and initializes the structure. pub fn setup( - params: StmParameters, + params: Parameters, kes_signer: Option>, kes_period: Option, stake: Stake, rng: &mut R, ) -> StdResult { - let stm_initializer = StmInitializer::setup(params, stake, rng); + let stm_initializer = Initializer::setup(params, stake, rng); let kes_signature = if let Some(kes_signer) = kes_signer { let (signature, _op_cert) = kes_signer.sign( &stm_initializer.verification_key().to_bytes(), @@ -142,7 +142,7 @@ impl StmInitializerWrapper { } /// Extract the verification key. - pub fn verification_key(&self) -> StmVerificationKeyPoP { + pub fn verification_key(&self) -> VerificationKeyProofOfPossession { self.stm_initializer.verification_key() } @@ -163,8 +163,8 @@ impl StmInitializerWrapper { /// Build the `avk` for the given list of parties. /// - /// Note that if this StmInitializer was modified *between* the last call to `register`, - /// then the resulting `StmSigner` may not be able to produce valid signatures. + /// Note that if this Initializer was modified *between* the last call to `register`, + /// then the resulting `Signer` may not be able to produce valid signatures. /// /// Returns a `StmSignerWrapper` specialized to /// * this `StmSignerWrapper`'s ID and current stake @@ -175,8 +175,8 @@ impl StmInitializerWrapper { /// This function fails if the initializer is not registered. pub fn new_signer( self, - closed_reg: ClosedKeyReg, - ) -> Result, ProtocolRegistrationErrorWrapper> { + closed_reg: ClosedKeyRegistration, + ) -> Result, ProtocolRegistrationErrorWrapper> { self.stm_initializer .new_signer(closed_reg) .map_err(ProtocolRegistrationErrorWrapper::CoreRegister) @@ -201,7 +201,7 @@ impl StmInitializerWrapper { /// The function fails if the given string of bytes is not of required size. pub fn from_bytes(bytes: &[u8]) -> Result { let stm_initializer = - StmInitializer::from_bytes(bytes.get(..256).ok_or(RegisterError::SerializationError)?)?; + Initializer::from_bytes(bytes.get(..256).ok_or(RegisterError::SerializationError)?)?; let bytes = bytes.get(256..).ok_or(RegisterError::SerializationError)?; let kes_signature = if bytes.is_empty() { None @@ -216,14 +216,14 @@ impl StmInitializerWrapper { } cfg_test_tools! { - /// Override the protocol parameters of the `StmInitializer` for testing purposes only. + /// Override the protocol parameters of the `Initializer` for testing purposes only. pub fn override_protocol_parameters(&mut self, protocol_parameters: &ProtocolParameters) { self.stm_initializer.params = protocol_parameters.to_owned(); } } } -/// Wrapper structure for [MithrilStm:KeyReg](mithril_stm::key_reg::KeyReg). +/// Wrapper structure for [MithrilStm:KeyRegistration](mithril_stm::key_reg::KeyRegistration). /// The wrapper not only contains a map between `Mithril vkey <-> Stake`, but also /// a map `PoolID <-> Stake`. This information is recovered from the node state, and /// is used to verify the identity of a Mithril signer. Furthermore, the `register` function @@ -232,7 +232,7 @@ impl StmInitializerWrapper { #[derive(Debug, Clone)] pub struct KeyRegWrapper { kes_verifier: Arc, - stm_key_reg: KeyReg, + stm_key_reg: KeyRegistration, stake_distribution: HashMap, } @@ -242,7 +242,7 @@ impl KeyRegWrapper { pub fn init(stake_dist: &ProtocolStakeDistribution) -> Self { Self { kes_verifier: Arc::new(KesVerifierStandard), - stm_key_reg: KeyReg::init(), + stm_key_reg: KeyRegistration::init(), stake_distribution: HashMap::from_iter(stake_dist.to_vec()), } } @@ -293,8 +293,8 @@ impl KeyRegWrapper { } /// Finalize the key registration. - /// This function disables `KeyReg::register`, consumes the instance of `self`, and returns a `ClosedKeyReg`. - pub fn close(self) -> ClosedKeyReg { + /// This function disables `ClosedKeyRegistration::register`, consumes the instance of `self`, and returns a `ClosedKeyRegistration`. + pub fn close(self) -> ClosedKeyRegistration { self.stm_key_reg.close() } } @@ -317,7 +317,7 @@ mod test { #[test] fn test_vector_key_reg() { - let params = StmParameters { + let params = Parameters { m: 5, k: 5, phi_f: 1.0, diff --git a/mithril-common/src/crypto_helper/codec/binary.rs b/mithril-common/src/crypto_helper/codec/binary.rs index 7b6992f9318..ab5f356d302 100644 --- a/mithril-common/src/crypto_helper/codec/binary.rs +++ b/mithril-common/src/crypto_helper/codec/binary.rs @@ -37,95 +37,95 @@ mod binary_mithril_stm { use digest::consts::U32; use mithril_stm::{ - StmAggrSig, StmAggrVerificationKey, StmInitializer, StmParameters, StmSig, StmSigRegParty, - StmVerificationKey, StmVerificationKeyPoP, + AggregateSignature, AggregateVerificationKey, Initializer, Parameters, SingleSignature, + SingleSignatureWithRegisteredParty, VerificationKey, VerificationKeyProofOfPossession, }; use super::*; type D = Blake2b; - impl TryToBytes for StmParameters { + impl TryToBytes for Parameters { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmParameters { + impl TryFromBytes for Parameters { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes(bytes).map_err(|e| e.into()) } } - impl TryToBytes for StmSig { + impl TryToBytes for SingleSignature { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmSig { + impl TryFromBytes for SingleSignature { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes::(bytes).map_err(|e| e.into()) } } - impl TryToBytes for StmSigRegParty { + impl TryToBytes for SingleSignatureWithRegisteredParty { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmSigRegParty { + impl TryFromBytes for SingleSignatureWithRegisteredParty { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes::(bytes).map_err(|e| e.into()) } } - impl TryToBytes for StmAggrSig { + impl TryToBytes for AggregateSignature { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmAggrSig { + impl TryFromBytes for AggregateSignature { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes(bytes).map_err(|e| anyhow!("{e}")) } } - impl TryToBytes for StmVerificationKey { + impl TryToBytes for VerificationKey { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmVerificationKey { + impl TryFromBytes for VerificationKey { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes(bytes).map_err(|e| e.into()) } } - impl TryToBytes for StmVerificationKeyPoP { + impl TryToBytes for VerificationKeyProofOfPossession { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmVerificationKeyPoP { + impl TryFromBytes for VerificationKeyProofOfPossession { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes(bytes).map_err(|e| e.into()) } } - impl TryToBytes for StmAggrVerificationKey { + impl TryToBytes for AggregateVerificationKey { fn to_bytes_vec(&self) -> StdResult> { bincode::serde::encode_to_vec(self, bincode::config::standard()).map_err(|e| e.into()) } } - impl TryFromBytes for StmAggrVerificationKey { + impl TryFromBytes for AggregateVerificationKey { fn try_from_bytes(bytes: &[u8]) -> StdResult { - let (res, _) = bincode::serde::decode_from_slice::, _>( + let (res, _) = bincode::serde::decode_from_slice::, _>( bytes, bincode::config::standard(), ) @@ -135,13 +135,13 @@ mod binary_mithril_stm { } } - impl TryToBytes for StmInitializer { + impl TryToBytes for Initializer { fn to_bytes_vec(&self) -> StdResult> { Ok(self.to_bytes().to_vec()) } } - impl TryFromBytes for StmInitializer { + impl TryFromBytes for Initializer { fn try_from_bytes(bytes: &[u8]) -> StdResult { Self::from_bytes(bytes).map_err(|e| e.into()) } diff --git a/mithril-common/src/crypto_helper/types/alias.rs b/mithril-common/src/crypto_helper/types/alias.rs index bb02caea424..6ebcc7eb5c7 100644 --- a/mithril-common/src/crypto_helper/types/alias.rs +++ b/mithril-common/src/crypto_helper/types/alias.rs @@ -4,7 +4,7 @@ use crate::crypto_helper::cardano::{ }; use mithril_stm::{ - AggregationError, ClosedKeyReg, Index, Stake, StmClerk, StmParameters, StmSigner, + AggregationError, Clerk, ClosedKeyRegistration, Index, Parameters, Signer, Stake, }; use blake2::{Blake2b, digest::consts::U32}; @@ -24,26 +24,26 @@ pub type ProtocolStake = Stake; /// A list of [Party Id][ProtocolPartyId] associated with its [Stake][ProtocolStake]. pub type ProtocolStakeDistribution = Vec<(ProtocolPartyId, ProtocolStake)>; -/// Alias of [MithrilStm::StmParameters](struct@mithril_stm::StmParameters). -pub type ProtocolParameters = StmParameters; +/// Alias of [MithrilStm::Parameters](struct@mithril_stm::Parameters). +pub type ProtocolParameters = Parameters; /// Alias of [MithrilStm::Index](type@mithril_stm::Index). pub type ProtocolLotteryIndex = Index; -/// Alias of [MithrilStm:StmSigner](struct@mithril_stm::StmSigner). -pub type ProtocolSigner = StmSigner; +/// Alias of [MithrilStm:Signer](struct@mithril_stm::Signer). +pub type ProtocolSigner = Signer; -/// Alias of a wrapper of [MithrilStm:StmInitializer](struct@mithril_stm::StmInitializer). +/// Alias of a wrapper of [MithrilStm:Initializer](struct@mithril_stm::Initializer). pub type ProtocolInitializer = StmInitializerWrapper; -/// Alias of [MithrilStm:StmClerk](struct@mithril_stm::StmClerk). -pub type ProtocolClerk = StmClerk; +/// Alias of [MithrilStm:Clerk](struct@mithril_stm::Clerk). +pub type ProtocolClerk = Clerk; -/// Alias of a wrapper of [MithrilStm:KeyReg](struct@mithril_stm::KeyReg). +/// Alias of a wrapper of [MithrilStm:KeyRegistration](struct@mithril_stm::KeyRegistration). pub type ProtocolKeyRegistration = KeyRegWrapper; -/// Alias of a wrapper of [MithrilStm:ClosedKeyReg](struct@mithril_stm::KeyReg). -pub type ProtocolClosedKeyRegistration = ClosedKeyReg; +/// Alias of a wrapper of [MithrilStm:ClosedKeyRegistration](struct@mithril_stm::ClosedKeyRegistration). +pub type ProtocolClosedKeyRegistration = ClosedKeyRegistration; // Error alias /// Alias of a wrapper of [MithrilCommon:ProtocolRegistrationErrorWrapper](enum@ProtocolRegistrationErrorWrapper). diff --git a/mithril-common/src/crypto_helper/types/protocol_key.rs b/mithril-common/src/crypto_helper/types/protocol_key.rs index f882f9d32b3..9900409eacf 100644 --- a/mithril-common/src/crypto_helper/types/protocol_key.rs +++ b/mithril-common/src/crypto_helper/types/protocol_key.rs @@ -289,19 +289,20 @@ mod test { crypto_helper::ProtocolKey, test_utils::{TempDir, fake_keys}, }; - use mithril_stm::StmVerificationKeyPoP; + use mithril_stm::VerificationKeyProofOfPossession; use serde::{Deserialize, Serialize}; static VERIFICATION_KEY_JSON_HEX: &str = fake_keys::signer_verification_key()[0]; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] struct Container { - protocol_key: ProtocolKey, + protocol_key: ProtocolKey, } #[test] fn serializing_directly_does_not_change_the_string() { - let key: ProtocolKey = VERIFICATION_KEY_JSON_HEX.try_into().unwrap(); + let key: ProtocolKey = + VERIFICATION_KEY_JSON_HEX.try_into().unwrap(); let serialized = serde_json::to_string(&key).expect("Serialization should not fail"); // Note: in json strings are enclosed in quotes @@ -344,9 +345,10 @@ mod test { #[test] fn can_deserialize_a_struct_containing_a_bytes_hex_verification_key() { - let verification_key: ProtocolKey = VERIFICATION_KEY_JSON_HEX - .try_into() - .expect("Failed to convert verification key"); + let verification_key: ProtocolKey = + VERIFICATION_KEY_JSON_HEX + .try_into() + .expect("Failed to convert verification key"); let verification_key_bytes_hex = verification_key .to_bytes_hex() .expect("Failed to convert verification key to bytes hex"); @@ -362,7 +364,7 @@ mod test { #[test] fn can_read_and_write_to_file_a_verification_key() { - let expected_key: ProtocolKey = + let expected_key: ProtocolKey = VERIFICATION_KEY_JSON_HEX.try_into().unwrap(); let key_path = TempDir::create( "protocol_key", @@ -373,8 +375,9 @@ mod test { expected_key .write_json_hex_to_file(&key_path) .expect("Writing to file should not fail"); - let read_key = ProtocolKey::::read_json_hex_from_file(&key_path) - .expect("Reading from file should not fail"); + let read_key = + ProtocolKey::::read_json_hex_from_file(&key_path) + .expect("Reading from file should not fail"); assert_eq!(expected_key, read_key); } diff --git a/mithril-common/src/crypto_helper/types/wrappers.rs b/mithril-common/src/crypto_helper/types/wrappers.rs index 07ff0511987..4ef2cabb6fc 100644 --- a/mithril-common/src/crypto_helper/types/wrappers.rs +++ b/mithril-common/src/crypto_helper/types/wrappers.rs @@ -1,37 +1,39 @@ use kes_summed_ed25519::kes::Sum6KesSig; -use mithril_stm::{StmAggrSig, StmAggrVerificationKey, StmSig, StmVerificationKeyPoP}; +use mithril_stm::{ + AggregateSignature, AggregateVerificationKey, SingleSignature, VerificationKeyProofOfPossession, +}; use crate::crypto_helper::{D, MKMapProof, MKProof, OpCert, ProtocolKey}; use crate::entities::BlockRange; -/// Wrapper of [MithrilStm:StmVerificationKeyPoP](type@StmVerificationKeyPoP) to add serialization +/// Wrapper of [MithrilStm:VerificationKeyProofOfPossession](type@VerificationKeyProofOfPossession) to add serialization /// utilities. -pub type ProtocolSignerVerificationKey = ProtocolKey; +pub type ProtocolSignerVerificationKey = ProtocolKey; /// Wrapper of [KES:Sum6KesSig](https://github.com/input-output-hk/kes/blob/master/src/kes.rs) to add /// serialization utilities. pub type ProtocolSignerVerificationKeySignature = ProtocolKey; -/// Wrapper of [MithrilStm:StmSig](type@StmSig) to add serialization utilities. -pub type ProtocolSingleSignature = ProtocolKey; +/// Wrapper of [MithrilStm:SingleSignature](type@SingleSignature) to add serialization utilities. +pub type ProtocolSingleSignature = ProtocolKey; -/// Wrapper of [MithrilStm:StmAggrSig](struct@StmAggrSig) to add serialization utilities. -pub type ProtocolMultiSignature = ProtocolKey>; +/// Wrapper of [MithrilStm:AggregateSignature](struct@AggregateSignature) to add serialization utilities. +pub type ProtocolMultiSignature = ProtocolKey>; /// Wrapper of [OpCert] to add serialization utilities. pub type ProtocolOpCert = ProtocolKey; -/// Wrapper of [MithrilStm:StmAggrVerificationKey](struct@StmAggrVerificationKey). -pub type ProtocolAggregateVerificationKey = ProtocolKey>; +/// Wrapper of [MithrilStm:AggregateVerificationKey](struct@AggregateVerificationKey). +pub type ProtocolAggregateVerificationKey = ProtocolKey>; /// Wrapper of [MKProof] to add serialization utilities. pub type ProtocolMkProof = ProtocolKey>; impl_codec_and_type_conversions_for_protocol_key!( - json_hex_codec => StmAggrSig, ed25519_dalek::VerifyingKey, ed25519_dalek::SigningKey, StmAggrVerificationKey, - MKProof, StmVerificationKeyPoP, Sum6KesSig, OpCert + json_hex_codec => AggregateSignature, ed25519_dalek::VerifyingKey, ed25519_dalek::SigningKey, AggregateVerificationKey, + MKProof, VerificationKeyProofOfPossession, Sum6KesSig, OpCert ); impl_codec_and_type_conversions_for_protocol_key!( - bytes_hex_codec => StmSig, ed25519_dalek::Signature + bytes_hex_codec => SingleSignature, ed25519_dalek::Signature ); diff --git a/mithril-common/src/entities/single_signature.rs b/mithril-common/src/entities/single_signature.rs index 330d8f2930c..48e1b86ce19 100644 --- a/mithril-common/src/entities/single_signature.rs +++ b/mithril-common/src/entities/single_signature.rs @@ -1,4 +1,4 @@ -use mithril_stm::StmSig; +use mithril_stm::SingleSignature as StmSingleSignature; use serde::{Deserialize, Serialize}; use std::fmt::{Debug, Formatter}; @@ -51,8 +51,8 @@ impl SingleSignature { } } - /// Convert this [SingleSignature] to its corresponding [MithrilStm Signature][StmSig]. - pub fn to_protocol_signature(&self) -> StmSig { + /// Convert this [SingleSignature] to its corresponding [MithrilStm Signature][SingleSignature]. + pub fn to_protocol_signature(&self) -> StmSingleSignature { self.signature.clone().into() } diff --git a/mithril-common/src/protocol/multi_signer.rs b/mithril-common/src/protocol/multi_signer.rs index 3b2c349e97c..c8f8422b8ce 100644 --- a/mithril-common/src/protocol/multi_signer.rs +++ b/mithril-common/src/protocol/multi_signer.rs @@ -1,5 +1,5 @@ use anyhow::{Context, anyhow}; -use mithril_stm::StmParameters; +use mithril_stm::Parameters; use crate::{ StdResult, @@ -14,11 +14,11 @@ use crate::{ /// MultiSigner is the cryptographic engine in charge of producing multi-signatures from individual signatures pub struct MultiSigner { protocol_clerk: ProtocolClerk, - protocol_parameters: StmParameters, + protocol_parameters: Parameters, } impl MultiSigner { - pub(super) fn new(protocol_clerk: ProtocolClerk, protocol_parameters: StmParameters) -> Self { + pub(super) fn new(protocol_clerk: ProtocolClerk, protocol_parameters: Parameters) -> Self { Self { protocol_clerk, protocol_parameters, diff --git a/mithril-common/src/test_utils/fake_keys.rs b/mithril-common/src/test_utils/fake_keys.rs index 8156e008e06..02af3ef8d89 100644 --- a/mithril-common/src/test_utils/fake_keys.rs +++ b/mithril-common/src/test_utils/fake_keys.rs @@ -1,6 +1,6 @@ //! Pre hex encoded StmTypes for testing. -/// A list of pre json hex encoded [MithrilStm:StmSig](type@mithril_stm::StmSig) +/// A list of pre json hex encoded [MithrilStm:SingleSignature](type@mithril_stm::SingleSignature) pub const fn single_signature<'a>() -> [&'a str; 4] { [ "7b227369676d61223a5b3133302c3137372c31352c3232392c32342c3235312c3234372c3137312c3139362c32\ @@ -52,7 +52,7 @@ pub const fn single_signature<'a>() -> [&'a str; 4] { ] } -/// A list of pre json hex encoded [MithrilStm:StmAggrSig](struct@mithril_stm::StmAggrSig) +/// A list of pre json hex encoded [MithrilStm:AggregateSignature](struct@mithril_stm::AggregateSignature) pub const fn multi_signature<'a>() -> [&'a str; 2] { [ "7b227369676e617475726573223a5b5b7b227369676d61223a5b3137312c3136312c3232352c3139342c32382c\ @@ -158,7 +158,7 @@ pub const fn signable_manifest_signature<'a>() -> [&'a str; 2] { ] } -/// A list of pre json hex encoded [MithrilStm:StmVerificationKeyPoP](type@mithril_stm::StmVerificationKeyPoP) +/// A list of pre json hex encoded [MithrilStm:VerificationKeyProofOfPossession](type@mithril_stm::VerificationKeyProofOfPossession) pub const fn signer_verification_key<'a>() -> [&'a str; 4] { [ "7b22766b223a5b3134352c32332c3135382c31322c3138332c3230392c33322c3134302c33372c3132342c3136\ @@ -366,7 +366,7 @@ pub const fn operational_certificate<'a>() -> [&'a str; 2] { ] } -/// A list of pre json hex encoded [MithrilStm:StmAggrVerificationKey](struct@mithril_stm::StmAggrVerificationKey) +/// A list of pre json hex encoded [MithrilStm:AggregateVerificationKey](struct@mithril_stm::AggregateVerificationKey) pub const fn aggregate_verification_key<'a>() -> [&'a str; 3] { [ "7b226d745f636f6d6d69746d656e74223a7b22726f6f74223a5b3134302c31332c3135352c3134312c3136332c\ @@ -392,7 +392,10 @@ mod test { use super::*; use ed25519_dalek::VerifyingKey; use kes_summed_ed25519::kes::Sum6KesSig; - use mithril_stm::{StmAggrSig, StmAggrVerificationKey, StmSig, StmVerificationKeyPoP}; + use mithril_stm::{ + AggregateSignature, AggregateVerificationKey, SingleSignature, + VerificationKeyProofOfPossession, + }; use serde::{Serialize, de::DeserializeOwned}; use std::any::type_name; @@ -452,16 +455,16 @@ mod test { #[test] fn assert_encoded_single_signatures_are_still_matching_concrete_type() { - assert_can_deserialize_using_key_decode_hex::(&single_signature()); + assert_can_deserialize_using_key_decode_hex::(&single_signature()); - assert_can_convert_to_protocol_key::(&single_signature()); + assert_can_convert_to_protocol_key::(&single_signature()); } #[test] fn assert_encoded_multi_signatures_are_still_matching_concrete_type() { - assert_can_deserialize_using_key_decode_hex::>(&multi_signature()); + assert_can_deserialize_using_key_decode_hex::>(&multi_signature()); - assert_can_convert_to_protocol_key::>(&multi_signature()); + assert_can_convert_to_protocol_key::>(&multi_signature()); } #[test] @@ -488,11 +491,13 @@ mod test { #[test] fn assert_encoded_signer_verification_key_are_still_matching_concrete_type() { - assert_can_deserialize_using_key_decode_hex::( + assert_can_deserialize_using_key_decode_hex::( &signer_verification_key(), ); - assert_can_convert_to_protocol_key::(&signer_verification_key()); + assert_can_convert_to_protocol_key::( + &signer_verification_key(), + ); } #[test] @@ -519,7 +524,7 @@ mod test { #[test] fn assert_encoded_aggregate_verification_key_are_still_matching_concrete_type() { - assert_can_deserialize_using_key_decode_hex::>( + assert_can_deserialize_using_key_decode_hex::>( &aggregate_verification_key(), ); } diff --git a/mithril-stm/README.md b/mithril-stm/README.md index 91fe35035f2..cf96d9ebbc4 100644 --- a/mithril-stm/README.md +++ b/mithril-stm/README.md @@ -67,7 +67,7 @@ use rand_chacha::ChaCha20Rng; use rand_core::{RngCore, SeedableRng}; use rayon::prelude::*; -use mithril_stm::{StmClerk, Parameters, SingleSignature, KeyRegistration, Initializer, Signer, AggregationError}; +use mithril_stm::{Clerk, Parameters, SingleSignature, KeyRegistration, Initializer, Signer, AggregationError}; type H = Blake2b; @@ -117,7 +117,7 @@ fn main() { .filter_map(|p| p.sign(&msg)) .collect::>(); - let clerk = StmClerk::from_signer(&ps[0]); + let clerk = Clerk::from_signer(&ps[0]); let avk = clerk.compute_avk(); // Check all parties can verify every sig diff --git a/mithril-stm/src/aggregate_signature/clerk.rs b/mithril-stm/src/aggregate_signature/clerk.rs index 5325636d255..9a7b72b8f13 100644 --- a/mithril-stm/src/aggregate_signature/clerk.rs +++ b/mithril-stm/src/aggregate_signature/clerk.rs @@ -29,7 +29,7 @@ impl Clerk { let closed_reg = signer .get_closed_reg() .clone() - .expect("Core signer does not include closed registration. StmClerk, and so, the Stm certificate cannot be built without closed registration!") + .expect("Core signer does not include closed registration. Clerk, and so, the Stm certificate cannot be built without closed registration!") ; Self { @@ -81,7 +81,7 @@ impl Clerk { }) } - /// Compute the `StmAggrVerificationKey` related to the used registration. + /// Compute the `AggregateVerificationKey` related to the used registration. pub fn compute_avk(&self) -> AggregateVerificationKey { AggregateVerificationKey::from(&self.closed_reg) } diff --git a/mithril-stm/src/key_registration.rs b/mithril-stm/src/key_registration.rs index c0c365a8955..664dda91887 100644 --- a/mithril-stm/src/key_registration.rs +++ b/mithril-stm/src/key_registration.rs @@ -23,7 +23,7 @@ pub struct KeyRegistration { } impl KeyRegistration { - /// Initialize an empty `KeyReg`. + /// Initialize an empty `KeyRegistration`. pub fn init() -> Self { Self::default() } @@ -45,7 +45,7 @@ impl KeyRegistration { } /// Finalize the key registration. - /// This function disables `KeyReg::register`, consumes the instance of `self`, and returns a `ClosedKeyReg`. + /// This function disables `KeyReg::register`, consumes the instance of `self`, and returns a `ClosedKeyRegistration`. pub fn close(self) -> ClosedKeyRegistration where D: Digest + FixedOutput, diff --git a/mithril-stm/src/lib.rs b/mithril-stm/src/lib.rs index c8243e0233c..3e70e8ea910 100644 --- a/mithril-stm/src/lib.rs +++ b/mithril-stm/src/lib.rs @@ -13,7 +13,7 @@ //! use rand_core::{RngCore, SeedableRng}; //! use rayon::prelude::*; // We use par_iter to speed things up //! -//! use mithril_stm::{StmClerk, Parameters, SingleSignature, KeyRegistration, Initializer, Signer, AggregationError}; +//! use mithril_stm::{Clerk, Parameters, SingleSignature, KeyRegistration, Initializer, Signer, AggregationError}; //! //! let nparties = 4; // Use a small number of parties for this example //! type D = Blake2b; // Setting the hash function for convenience @@ -54,7 +54,7 @@ //! for stake in stakes { //! // Create keys for this party //! let p = Initializer::setup(params, stake, &mut rng); -//! // Register keys with the KeyReg service +//! // Register keys with the KeyRegistration service //! key_reg //! .register(p.stake, p.verification_key()) //! .unwrap(); @@ -64,7 +64,7 @@ //! // Close the key registration. //! let closed_reg = key_reg.close(); //! -//! // Finalize the StmInitializer and turn it into a Signer, which can execute the +//! // Finalize the Initializer and turn it into a Signer, which can execute the //! // rest of the protocol. //! let ps = ps //! .into_par_iter() @@ -84,8 +84,8 @@ //! }) //! .collect::>(); //! -//! // StmClerk can aggregate and verify signatures. -//! let clerk = StmClerk::from_signer(&ps[0]); +//! // Clerk can aggregate and verify signatures. +//! let clerk = Clerk::from_signer(&ps[0]); //! //! // Aggregate and verify the signatures //! let msig = clerk.aggregate(&sigs, &msg); @@ -140,17 +140,40 @@ pub type Stake = u64; pub type Index = u64; // Aliases +#[deprecated(since = "0.4.6", note = "Use `AggregateSignature` instead")] pub use aggregate_signature::AggregateSignature as StmAggrSig; + +#[deprecated(since = "0.4.6", note = "Use `AggregateVerificationKey` instead")] pub use aggregate_signature::AggregateVerificationKey as StmAggrVerificationKey; +#[deprecated(since = "0.4.6", note = "Use `Clerk` instead")] pub use aggregate_signature::Clerk as StmClerk; + +#[deprecated(since = "0.4.6", note = "Use `ClosedKeyRegistration` instead")] pub use key_registration::ClosedKeyRegistration as ClosedKeyReg; + +#[deprecated(since = "0.4.6", note = "Use `KeyRegistration` instead")] pub use key_registration::KeyRegistration as KeyReg; + +#[deprecated(since = "0.4.6", note = "Use `Parameters` instead")] pub use parameters::Parameters as StmParameters; + +#[deprecated(since = "0.4.6", note = "Use `Initializer` instead")] pub use participant::Initializer as StmInitializer; + +#[deprecated(since = "0.4.6", note = "Use `Signer` instead")] pub use participant::Signer as StmSigner; + +#[deprecated(since = "0.4.6", note = "Use `VerificationKey` instead")] pub use participant::VerificationKey as StmVerificationKey; + +#[deprecated( + since = "0.4.6", + note = "Use `VerificationKeyProofOfPossession` instead" +)] pub use participant::VerificationKeyProofOfPossession as StmVerificationKeyPoP; + +#[deprecated(since = "0.4.6", note = "Use `SingleSignature` instead")] pub use single_signature::SingleSignature as StmSig; #[deprecated(since = "0.4.6", note = "Use `BasicVerifier` instead")] diff --git a/mithril-stm/src/parameters.rs b/mithril-stm/src/parameters.rs index 210cc394bfa..701a05276d5 100644 --- a/mithril-stm/src/parameters.rs +++ b/mithril-stm/src/parameters.rs @@ -33,7 +33,7 @@ impl Parameters { out } - /// Extract the `StmParameters` from a byte slice. + /// Extract the `Parameters` from a byte slice. /// # Error /// The function fails if the given string of bytes is not of required size. pub fn from_bytes(bytes: &[u8]) -> Result { diff --git a/mithril-stm/src/participant/initializer.rs b/mithril-stm/src/participant/initializer.rs index dd690d34497..324890b8b16 100644 --- a/mithril-stm/src/participant/initializer.rs +++ b/mithril-stm/src/participant/initializer.rs @@ -10,9 +10,9 @@ use crate::{Parameters, RegisterError, Signer, Stake}; /// Wrapper of the MultiSignature Verification key with proof of possession pub type VerificationKeyProofOfPossession = BlsVerificationKeyProofOfPossession; -/// Initializer for `StmSigner`. +/// Initializer for `Signer`. /// This is the data that is used during the key registration procedure. -/// Once the latter is finished, this instance is consumed into an `StmSigner`. +/// Once the latter is finished, this instance is consumed into an `Signer`. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Initializer { /// This participant's stake. @@ -46,12 +46,12 @@ impl Initializer { /// Build the `avk` for the given list of parties. /// - /// Note that if this StmInitializer was modified *between* the last call to `register`, - /// then the resulting `StmSigner` may not be able to produce valid signatures. + /// Note that if this Initializer was modified *between* the last call to `register`, + /// then the resulting `Signer` may not be able to produce valid signatures. /// - /// Returns an `StmSigner` specialized to - /// * this `StmSigner`'s ID and current stake - /// * this `StmSigner`'s parameter valuation + /// Returns an `Signer` specialized to + /// * this `Signer`'s ID and current stake + /// * this `Signer`'s parameter valuation /// * the `avk` as built from the current registered parties (according to the registration service) /// * the current total stake (according to the registration service) /// # Error diff --git a/mithril-stm/src/participant/mod.rs b/mithril-stm/src/participant/mod.rs index a6c311c3f44..c8c1d01f778 100644 --- a/mithril-stm/src/participant/mod.rs +++ b/mithril-stm/src/participant/mod.rs @@ -1,4 +1,4 @@ -//! Mithril-stm participant including StmInitializer and StmSigner +//! Mithril-stm participant including Initializer and Signer mod initializer; mod signer; diff --git a/mithril-stm/src/participant/signer.rs b/mithril-stm/src/participant/signer.rs index 69262e4f79b..648fa8cf901 100644 --- a/mithril-stm/src/participant/signer.rs +++ b/mithril-stm/src/participant/signer.rs @@ -10,7 +10,7 @@ pub type VerificationKey = BlsVerificationKey; /// Participant in the protocol can sign messages. /// * If the signer has `closed_reg`, then it can generate Stm certificate. -/// * This kind of signer can only be generated out of an `StmInitializer` and a `ClosedKeyReg`. +/// * This kind of signer can only be generated out of an `Initializer` and a `ClosedKeyRegistration`. /// * This ensures that a `MerkleTree` root is not computed before all participants have registered. /// * If the signer does not have `closed_reg`, then it is a core signer. /// * This kind of signer cannot participate certificate generation. @@ -26,7 +26,7 @@ pub struct Signer { } impl Signer { - /// Create an StmSigner for given input + /// Create a Signer for given input pub fn set_stm_signer( signer_index: u64, stake: Stake, @@ -70,7 +70,7 @@ impl Signer { /// If it wins at least one lottery, it stores the signer's merkle tree index. The proof of membership /// will be handled by the aggregator. pub fn sign(&self, msg: &[u8]) -> Option { - let closed_reg = self.closed_reg.as_ref().expect("Closed registration not found! Cannot produce StmSignatures. Use core_sign to produce core signatures (not valid for an StmCertificate)."); + let closed_reg = self.closed_reg.as_ref().expect("Closed registration not found! Cannot produce SingleSignatures. Use core_sign to produce core signatures (not valid for an StmCertificate)."); let msgp = closed_reg .merkle_tree .to_commitment_batch_compat() @@ -130,7 +130,7 @@ impl Signer { indexes } - /// Get StmParameters + /// Get Parameters pub fn get_params(&self) -> Parameters { self.params } diff --git a/mithril-stm/src/single_signature/signature.rs b/mithril-stm/src/single_signature/signature.rs index 8e2281776fd..cff93ece8a8 100644 --- a/mithril-stm/src/single_signature/signature.rs +++ b/mithril-stm/src/single_signature/signature.rs @@ -62,7 +62,7 @@ impl SingleSignature { Ok(()) } - /// Convert an `StmSig` into bytes + /// Convert an `SingleSignature` into bytes /// /// # Layout /// * Stake @@ -125,7 +125,7 @@ impl SingleSignature { }) } - /// Compare two `StmSig` by their signers' merkle tree indexes. + /// Compare two `SingleSignature` by their signers' merkle tree indexes. pub fn cmp_stm_sig(&self, other: &Self) -> Ordering { self.signer_index.cmp(&other.signer_index) } diff --git a/mithril-stm/tests/bytes_conversion.rs b/mithril-stm/tests/bytes_conversion.rs index 6e23458e150..f2172e182ec 100644 --- a/mithril-stm/tests/bytes_conversion.rs +++ b/mithril-stm/tests/bytes_conversion.rs @@ -49,14 +49,14 @@ fn test_binary_conversions() { let verification_key = reg_parties[0].0; let encoded = verification_key.to_bytes(); VerificationKey::from_bytes(&encoded[1..]) - .expect_err("StmVerificationKey decoding should fail with invalid bytes"); + .expect_err("VerificationKey decoding should fail with invalid bytes"); let decoded = VerificationKey::from_bytes(&encoded).unwrap(); assert_eq!(verification_key, decoded); let initializer = &initializers[0]; let encoded = initializer.to_bytes(); Initializer::from_bytes(&encoded[1..]) - .expect_err("StmInitializer decoding should fail with invalid bytes"); + .expect_err("Initializer decoding should fail with invalid bytes"); let decoded = Initializer::from_bytes(&encoded).unwrap(); assert_eq!(initializer.to_bytes(), decoded.to_bytes()); @@ -66,14 +66,14 @@ fn test_binary_conversions() { let sig = &sigs[0]; let encoded = sig.to_bytes(); SingleSignature::from_bytes::>(&encoded[1..]) - .expect_err("StmSig decoding should fail with invalid bytes"); + .expect_err("SingleSignature decoding should fail with invalid bytes"); let decoded = SingleSignature::from_bytes::>(&encoded).unwrap(); assert_eq!(sig, &decoded); let msig = msig.unwrap(); let encoded = msig.to_bytes(); AggregateSignature::>::from_bytes(&encoded[1..]) - .expect_err("StmAggrSig decoding should fail with invalid bytes"); + .expect_err("AggregateSignature decoding should fail with invalid bytes"); let decoded = AggregateSignature::>::from_bytes(&encoded).unwrap(); assert_eq!(msig.to_bytes(), decoded.to_bytes()); } From 05092fcd6a0bbcef8c47ee3c2bde399a14573944 Mon Sep 17 00:00:00 2001 From: curiecrypt Date: Wed, 2 Jul 2025 19:25:30 +0300 Subject: [PATCH 2/3] change log and crates version --- Cargo.lock | 2 +- mithril-stm/CHANGELOG.md | 6 ++++++ mithril-stm/Cargo.toml | 2 +- mithril-stm/src/lib.rs | 22 +++++++++++----------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37a2e18186d..211f61b5e4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4413,7 +4413,7 @@ dependencies = [ [[package]] name = "mithril-stm" -version = "0.4.7" +version = "0.4.8" dependencies = [ "bincode", "blake2 0.10.6", diff --git a/mithril-stm/CHANGELOG.md b/mithril-stm/CHANGELOG.md index 5d8d5acbb04..48a9bf2432c 100644 --- a/mithril-stm/CHANGELOG.md +++ b/mithril-stm/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.4.8 (02-07-2025) + +### Deprecated + +- Old struct names are deprecated. + ## 0.4.6 (27-06-2025) ### Changed diff --git a/mithril-stm/Cargo.toml b/mithril-stm/Cargo.toml index 919720f0ded..c077e459aaf 100644 --- a/mithril-stm/Cargo.toml +++ b/mithril-stm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-stm" -version = "0.4.7" +version = "0.4.8" edition = { workspace = true } authors = { workspace = true } homepage = { workspace = true } diff --git a/mithril-stm/src/lib.rs b/mithril-stm/src/lib.rs index 3e70e8ea910..690facc9211 100644 --- a/mithril-stm/src/lib.rs +++ b/mithril-stm/src/lib.rs @@ -140,40 +140,40 @@ pub type Stake = u64; pub type Index = u64; // Aliases -#[deprecated(since = "0.4.6", note = "Use `AggregateSignature` instead")] +#[deprecated(since = "0.4.8", note = "Use `AggregateSignature` instead")] pub use aggregate_signature::AggregateSignature as StmAggrSig; -#[deprecated(since = "0.4.6", note = "Use `AggregateVerificationKey` instead")] +#[deprecated(since = "0.4.8", note = "Use `AggregateVerificationKey` instead")] pub use aggregate_signature::AggregateVerificationKey as StmAggrVerificationKey; -#[deprecated(since = "0.4.6", note = "Use `Clerk` instead")] +#[deprecated(since = "0.4.8", note = "Use `Clerk` instead")] pub use aggregate_signature::Clerk as StmClerk; -#[deprecated(since = "0.4.6", note = "Use `ClosedKeyRegistration` instead")] +#[deprecated(since = "0.4.8", note = "Use `ClosedKeyRegistration` instead")] pub use key_registration::ClosedKeyRegistration as ClosedKeyReg; -#[deprecated(since = "0.4.6", note = "Use `KeyRegistration` instead")] +#[deprecated(since = "0.4.8", note = "Use `KeyRegistration` instead")] pub use key_registration::KeyRegistration as KeyReg; -#[deprecated(since = "0.4.6", note = "Use `Parameters` instead")] +#[deprecated(since = "0.4.8", note = "Use `Parameters` instead")] pub use parameters::Parameters as StmParameters; -#[deprecated(since = "0.4.6", note = "Use `Initializer` instead")] +#[deprecated(since = "0.4.8", note = "Use `Initializer` instead")] pub use participant::Initializer as StmInitializer; -#[deprecated(since = "0.4.6", note = "Use `Signer` instead")] +#[deprecated(since = "0.4.8", note = "Use `Signer` instead")] pub use participant::Signer as StmSigner; -#[deprecated(since = "0.4.6", note = "Use `VerificationKey` instead")] +#[deprecated(since = "0.4.8", note = "Use `VerificationKey` instead")] pub use participant::VerificationKey as StmVerificationKey; #[deprecated( - since = "0.4.6", + since = "0.4.8", note = "Use `VerificationKeyProofOfPossession` instead" )] pub use participant::VerificationKeyProofOfPossession as StmVerificationKeyPoP; -#[deprecated(since = "0.4.6", note = "Use `SingleSignature` instead")] +#[deprecated(since = "0.4.8", note = "Use `SingleSignature` instead")] pub use single_signature::SingleSignature as StmSig; #[deprecated(since = "0.4.6", note = "Use `BasicVerifier` instead")] From a5b7cc164a7cf1782d42507a13c68f76279c7bb8 Mon Sep 17 00:00:00 2001 From: curiecrypt Date: Wed, 2 Jul 2025 19:37:16 +0300 Subject: [PATCH 3/3] update demo md - depr StmParameters --- demo/protocol-demo/README.md | 14 +++++----- .../manual/develop/protocol-simulation.md | 28 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/demo/protocol-demo/README.md b/demo/protocol-demo/README.md index 79013ee6d55..16c4658d619 100644 --- a/demo/protocol-demo/README.md +++ b/demo/protocol-demo/README.md @@ -73,16 +73,16 @@ Party #1: party created with 741 stakes Party #2: party created with 144 stakes Party #3: party created with 734 stakes Party #4: party created with 41 stakes -Protocol established to StmParameters { m: 100, k: 5, phi_f: 0.2 } +Protocol established to Parameters { m: 100, k: 5, phi_f: 0.2 } >> Protocol initialize phase: Verifier: verifier created -Verifier: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } -Party #0: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } -Party #1: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } -Party #2: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } -Party #3: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } -Party #4: protocol params updated to StmParameters { m: 100, k: 5, phi_f: 0.2 } +Verifier: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } +Party #0: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } +Party #1: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } +Party #2: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } +Party #3: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } +Party #4: protocol params updated to Parameters { m: 100, k: 5, phi_f: 0.2 } Verifier: protocol keys registration from [(0, 826), (1, 741), (2, 144), (3, 734), (4, 41)] Party #0: protocol keys registration from [(0, 826), (1, 741), (2, 144), (3, 734), (4, 41)] Party #1: protocol keys registration from [(0, 826), (1, 741), (2, 144), (3, 734), (4, 41)] diff --git a/docs/website/root/manual/develop/protocol-simulation.md b/docs/website/root/manual/develop/protocol-simulation.md index a0f8505938e..854b95e7b43 100644 --- a/docs/website/root/manual/develop/protocol-simulation.md +++ b/docs/website/root/manual/develop/protocol-simulation.md @@ -130,16 +130,16 @@ Party #1: party created with 741 stakes Party #2: party created with 144 stakes Party #3: party created with 734 stakes Party #4: party created with 41 stakes -Protocol established to StmParameters { m: 50, k: 5, phi_f: 0.65 } +Protocol established to Parameters { m: 50, k: 5, phi_f: 0.65 } >> Protocol initialization phase: Verifier: verifier created -Verifier: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } -Party #0: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } -Party #1: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } -Party #2: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } -Party #3: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } -Party #4: protocol params updated to StmParameters { m: 50, k: 5, phi_f: 0.65 } +Verifier: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } +Party #0: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } +Party #1: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } +Party #2: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } +Party #3: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } +Party #4: protocol params updated to Parameters { m: 50, k: 5, phi_f: 0.65 } Verifier: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)] Party #0: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)] Party #1: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)] @@ -252,16 +252,16 @@ Party #1: party created with 741 stakes Party #2: party created with 144 stakes Party #3: party created with 734 stakes Party #4: party created with 41 stakes -Protocol established to StmParameters { m: 5, k: 5, phi_f: 0.25 } +Protocol established to Parameters { m: 5, k: 5, phi_f: 0.25 } >> Protocol initialization phase: Verifier: verifier created -Verifier: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } -Party #0: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } -Party #1: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } -Party #2: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } -Party #3: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } -Party #4: protocol params updated to StmParameters { m: 5, k: 5, phi_f: 0.25 } +Verifier: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } +Party #0: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } +Party #1: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } +Party #2: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } +Party #3: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } +Party #4: protocol params updated to Parameters { m: 5, k: 5, phi_f: 0.25 } Verifier: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)] Party #0: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)] Party #1: protocol keys registration from [("0", 826), ("1", 741), ("2", 144), ("3", 734), ("4", 41)]