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.

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.8.1 (12-22-2025)

### Added

- Jubjub wrapper is added for `schnorr_signature` module.

## 0.8.0 (12-17-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.8.0"
version = "0.8.1"
edition = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions mithril-stm/benches/schnorr_sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ fn sign_and_verify(c: &mut Criterion, nr_sigs: usize) {
let mut msks = Vec::new();
let mut sigs = Vec::new();
for _ in 0..nr_sigs {
let sk = SchnorrSigningKey::try_generate(&mut rng).unwrap();
let vk = SchnorrVerificationKey::from(&sk);
let sk = SchnorrSigningKey::generate(&mut rng).unwrap();
let vk = SchnorrVerificationKey::new_from_signing_key(sk.clone()).unwrap();
let sig = sk.sign(&msg, &mut rng_sig).unwrap();
sigs.push(sig);
mvks.push(vk);
Expand Down
36 changes: 26 additions & 10 deletions mithril-stm/src/signature_scheme/schnorr_signature/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(feature = "future_snark")]
use super::{SchnorrSignature, SchnorrVerificationKey};
use super::{PrimeOrderProjectivePoint, SchnorrSignature};

/// Error types for Schnorr signatures.
#[cfg(feature = "future_snark")]
Expand All @@ -9,19 +9,35 @@ pub enum SchnorrSignatureError {
#[error("Invalid Schnorr single signature")]
SignatureInvalid(Box<SchnorrSignature>),

/// Invalid Verification key
#[error("Invalid Schnorr Verification key")]
VerificationKeyInvalid(Box<SchnorrVerificationKey>),

/// This error occurs when the serialization of the raw bytes failed
#[error("Invalid bytes")]
SerializationError,
Serialization,

/// This error occurs when the serialization of the scalar field bytes failed
#[error("Invalid scalar field element bytes")]
ScalarFieldElementSerialization,

/// This error occurs when the serialization of the projective point bytes failed
#[error("Invalid projective point bytes")]
ProjectivePointSerialization,

/// This error occurs when the signing key fails to generate
#[error("Failed generation of the signing key")]
SigningKeyGenerationError,
/// This error occurs when the serialization of the prime order projective point bytes failed
#[error("Invalid prime order projective point bytes")]
PrimeOrderProjectivePointSerialization,

/// This error occurs when the random scalar fails to generate during the signature
#[error("Failed generation of the signature's random scalar")]
RandomScalarGenerationError,
RandomScalarGeneration,

/// This error occurs when signing key is zero or one.
#[error("The signing key is invalid.")]
InvalidSigningKey,

/// Given point is not on the curve
#[error("Given point is not on the curve")]
PointIsNotOnCurve(Box<PrimeOrderProjectivePoint>),

/// Given point is not prime order
#[error("Given point is not prime order")]
PointIsNotPrimeOrder(Box<PrimeOrderProjectivePoint>),
}
Loading
Loading