Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ kes-summed-ed25519 = { version = "0.2.1", features = [
"serde_enabled",
"sk_clone_enabled",
] }
mithril-stm = { path = "../mithril-stm", version = "=0.4", default-features = false }
mithril-stm = { path = "../mithril-stm", version = ">=0.4", default-features = false }
nom = "8.0.0"
rand_chacha = { workspace = true }
rand_core = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions mithril-stm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.5.0 (09-09-2025)

### Changed

- Bumped new minor version for release following deprecations of structure names and functions.

## 0.4.9 (07-07-2025)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion mithril-stm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-stm"
version = "0.4.12"
version = "0.5.0"
edition = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion mithril-stm/src/aggregate_signature/aggregate_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<D: Digest + Clone + FixedOutput> AggregateVerificationKey<D> {
}

#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `get_merkle_tree_batch_commitment` instead"
)]
pub fn get_mt_commitment(&self) -> MerkleTreeBatchCommitment<D> {
Expand Down
4 changes: 2 additions & 2 deletions mithril-stm/src/aggregate_signature/basic_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl BasicVerifier {
/// * Collect the unique signers in a hash set,
/// * Calculate the total stake of the eligible signers,
/// * Sort the eligible signers.
#[deprecated(since = "0.4.9", note = "Use `new` instead")]
#[deprecated(since = "0.5.0", note = "Use `new` instead")]
pub fn setup(public_signers: &[(BlsVerificationKey, Stake)]) -> Self {
Self::new(public_signers)
}
Expand Down Expand Up @@ -181,7 +181,7 @@ impl BasicVerifier {
// todo: We need to agree on a criteria to dedup (by default we use a BTreeMap that guarantees keys order)
// todo: not good, because it only removes index if there is a conflict (see benches)
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `select_valid_signatures_for_k_indices` instead"
)]
pub fn dedup_sigs_for_indices(
Expand Down
10 changes: 5 additions & 5 deletions mithril-stm/src/aggregate_signature/clerk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<D: Digest + Clone + FixedOutput> Clerk<D> {

/// Create a new `Clerk` from a closed registration instance.
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `new_clerk_from_closed_key_registration` instead"
)]
pub fn from_registration(params: &Parameters, closed_reg: &ClosedKeyRegistration<D>) -> Self {
Expand All @@ -51,7 +51,7 @@ impl<D: Digest + Clone + FixedOutput> Clerk<D> {
}

/// Create a Clerk from a signer.
#[deprecated(since = "0.4.9", note = "Use `new_clerk_from_signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `new_clerk_from_signer` instead")]
pub fn from_signer(signer: &Signer<D>) -> Self {
Self::new_clerk_from_signer(signer)
}
Expand Down Expand Up @@ -108,7 +108,7 @@ impl<D: Digest + Clone + FixedOutput> Clerk<D> {
/// The list of merkle tree indexes is used to create a batch proof, to prove that all signatures are from eligible signers.
///
/// It returns an instance of `AggregateSignature`.
#[deprecated(since = "0.4.9", note = "Use `aggregate_signatures` instead")]
#[deprecated(since = "0.5.0", note = "Use `aggregate_signatures` instead")]
pub fn aggregate(
&self,
sigs: &[SingleSignature],
Expand All @@ -124,7 +124,7 @@ impl<D: Digest + Clone + FixedOutput> Clerk<D> {

/// Compute the `AggregateVerificationKey` related to the used registration.
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `compute_aggregate_verification_key` instead"
)]
pub fn compute_avk(&self) -> AggregateVerificationKey<D> {
Expand All @@ -143,7 +143,7 @@ impl<D: Digest + Clone + FixedOutput> Clerk<D> {
}

/// Get the (VK, stake) of a party given its index.
#[deprecated(since = "0.4.9", note = "Use `get_registered_party_for_index` instead")]
#[deprecated(since = "0.5.0", note = "Use `get_registered_party_for_index` instead")]
pub fn get_reg_party(&self, party_index: &Index) -> Option<(VerificationKey, Stake)> {
Self::get_registered_party_for_index(self, party_index)
}
Expand Down
2 changes: 1 addition & 1 deletion mithril-stm/src/bls_multi_signature/verification_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl BlsVerificationKeyProofOfPossession {
/// manually.
// If we are really looking for performance improvements, we can combine the
// two final exponentiations (for verifying k1 and k2) into a single one.
#[deprecated(since = "0.4.9", note = "Use `verify_proof_of_possesion` instead")]
#[deprecated(since = "0.5.0", note = "Use `verify_proof_of_possesion` instead")]
pub fn check(&self) -> Result<(), MultiSignatureError> {
Self::verify_proof_of_possesion(self)
}
Expand Down
26 changes: 13 additions & 13 deletions mithril-stm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,47 +140,47 @@ pub type Stake = u64;
pub type Index = u64;

// Aliases
#[deprecated(since = "0.4.8", note = "Use `AggregateSignature` instead")]
#[deprecated(since = "0.5.0", note = "Use `AggregateSignature` instead")]
pub use aggregate_signature::AggregateSignature as StmAggrSig;

#[deprecated(since = "0.4.8", note = "Use `AggregateVerificationKey` instead")]
#[deprecated(since = "0.5.0", note = "Use `AggregateVerificationKey` instead")]
pub use aggregate_signature::AggregateVerificationKey as StmAggrVerificationKey;

#[deprecated(since = "0.4.8", note = "Use `Clerk` instead")]
#[deprecated(since = "0.5.0", note = "Use `Clerk` instead")]
pub use aggregate_signature::Clerk as StmClerk;

#[deprecated(since = "0.4.8", note = "Use `ClosedKeyRegistration` instead")]
#[deprecated(since = "0.5.0", note = "Use `ClosedKeyRegistration` instead")]
pub use key_registration::ClosedKeyRegistration as ClosedKeyReg;

#[deprecated(since = "0.4.8", note = "Use `KeyRegistration` instead")]
#[deprecated(since = "0.5.0", note = "Use `KeyRegistration` instead")]
pub use key_registration::KeyRegistration as KeyReg;

#[deprecated(since = "0.4.8", note = "Use `Parameters` instead")]
#[deprecated(since = "0.5.0", note = "Use `Parameters` instead")]
pub use parameters::Parameters as StmParameters;

#[deprecated(since = "0.4.8", note = "Use `Initializer` instead")]
#[deprecated(since = "0.5.0", note = "Use `Initializer` instead")]
pub use participant::Initializer as StmInitializer;

#[deprecated(since = "0.4.8", note = "Use `Signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `Signer` instead")]
pub use participant::Signer as StmSigner;

#[deprecated(since = "0.4.8", note = "Use `VerificationKey` instead")]
#[deprecated(since = "0.5.0", note = "Use `VerificationKey` instead")]
pub use participant::VerificationKey as StmVerificationKey;

#[deprecated(
since = "0.4.8",
since = "0.5.0",
note = "Use `VerificationKeyProofOfPossession` instead"
)]
pub use participant::VerificationKeyProofOfPossession as StmVerificationKeyPoP;

#[deprecated(since = "0.4.8", note = "Use `SingleSignature` instead")]
#[deprecated(since = "0.5.0", note = "Use `SingleSignature` instead")]
pub use single_signature::SingleSignature as StmSig;

#[deprecated(since = "0.4.6", note = "Use `BasicVerifier` instead")]
#[deprecated(since = "0.5.0", note = "Use `BasicVerifier` instead")]
pub use aggregate_signature::BasicVerifier as CoreVerifier;

#[deprecated(
since = "0.4.6",
since = "0.5.0",
note = "Use `SingleSignatureWithRegisteredParty` instead"
)]
pub use single_signature::SingleSignatureWithRegisteredParty as StmSigRegParty;
8 changes: 4 additions & 4 deletions mithril-stm/src/merkle_tree/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<D: Digest + FixedOutput> MerkleTreeCommitment<D> {
/// # Error
/// If the merkle tree path is invalid, then the function fails.
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `verify_leaf_membership_from_path` instead"
)]
pub fn check(
Expand Down Expand Up @@ -86,7 +86,7 @@ impl<D: Digest + FixedOutput> MerkleTreeCommitment<D> {

/// Serializes the Merkle Tree commitment together with a message in a single vector of bytes.
/// Outputs `msg || self` as a vector of bytes.
#[deprecated(since = "0.4.9", note = "Use `concatenate_with_message` instead")]
#[deprecated(since = "0.5.0", note = "Use `concatenate_with_message` instead")]
pub fn concat_with_msg(&self, msg: &[u8]) -> Vec<u8>
where
D: Digest,
Expand Down Expand Up @@ -136,7 +136,7 @@ impl<D: Digest> MerkleTreeBatchCommitment<D> {
/// Serializes the Merkle Tree commitment together with a message in a single vector of bytes.
/// Outputs `msg || self` as a vector of bytes.
// todo: Do we need to concat msg to whole commitment (nr_leaves and root) or just the root?
#[deprecated(since = "0.4.9", note = "Use `concatenate_with_message` instead")]
#[deprecated(since = "0.5.0", note = "Use `concatenate_with_message` instead")]
pub fn concat_with_msg(&self, msg: &[u8]) -> Vec<u8> {
Self::concatenate_with_message(self, msg)
}
Expand Down Expand Up @@ -241,7 +241,7 @@ impl<D: Digest> MerkleTreeBatchCommitment<D> {
// todo: Simplify the algorithm.
// todo: Maybe we want more granular errors, rather than only `BatchPathInvalid`
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `verify_leaves_membership_from_batch_path` instead"
)]
pub fn check(
Expand Down
10 changes: 5 additions & 5 deletions mithril-stm/src/merkle_tree/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
}

/// Provided a non-empty list of leaves, `create` generates its corresponding `MerkleTree`.
#[deprecated(since = "0.4.9", note = "Use `new` instead")]
#[deprecated(since = "0.5.0", note = "Use `new` instead")]
pub fn create(leaves: &[MerkleTreeLeaf]) -> MerkleTree<D> {
Self::new(leaves)
}
Expand All @@ -83,7 +83,7 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
/// Convert merkle tree to a batch compatible commitment.
/// This function simply returns the root and the number of leaves in the tree.
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `to_merkle_tree_batch_commitment` instead"
)]
pub fn to_commitment_batch_compat(&self) -> MerkleTreeBatchCommitment<D> {
Expand Down Expand Up @@ -169,7 +169,7 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
/// If the indices provided are out of bounds (higher than the number of elements
/// committed in the `MerkleTree`) or are not ordered, the function fails.
// todo: Update doc.
#[deprecated(since = "0.4.9", note = "Use `compute_merkle_tree_batch_path` instead")]
#[deprecated(since = "0.5.0", note = "Use `compute_merkle_tree_batch_path` instead")]
pub fn get_batched_path(&self, indices: Vec<usize>) -> MerkleBatchPath<D>
where
D: FixedOutput,
Expand Down Expand Up @@ -226,7 +226,7 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
}

/// Convert merkle tree to a commitment. This function simply returns the root.
#[deprecated(since = "0.4.9", note = "Use `to_merkle_tree_commitment` instead")]
#[deprecated(since = "0.5.0", note = "Use `to_merkle_tree_commitment` instead")]
pub fn to_commitment(&self) -> MerkleTreeCommitment<D> {
Self::to_merkle_tree_commitment(self)
}
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<D: Digest + FixedOutput> MerkleTree<D> {
/// Get a path (hashes of siblings of the path to the root node)
/// for the `i`th value stored in the tree.
/// Requires `i < self.n`
#[deprecated(since = "0.4.9", note = "Use `compute_merkle_tree_path` instead")]
#[deprecated(since = "0.5.0", note = "Use `compute_merkle_tree_path` instead")]
pub fn get_path(&self, i: usize) -> MerklePath<D> {
Self::compute_merkle_tree_path(self, i)
}
Expand Down
8 changes: 4 additions & 4 deletions mithril-stm/src/participant/initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Initializer {

/// Builds an `Initializer` that is ready to register with the key registration service.
/// This function generates the signing and verification key with a PoP, and initialises the structure.
#[deprecated(since = "0.4.9", note = "Use `new` instead")]
#[deprecated(since = "0.5.0", note = "Use `new` instead")]
pub fn setup<R: RngCore + CryptoRng>(params: Parameters, stake: Stake, rng: &mut R) -> Self {
Self::new(params, stake, rng)
}
Expand All @@ -53,7 +53,7 @@ impl Initializer {

/// Extract the verification key.
#[deprecated(
since = "0.4.9",
since = "0.5.0",
note = "Use `get_verification_key_proof_of_possession` instead"
)]
pub fn verification_key(&self) -> VerificationKeyProofOfPossession {
Expand Down Expand Up @@ -109,7 +109,7 @@ impl Initializer {
/// * the current total stake (according to the registration service)
/// # Error
/// This function fails if the initializer is not registered.
#[deprecated(since = "0.4.9", note = "Use `create_signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `create_signer` instead")]
pub fn new_signer<D: Digest + Clone + FixedOutput>(
self,
closed_reg: ClosedKeyRegistration<D>,
Expand Down Expand Up @@ -151,7 +151,7 @@ impl Initializer {
/// Takes `eligible_parties` as a parameter and determines the signer's index in the parties.
/// `eligible_parties` is verified and trusted which is only run by a full-node
/// that has already verified the parties.
#[deprecated(since = "0.4.9", note = "Use `create_basic_signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `create_basic_signer` instead")]
pub fn new_core_signer<D: Digest + Clone + FixedOutput>(
self,
eligible_parties: &[RegisteredParty],
Expand Down
12 changes: 6 additions & 6 deletions mithril-stm/src/participant/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
}

/// Create a Signer for given input
#[deprecated(since = "0.4.9", note = "Use `set_signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `set_signer` instead")]
pub fn set_stm_signer(
signer_index: u64,
stake: Stake,
Expand Down Expand Up @@ -77,7 +77,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
}

/// Create a core signer (no registration data) for given input
#[deprecated(since = "0.4.9", note = "Use `set_basic_signer` instead")]
#[deprecated(since = "0.5.0", note = "Use `set_basic_signer` instead")]
pub fn set_core_signer(
signer_index: u64,
stake: Stake,
Expand Down Expand Up @@ -115,7 +115,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
}

/// Extract the verification key.
#[deprecated(since = "0.4.9", note = "Use `get_verification_key` instead")]
#[deprecated(since = "0.5.0", note = "Use `get_verification_key` instead")]
pub fn verification_key(&self) -> VerificationKey {
Self::get_verification_key(self)
}
Expand Down Expand Up @@ -150,7 +150,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
/// Once the signature is produced, this function checks whether any index in `[0,..,self.params.m]`
/// wins the lottery by evaluating the dense mapping.
/// It records all the winning indexes in `Self.indexes`.
#[deprecated(since = "0.4.9", note = "Use `basic_sign` instead")]
#[deprecated(since = "0.5.0", note = "Use `basic_sign` instead")]
pub fn core_sign(&self, msg: &[u8], total_stake: Stake) -> Option<SingleSignature> {
Self::basic_sign(self, msg, total_stake)
}
Expand All @@ -177,7 +177,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
}

/// Get Parameters
#[deprecated(since = "0.4.9", note = "Use `get_parameters` instead")]
#[deprecated(since = "0.5.0", note = "Use `get_parameters` instead")]
pub fn get_params(&self) -> Parameters {
Self::get_parameters(self)
}
Expand All @@ -188,7 +188,7 @@ impl<D: Clone + Digest + FixedOutput> Signer<D> {
}

/// Get closed key registration
#[deprecated(since = "0.4.9", note = "Use `get_closed_key_registration` instead")]
#[deprecated(since = "0.5.0", note = "Use `get_closed_key_registration` instead")]
pub fn get_closed_reg(&self) -> Option<ClosedKeyRegistration<D>> {
Self::get_closed_key_registration(self)
}
Expand Down
4 changes: 2 additions & 2 deletions mithril-stm/src/single_signature/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl SingleSignature {
}

/// Compare two `SingleSignature` by their signers' merkle tree indexes.
#[deprecated(since = "0.4.9", note = "This function will be removed")]
#[deprecated(since = "0.5.0", note = "This function will be removed")]
pub fn cmp_stm_sig(&self, other: &Self) -> Ordering {
Self::compare_signer_index(self, other)
}
Expand All @@ -153,7 +153,7 @@ impl SingleSignature {
}

/// Will be deprecated. Use `basic_verify` instead.
#[deprecated(since = "0.4.9", note = "Use `basic_verify` instead")]
#[deprecated(since = "0.5.0", note = "Use `basic_verify` instead")]
pub fn core_verify(
&self,
params: &Parameters,
Expand Down
Loading