Skip to content

Commit

Permalink
Remove default Schnorr functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed May 24, 2023
1 parent 8a0823f commit 448833d
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 234 deletions.
7 changes: 5 additions & 2 deletions benches/signatures.rs
Expand Up @@ -6,10 +6,13 @@ use std::time::Duration;
use criterion::{criterion_group, BatchSize, Criterion};
use rand::{thread_rng, RngCore};
use tari_crypto::{
hash_domain,
keys::{PublicKey, SecretKey},
ristretto::{RistrettoPublicKey, RistrettoSchnorr, RistrettoSecretKey},
};

hash_domain!(BenchDomain, "com.example.bench");

fn generate_secret_key(c: &mut Criterion) {
c.bench_function("Generate secret key", |b| {
let mut rng = thread_rng();
Expand Down Expand Up @@ -45,7 +48,7 @@ fn sign_message(c: &mut Criterion) {
b.iter_batched(
gen_keypair,
|d| {
let _sig = RistrettoSchnorr::sign_message(&d.k, d.m).unwrap();
let _sig: RistrettoSchnorr<BenchDomain> = RistrettoSchnorr::sign_message(&d.k, d.m).unwrap();
},
BatchSize::SmallInput,
);
Expand All @@ -59,7 +62,7 @@ fn verify_message(c: &mut Criterion) {
b.iter_batched(
|| {
let d = gen_keypair();
let s = RistrettoSchnorr::sign_message(&d.k, d.m).unwrap();
let s: RistrettoSchnorr<BenchDomain> = RistrettoSchnorr::sign_message(&d.k, d.m).unwrap();
(d, s)
},
|(d, s)| assert!(s.verify_message(&d.p, d.m)),
Expand Down
3 changes: 1 addition & 2 deletions src/ristretto/mod.rs
Expand Up @@ -12,7 +12,6 @@ mod ristretto_com_sig;
pub mod ristretto_keys;
mod ristretto_sig;
pub mod serialize;
pub mod utils;

// Re-export
pub use dalek_range_proof::DalekRangeProofService;
Expand All @@ -21,7 +20,7 @@ pub use self::{
ristretto_com_and_pub_sig::RistrettoComAndPubSig,
ristretto_com_sig::RistrettoComSig,
ristretto_keys::{RistrettoPublicKey, RistrettoSecretKey},
ristretto_sig::{RistrettoSchnorr, RistrettoSchnorrWithDomain},
ristretto_sig::RistrettoSchnorr,
};

// test modules
Expand Down

0 comments on commit 448833d

Please sign in to comment.