Skip to content

Commit 6411a49

Browse files
authored
Merge pull request #4 from brave-experiments/integrate
Add names to benchmarks
2 parents a7ec07c + 5782e2f commit 6411a49

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

macros/src/bench_tcurve.rs

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ macro_rules! bench_tcurve_point_add_prover_time {
212212
let (cax, cay, cbx, cby, ctx, cty) =
213213
<$config as PedersenConfig>::create_commitments_to_coords(a, b, t, &mut OsRng);
214214

215-
c.bench_function(concat!($curve_name, " point add prover time"), |bf| {
215+
c.bench_function(concat!($curve_name, " CDLS point add prover time"), |bf| {
216216
bf.iter(|| {
217217
let mut transcript = Transcript::new(label);
218218
EPAP::<$config>::create_with_existing_commitments(
@@ -286,20 +286,23 @@ macro_rules! bench_tcurve_point_add_verifier_time {
286286
proof.serialized_size() + comm_size
287287
);
288288

289-
c.bench_function(concat!($curve_name, " point add verifier time"), |bf| {
290-
bf.iter(|| {
291-
let mut transcript_v = Transcript::new(label);
292-
proof.verify(
293-
&mut transcript_v,
294-
&cax.comm,
295-
&cay.comm,
296-
&cbx.comm,
297-
&cby.comm,
298-
&ctx.comm,
299-
&cty.comm,
300-
);
301-
});
302-
});
289+
c.bench_function(
290+
concat!($curve_name, " CDLS point add verifier time"),
291+
|bf| {
292+
bf.iter(|| {
293+
let mut transcript_v = Transcript::new(label);
294+
proof.verify(
295+
&mut transcript_v,
296+
&cax.comm,
297+
&cay.comm,
298+
&cbx.comm,
299+
&cby.comm,
300+
&ctx.comm,
301+
&cty.comm,
302+
);
303+
});
304+
},
305+
);
303306
}
304307
};
305308
}
@@ -441,7 +444,7 @@ macro_rules! bench_tcurve_scalar_mul_prover_time {
441444
let c2 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.x), &mut OsRng);
442445
let c3 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.y), &mut OsRng);
443446

444-
c.bench_function(concat!($curve_name, " scalar mul prover time"), |b| {
447+
c.bench_function(concat!($curve_name, " CDLS scalar mul prover time"), |b| {
445448
b.iter(|| {
446449
let mut transcript = Transcript::new(label);
447450
let inter = ECSMP::<$config>::create_intermediates_with_existing_commitments(
@@ -524,11 +527,14 @@ macro_rules! bench_tcurve_scalar_mul_verifier_time {
524527
proof.serialized_size() + comm_size
525528
);
526529

527-
c.bench_function(concat!($curve_name, " scalar mul verifier time"), |b| {
528-
b.iter(|| {
529-
proof.verify_proof(&OGENERATOR, &chal, &c1, &c2.comm, &c3.comm);
530-
});
531-
});
530+
c.bench_function(
531+
concat!($curve_name, " CDLS scalar mul verifier time"),
532+
|b| {
533+
b.iter(|| {
534+
proof.verify_proof(&OGENERATOR, &chal, &c1, &c2.comm, &c3.comm);
535+
});
536+
},
537+
);
532538
}
533539
};
534540
}
@@ -551,7 +557,7 @@ macro_rules! bench_tcurve_fs_scalar_mul_prover_time {
551557
let c3 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.y), &mut OsRng);
552558

553559
c.bench_function(
554-
concat!($curve_name, " fiat-shamir scalar mul prover time"),
560+
concat!($curve_name, " CDLS fiat-shamir scalar mul prover time"),
555561
|b| {
556562
b.iter(|| {
557563
let mut transcript = Transcript::new(label);
@@ -612,7 +618,7 @@ macro_rules! bench_tcurve_fs_scalar_mul_verifier_time {
612618
);
613619

614620
c.bench_function(
615-
concat!($curve_name, " fiat-shamir scalar mul verifier time"),
621+
concat!($curve_name, " CDLS fiat-shamir scalar mul verifier time"),
616622
|b| {
617623
b.iter(|| {
618624
let mut transcript_v = Transcript::new(label);

0 commit comments

Comments
 (0)