diff options
author | wukong <rebirthmonkey@gmail.com> | 2015-11-23 17:48:48 +0100 |
---|---|---|
committer | wukong <rebirthmonkey@gmail.com> | 2015-11-23 17:48:48 +0100 |
commit | fca74d4bc3569506a6659880a89aa009dc11f552 (patch) | |
tree | 4cefd06af989608ea8ebd3bc6306889e2a1ad175 /moon-abe/pbc-0.5.14/benchmark/ellnet.c | |
parent | 840ac3ebca7af381132bf7e93c1e4c0430d6b16a (diff) |
moon-abe cleanup
Change-Id: Ie1259856db03f0b9e80de3e967ec6bd1f03191b3
Diffstat (limited to 'moon-abe/pbc-0.5.14/benchmark/ellnet.c')
-rw-r--r-- | moon-abe/pbc-0.5.14/benchmark/ellnet.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/moon-abe/pbc-0.5.14/benchmark/ellnet.c b/moon-abe/pbc-0.5.14/benchmark/ellnet.c deleted file mode 100644 index 8a866a65..00000000 --- a/moon-abe/pbc-0.5.14/benchmark/ellnet.c +++ /dev/null @@ -1,65 +0,0 @@ -#include <pbc.h> -#include "pbc_test.h" - -void time_pairing(pairing_ptr pairing) { - int i, n; - double t0, t1, ttotal, ttotalpp; - pairing_pp_t pp; - element_t x, y, r, r2; - element_init_G1(x, pairing); - element_init_G2(y, pairing); - element_init_GT(r, pairing); - element_init_GT(r2, pairing); - - n = 10; - ttotal = 0.0; - ttotalpp = 0.0; - for (i=0; i<n; i++) { - element_random(x); - element_random(y); - - pairing_pp_init(pp, x, pairing); - t0 = pbc_get_time(); - pairing_pp_apply(r, y, pp); - t1 = pbc_get_time(); - ttotalpp += t1 - t0; - pairing_pp_clear(pp); - - t0 = pbc_get_time(); - element_pairing(r2, x, y); - t1 = pbc_get_time(); - ttotal += t1 - t0; - - //element_printf("x = %B\n", x); - //element_printf("y = %B\n", y); - //element_printf("e(x,y) = %B\n", r); - if (element_cmp(r, r2)) { - printf("BUG!\n"); - exit(1); - } - } - printf("average pairing time = %f\n", ttotal / n); - printf("average pairing time (preprocessed) = %f\n", ttotalpp / n); - - element_clear(x); - element_clear(y); - element_clear(r); - element_clear(r2); -} - -int main(int argc, char **argv) { - pairing_t pairing; - - pbc_demo_pairing_init(pairing, argc, argv); - - printf("Miller's algorithm\n"); - time_pairing(pairing); - - pairing_option_set(pairing, "method", "shipsey-stange"); - printf("Shipsey-Stange algorithm\n"); - time_pairing(pairing); - - pairing_clear(pairing); - - return 0; -} |