Commit a60fdd50 authored by yiwenshao's avatar yiwenshao

add bench

parent 4e799185
......@@ -14,7 +14,6 @@
int
main(int argc,char**argv){
RAW_ASHE ashe(1);
int num_of_tests = 10000;
if(argc==2){
......@@ -23,21 +22,16 @@ main(int argc,char**argv){
std::cout<<"num_of_tests"<<std::endl;
return 0;
}
unsigned int pt = 1u;
timer t;
std::pair<long,uint64_t> res;
for(int i=0;i<num_of_tests;i++) {
res = ashe.encrypt(pt,0);
}
std::cout<<"enc_ashe_in_us: "<<t.lap()*1.0/num_of_tests<<std::endl;
for(int i=0;i<num_of_tests;i++) {
ashe.decrypt(res.first,0);
}
std::cout<<"dec_ashe_in_us: "<<t.lap()*1.0/num_of_tests<<std::endl;
return 0;
}
#include <vector>
#include "util/errstream.hh"
#include "crypto/search.hh"
static void
test_search(int num_of_tests,int len){
search_priv s("my key");
std::string input = std::string(len,'a');
auto cl = s.transform({"hexxxxxxxxxxxxxxxxxxxllo", "world", input});
std::cout<<cl.size()<<std::endl;
}
int main(){
test_search(10,8);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment