Skip to content
Snippets Groups Projects
Commit 52764ee1 authored by Weiqi's avatar Weiqi
Browse files

Update test

parent 92dfe3c1
Branches
No related tags found
No related merge requests found
#include "asym_group.h" #include "asym_group.h"
#include "relic_sym/relic.h"
int test_all(bn_st *N) {
// Set integers.
ZP_ASYM a = zp_from_int(5, N);
ZP_ASYM b = zp_from_int(6, N);
ZP_ASYM c = zp_from_int(30, N);
// Declare variables.
g1_asym j, k;
g2_asym m, n;
gt_asym x, y, z;
core_init();
//int test_all(bn_st *N) {
// // Set integers.
// ZP_ASYM a = zp_from_int(5, N);
// ZP_ASYM b = zp_from_int(6, N);
// ZP_ASYM c = zp_from_int(30, N);
// //
g1_gen(j); // // Declare variables.
g2_gen(m); // g1_asym j, k;
// g2_asym m, n;
asym_bn_t test; // gt_asym x, y, z;
asym_bn_set_dig(test, 20); //
// //
// g1_gen(j);
g1_mul(k, j, test); // g2_gen(m);
//
// asym_bn_t test;
// Compare e(g_sym^5, g_sym^5) with e(g_sym, g_sym)^25. // asym_bn_set_dig(test, 20);
return RLC_EQ; //
} // g1_mul(k, j, test);
//
//
// // Compare e(g_sym^5, g_sym^5) with e(g_sym, g_sym)^25.
// return RLC_EQ;
//}
int main() { int main() {
core_clean(); core_clean();
asym_core_clean();
// Init core and setup. // Init core and setup.
asym_core_init(); core_init();
asym_pc_core_init();
pc_param_set_any(); pc_param_set_any();
g1_asym p;
g1_new(p);
g1_get_gen(p);
// Get order. // Get order.
bn_t N; // bn_t N;
pc_get_ord(N); // pc_get_ord(N);
// Perform tests. // Perform tests.
if (test_all(N) != RLC_EQ) return 1; // if (test_all(N) != RLC_EQ) return 1;
return 0; return 0;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment