Skip to content

Commit e8515c8

Browse files
committed
added benchmark feature to schnorr_sig bench
1 parent b274ecd commit e8515c8

File tree

6 files changed

+10
-17
lines changed

6 files changed

+10
-17
lines changed

mithril-stm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ required-features = ["benchmark-internals"]
7272
[[bench]]
7373
name = "schnorr_sig"
7474
harness = false
75-
required-features = ["future_snark"]
75+
required-features = ["future_snark", "benchmark-internals"]
7676

7777
[[bench]]
7878
name = "stm"

mithril-stm/src/protocol/error.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
//! Crate specific errors
2-
use anyhow::anyhow;
3-
use blst::BLST_ERROR;
4-
5-
use crate::{
6-
AggregateSignatureType, StmResult,
7-
signature_scheme::{BlsSignature, BlsVerificationKey, BlsVerificationKeyProofOfPossession},
8-
};
1+
use crate::signature_scheme::{BlsVerificationKey, BlsVerificationKeyProofOfPossession};
92

103
/// Errors which can be outputted by key registration.
114
#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]

mithril-stm/src/protocol/single_signature/signature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use serde::{Deserialize, Serialize};
99

1010
use super::SignatureError;
1111
use crate::{
12-
AggregateVerificationKey, BlsSignature, Index, Parameters, Stake, StmResult, VerificationKey,
13-
is_lottery_won,
12+
AggregateVerificationKey, Index, Parameters, Stake, StmResult, VerificationKey, is_lottery_won,
13+
signature_scheme::BlsSignature,
1414
};
1515

1616
/// Signature created by a single party who has won the lottery.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl SchnorrSignature {
154154
#[cfg(test)]
155155
mod tests {
156156

157-
use crate::{SchnorrSignature, SchnorrSigningKey, SchnorrVerificationKey};
157+
use crate::signature_scheme::{SchnorrSignature, SchnorrSigningKey, SchnorrVerificationKey};
158158
use rand_chacha::ChaCha20Rng;
159159
use rand_core::SeedableRng;
160160

@@ -209,7 +209,7 @@ mod tests {
209209
use rand_chacha::ChaCha20Rng;
210210
use rand_core::SeedableRng;
211211

212-
use crate::{SchnorrSignature, SchnorrSigningKey};
212+
use crate::signature_scheme::{SchnorrSignature, SchnorrSigningKey};
213213

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ mod tests {
191191
use rand_chacha::ChaCha20Rng;
192192
use rand_core::SeedableRng;
193193

194-
use crate::SchnorrSigningKey;
194+
use crate::signature_scheme::SchnorrSigningKey;
195195

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

mithril-stm/src/signature_scheme/schnorr_signature/verification_key.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{Context, anyhow};
22
use dusk_jubjub::SubgroupPoint as JubjubSubgroup;
33
use group::{Group, GroupEncoding};
44

5-
use super::SchnorrSignatureError;
5+
use super::{SchnorrSignatureError, SchnorrSigningKey};
66
use crate::StmResult;
77

88
/// Schnorr verification key, it consists of a point on the Jubjub curve
@@ -38,12 +38,12 @@ impl SchnorrVerificationKey {
3838
}
3939
}
4040

41-
impl From<&crate::SchnorrSigningKey> for SchnorrVerificationKey {
41+
impl From<&SchnorrSigningKey> for SchnorrVerificationKey {
4242
/// Convert a Schnorr secret key into a verification key
4343
///
4444
/// This is done by computing `vk = g * sk` where g is the generator
4545
/// of the subgroup and sk is the schnorr secret key
46-
fn from(signing_key: &crate::SchnorrSigningKey) -> Self {
46+
fn from(signing_key: &SchnorrSigningKey) -> Self {
4747
let generator = JubjubSubgroup::generator();
4848

4949
SchnorrVerificationKey(generator * signing_key.0)

0 commit comments

Comments
 (0)