Remove spend verification from the identify function

This commit is contained in:
aniampio
2022-08-10 18:57:00 +01:00
parent f5c493500f
commit 268a1817ab
4 changed files with 6 additions and 12 deletions
@@ -152,7 +152,8 @@ struct BenchCase {
fn bench_compact_ecash(c: &mut Criterion) {
let mut group = c.benchmark_group("benchmark-compact-ecash");
group.measurement_time(Duration::from_secs(200));
group.sample_size(300);
group.measurement_time(Duration::from_secs(1500));
let case = BenchCase {
num_authorities: 100,
@@ -353,5 +354,5 @@ fn bench_compact_ecash(c: &mut Criterion) {
assert_eq!(identify_result, IdentifyResult::DoubleSpendingPublicKeys(user_keypair.public_key()));
}
criterion_group!(benches, bench_pairings, bench_compact_ecash);
criterion_group!(benches, bench_compact_ecash);
criterion_main!(benches);
@@ -13,10 +13,6 @@ pub enum IdentifyResult {
pub fn identify(params: &Parameters, public_keys_u: &[PublicKeyUser], verification_key: &VerificationKeyAuth, payment1: Payment, payment2: Payment, pay_info1: PayInfo, pay_info2: PayInfo) -> Result<IdentifyResult> {
// verify first the validity of both payments
assert!(payment1.spend_verify(&params, &verification_key, &pay_info1).unwrap());
assert!(payment2.spend_verify(&params, &verification_key, &pay_info2).unwrap());
let mut k = 0;
let mut j = 0;
'outer: for (id1, pay1_ss) in payment1.ss.iter().enumerate() {
@@ -149,7 +149,8 @@ struct BenchCase {
fn bench_divisible_ecash(c: &mut Criterion) {
let mut group = c.benchmark_group("benchmark-divisible-ecash");
group.measurement_time(Duration::from_secs(200));
group.sample_size(300);
group.measurement_time(Duration::from_secs(1500));
let case = BenchCase {
num_authorities: 100,
@@ -322,5 +323,5 @@ fn bench_divisible_ecash(c: &mut Criterion) {
assert_eq!(identify_result, IdentifyResult::DoubleSpendingPublicKeys(pk_user));
}
criterion_group!(benches, bench_pairings, bench_divisible_ecash);
criterion_group!(benches, bench_divisible_ecash);
criterion_main!(benches);
@@ -27,10 +27,6 @@ pub fn identify(
payment2: Payment,
pay_info1: PayInfo,
pay_info2: PayInfo) -> Result<IdentifyResult> {
// verify first the validity of both payments
assert!(payment1.spend_verify(&params, &verification_key, &pay_info1).unwrap());
assert!(payment2.spend_verify(&params, &verification_key, &pay_info2).unwrap());
let params_a = params.get_params_a();
// compute the serial numbers for k1 in [0, V1-1]