Skip to content

Commit

Permalink
More missing benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Mar 30, 2024
1 parent 0d1e82d commit a4b5c62
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions bench/bench_pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ static void arith1(void) {
}
BENCH_END;

BENCH_RUN("g1_mul_sec") {
bn_rand(k, RLC_POS, bn_bits(n));
bn_rand_mod(k, n);
g1_rand(p);
BENCH_ADD(g1_mul_sec(q, p, k));
}
BENCH_END;

BENCH_RUN("g1_mul_gen") {
bn_rand(k, RLC_POS, bn_bits(n));
bn_rand_mod(k, n);
Expand Down Expand Up @@ -468,6 +476,14 @@ static void arith2(void) {
}
BENCH_END;

BENCH_RUN("g2_mul_sec") {
bn_rand(k, RLC_POS, bn_bits(n));
bn_rand_mod(k, n);
g2_rand(p);
BENCH_ADD(g2_mul_sec(q, p, k));
}
BENCH_END;

BENCH_RUN("g2_mul_gen") {
bn_rand(k, RLC_POS, bn_bits(n));
bn_rand_mod(k, n);
Expand Down
2 changes: 1 addition & 1 deletion include/relic_pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ typedef RLC_CAT(RLC_GT_LOWER, t) gt_t;
* @param[in] P - the element to multiply.
* @param[in] K - the secret scalar.
*/
#define g2_mul_sec(R, P, K) RLC_CAT(RLC_G1_LOWER, mul_lwreg)(R, P, K)
#define g2_mul_sec(R, P, K) RLC_CAT(RLC_G2_LOWER, mul_lwreg)(R, P, K)

/**
* Multiplies an element from a larger group containing G_1 by a scalar.
Expand Down

0 comments on commit a4b5c62

Please sign in to comment.