Skip to content

Commit bfb326e

Browse files
committed
schnorr module integrated into signature_scheme
1 parent ac39c0d commit bfb326e

File tree

12 files changed

+40
-34
lines changed

12 files changed

+40
-34
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-stm/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.6.2 (11-27-2025)
9+
10+
### Changed
11+
12+
- Stm library re-organized for SNARK-friendliness.
13+
814
## 0.6.1 (11-27-2025)
915

1016
### Added

mithril-stm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-stm"
3-
version = "0.6.1"
3+
version = "0.6.2"
44
edition = { workspace = true }
55
authors = { workspace = true }
66
homepage = { workspace = true }

mithril-stm/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@
112112
//! ```
113113
114114
mod membership_commitment;
115-
#[cfg(feature = "future_snark")]
116-
mod schnorr_signature;
117-
118115
mod proof_system;
119116
mod protocol;
120117
mod signature_scheme;
@@ -128,7 +125,7 @@ pub use signature_scheme::{
128125
};
129126

130127
#[cfg(feature = "future_snark")]
131-
pub use schnorr_signature::{SchnorrSignature, SchnorrSigningKey, SchnorrVerificationKey};
128+
pub use signature_scheme::{SchnorrSignature, SchnorrSigningKey, SchnorrVerificationKey};
132129

133130
/// The quantity of stake held by a party, represented as a `u64`.
134131
pub type Stake = u64;

mithril-stm/src/schnorr_signature/mod.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
mod bls_multi_signature;
2+
#[cfg(feature = "future_snark")]
23
mod schnorr_signature;
34

45
pub use bls_multi_signature::*;
6+
7+
#[cfg(feature = "future_snark")]
8+
pub use schnorr_signature::*;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1+
mod error;
2+
mod signature;
3+
mod signing_key;
4+
mod utils;
5+
mod verification_key;
16

7+
pub use error::*;
8+
pub use signature::*;
9+
pub use signing_key::*;
10+
pub(crate) use utils::*;
11+
pub use verification_key::*;
12+
13+
use dusk_jubjub::Fq as JubjubBase;
14+
15+
/// A DST (Domain Separation Tag) to distinguish between use of Poseidon hash
16+
const DST_SIGNATURE: JubjubBase = JubjubBase::from_raw([0u64, 0, 0, 0]);

mithril-stm/src/schnorr_signature/signature.rs renamed to mithril-stm/src/signature_scheme/schnorr_signature/signature.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use group::{Group, GroupEncoding};
88

99
use crate::{
1010
StmResult,
11-
schnorr_signature::{
12-
DST_SIGNATURE, SchnorrSignatureError, SchnorrVerificationKey,
13-
get_coordinates_several_points, is_on_curve,
11+
signature_scheme::{
12+
SchnorrSignatureError, SchnorrVerificationKey, get_coordinates_several_points, is_on_curve,
13+
schnorr_signature::DST_SIGNATURE,
1414
},
1515
};
1616

@@ -211,7 +211,7 @@ mod tests {
211211
use rand_chacha::ChaCha20Rng;
212212
use rand_core::SeedableRng;
213213

214-
use crate::schnorr_signature::{SchnorrSignature, SchnorrSigningKey};
214+
use crate::{SchnorrSignature, SchnorrSigningKey};
215215

216216
const GOLDEN_BYTES: &[u8; 96] = &[
217217
143, 53, 198, 62, 178, 1, 88, 253, 21, 92, 100, 13, 72, 180, 198, 127, 39, 175, 102,

mithril-stm/src/schnorr_signature/signing_key.rs renamed to mithril-stm/src/signature_scheme/schnorr_signature/signing_key.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use rand_core::{CryptoRng, RngCore};
99

1010
use crate::{
1111
StmResult,
12-
schnorr_signature::{
13-
DST_SIGNATURE, SchnorrSignature, SchnorrSignatureError, SchnorrVerificationKey,
14-
generate_non_zero_scalar, get_coordinates_several_points,
12+
signature_scheme::{
13+
SchnorrSignature, SchnorrSignatureError, SchnorrVerificationKey, generate_non_zero_scalar,
14+
get_coordinates_several_points, schnorr_signature::DST_SIGNATURE,
1515
},
1616
};
1717

@@ -193,7 +193,7 @@ mod tests {
193193
use rand_chacha::ChaCha20Rng;
194194
use rand_core::SeedableRng;
195195

196-
use crate::schnorr_signature::SchnorrSigningKey;
196+
use crate::SchnorrSigningKey;
197197

198198
const GOLDEN_BYTES: &[u8; 32] = &[
199199
126, 191, 239, 197, 88, 151, 248, 254, 187, 143, 86, 35, 29, 62, 90, 13, 196, 71, 234,

0 commit comments

Comments
 (0)