Skip to content

Commit

Permalink
Merge pull request #271 from relic-toolkit/kss16
Browse files Browse the repository at this point in the history
Large patch adding faster Legendre symbol computation, hashing to curves and more pairing-friendly families.
  • Loading branch information
dfaranha authored Aug 22, 2023
2 parents 38737da + dda4844 commit ce5e121
Show file tree
Hide file tree
Showing 197 changed files with 24,576 additions and 3,992 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.5)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.1")
cmake_policy(SET CMP0054 NEW)
endif()
Expand Down
31 changes: 31 additions & 0 deletions bench/bench_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ static void arith(void) {
BENCH_ADD(ep_mul_gen(q, k));
} BENCH_END;

BENCH_RUN("ep_mul_cof") {
ep_rand(p);
BENCH_ADD(ep_mul_cof(q, p));
} BENCH_END;

BENCH_RUN("ep_mul_dig") {
bn_rand(k, RLC_POS, RLC_DIG);
bn_rand_mod(k, n);
Expand Down Expand Up @@ -575,6 +580,32 @@ static void arith(void) {
BENCH_ADD(ep_map(p, msg, 5));
} BENCH_END;

#if EP_MAP == BASIC || !defined(STRIP)
BENCH_RUN("ep_map_basic") {
uint8_t msg[5];
rand_bytes(msg, 5);
BENCH_ADD(ep_map_basic(p, msg, 5));
} BENCH_END;
#endif

#if EP_MAP == SSWUM || !defined(STRIP)
BENCH_RUN("ep_map_sswum") {
uint8_t msg[5];
rand_bytes(msg, 5);
BENCH_ADD(ep_map_sswum(p, msg, 5));
} BENCH_END;
#endif

#if EP_MAP == SWIFT || !defined(STRIP)
if (ep_curve_opt_a() == RLC_ZERO || ep_curve_opt_b() == RLC_ZERO) {
BENCH_RUN("ep_map_swift") {
uint8_t msg[5];
rand_bytes(msg, 5);
BENCH_ADD(ep_map_swift(p, msg, 5));
} BENCH_END;
}
#endif

BENCH_RUN("ep_pck") {
ep_rand(p);
BENCH_ADD(ep_pck(q, p));
Expand Down
Loading

0 comments on commit ce5e121

Please sign in to comment.