Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add names to benchmarks #4

Merged
merged 1 commit into from
Dec 21, 2023
Merged
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
52 changes: 29 additions & 23 deletions macros/src/bench_tcurve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ macro_rules! bench_tcurve_point_add_prover_time {
let (cax, cay, cbx, cby, ctx, cty) =
<$config as PedersenConfig>::create_commitments_to_coords(a, b, t, &mut OsRng);

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

c.bench_function(concat!($curve_name, " point add verifier time"), |bf| {
bf.iter(|| {
let mut transcript_v = Transcript::new(label);
proof.verify(
&mut transcript_v,
&cax.comm,
&cay.comm,
&cbx.comm,
&cby.comm,
&ctx.comm,
&cty.comm,
);
});
});
c.bench_function(
concat!($curve_name, " CDLS point add verifier time"),
|bf| {
bf.iter(|| {
let mut transcript_v = Transcript::new(label);
proof.verify(
&mut transcript_v,
&cax.comm,
&cay.comm,
&cbx.comm,
&cby.comm,
&ctx.comm,
&cty.comm,
);
});
},
);
}
};
}
Expand Down Expand Up @@ -441,7 +444,7 @@ macro_rules! bench_tcurve_scalar_mul_prover_time {
let c2 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.x), &mut OsRng);
let c3 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.y), &mut OsRng);

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

c.bench_function(concat!($curve_name, " scalar mul verifier time"), |b| {
b.iter(|| {
proof.verify_proof(&OGENERATOR, &chal, &c1, &c2.comm, &c3.comm);
});
});
c.bench_function(
concat!($curve_name, " CDLS scalar mul verifier time"),
|b| {
b.iter(|| {
proof.verify_proof(&OGENERATOR, &chal, &c1, &c2.comm, &c3.comm);
});
},
);
}
};
}
Expand All @@ -551,7 +557,7 @@ macro_rules! bench_tcurve_fs_scalar_mul_prover_time {
let c3 = PC::new(<$config as PedersenConfig>::from_ob_to_sf(s.y), &mut OsRng);

c.bench_function(
concat!($curve_name, " fiat-shamir scalar mul prover time"),
concat!($curve_name, " CDLS fiat-shamir scalar mul prover time"),
|b| {
b.iter(|| {
let mut transcript = Transcript::new(label);
Expand Down Expand Up @@ -612,7 +618,7 @@ macro_rules! bench_tcurve_fs_scalar_mul_verifier_time {
);

c.bench_function(
concat!($curve_name, " fiat-shamir scalar mul verifier time"),
concat!($curve_name, " CDLS fiat-shamir scalar mul verifier time"),
|b| {
b.iter(|| {
let mut transcript_v = Transcript::new(label);
Expand Down
Loading