main(int argc, char *argv[]){ /** Check the number of parameters */ if (argc < 5) { /** Tell the user how to run the program */ cerr << "Usage: " << argv[0] << " token encrows results num_threads" << endl; return 1; } mr_init_threading(); PFC pfc(AES_SECURITY); SecureSelect *db=NULL; int m=0; string query_name(argv[1]); string enctable_name(argv[2]); string results_name(argv[3]); int num_threads = atoi(argv[4]); db = new SecureSelect(&pfc,pfc.order()); if (!ifstream(query_name+"_ptok")){ cout << "Query file doesn't exist" << endl; return 0; } if (!ifstream(enctable_name+"_enc_msgs")){ cout << "Enctable file doesn't exist" << endl; return 0; } #ifdef VERBOSE int start = getMilliCount(); #endif int res_num = db->ApplyPTokenMT(query_name, enctable_name, results_name, num_threads); //int res_num = db->ApplyPToken(query_name, enctable_name, results_name); #ifdef VERBOSE int milliSecondsElapsed = getMilliSpan(start); cout << "\texec time " << milliSecondsElapsed << endl; #endif if(res_num >=0){ cout << res_num << " result(s) found" << endl; return 1; } else return 0; }
main(int argc, char *argv[]){ /** Check the number of parameters */ if (argc < 6) { /** Tell the user how to run the program */ cerr << "Usage: " << argv[0] << " key_file rows encrows noise num_threads" << endl; return 1; } /** Set the random seed for noise parameter generation */ srand(time(NULL)); mr_init_threading(); PFC pfc(AES_SECURITY); SecureSelect *db=NULL; int m=0; string key_file(argv[1]); string table_name(argv[2]); string enctable_name(argv[3]); int rand_lim = atoi(argv[4]); int num_threads = atoi(argv[5]); db = new SecureSelect(&pfc,pfc.order()); if(!db->LoadKey(key_file)) return 0; if(rand_lim<1){ cout << "Random paramter < 1, it has to be >= 1" << endl; return 0; } #ifdef VERBOSE int start = getMilliCount(); #endif db->EncryptRowsMT(table_name,enctable_name,rand_lim, num_threads); // db->EncryptRows(table_name,enctable_name,rand_lim); #ifdef VERBOSE int milliSecondsElapsed = getMilliSpan(start); cout << "\texec time " << milliSecondsElapsed << endl; #endif }