Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
8c6635c3
Commit
8c6635c3
authored
May 18, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
5398e211
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
91 deletions
+3
-91
bench_layer_ASHE.cc
test_enclayers/bench_layer_ASHE.cc
+1
-11
bench_layer_DET_str.cc
test_enclayers/bench_layer_DET_str.cc
+1
-34
bench_layer_HOM.cc
test_enclayers/bench_layer_HOM.cc
+0
-41
bench_layer_OPE_int.cc
test_enclayers/bench_layer_OPE_int.cc
+1
-1
bench_layer_OPE_str.cc
test_enclayers/bench_layer_OPE_str.cc
+0
-4
No files found.
test_enclayers/bench_layer_ASHE.cc
View file @
8c6635c3
...
...
@@ -96,9 +96,7 @@ main(int argc,char** argv) {
std
::
string
key
=
"key"
;
Create_field
*
cf
=
NULL
;
ASHE
*
as
=
new
ASHE
(
*
cf
,
key
);
int
num_of_tests
=
10000
;
if
(
argc
==
2
){
num_of_tests
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
}
else
{
...
...
@@ -106,27 +104,19 @@ main(int argc,char** argv) {
return
0
;
}
Item
*
plain
=
getItemInt
(
"123456789"
);
std
::
cout
<<
"num_of_tests: "
<<
num_of_tests
<<
std
::
endl
;
std
::
cout
<<
"num_of_tests: "
<<
num_of_tests
<<
std
::
endl
;
Item
*
enc
=
NULL
;
Item
*
dec
=
NULL
;
timer
t
;
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
)
{
enc
=
as
->
encrypt
(
*
plain
,
0u
);
}
std
::
cout
<<
"ENC_ASHE_IN_us: "
<<
t
.
lap
()
*
1.0
/
num_of_tests
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
)
{
dec
=
as
->
decrypt
(
*
enc
,
0u
);
}
std
::
cout
<<
"DEC_ASHE_IN_us: "
<<
t
.
lap
()
*
1.0
/
num_of_tests
<<
std
::
endl
;
(
void
)
dec
;
return
0
;
}
//main/schema.cc:83 is use to create layers of encryption
test_enclayers/bench_layer_DET_str.cc
View file @
8c6635c3
...
...
@@ -31,10 +31,8 @@ static std::map<std::string, WrapperState*> clients;
//This connection mimics the behaviour of MySQL-Proxy
Connect
*
globalConn
;
/*for each field, convert the format to FieldMeta_Wrapper*/
static
void
init
(){
std
::
string
client
=
"192.168.1.1:1234"
;
//one Wrapper per user.
...
...
@@ -66,38 +64,6 @@ getItemString(std::string input) {
}
/*
static
Item *
getItemInt(std::string input) {
return new (current_thd->mem_root)
Item_int(static_cast<ulonglong>(valFromStr(input)));
}
static
Item *
getItemString(std::string input) {
return MySQLFieldTypeToItem(MYSQL_TYPE_STRING, input);
}
static
Create_field* getStringField(int length) {
Create_field *f = new Create_field;
f->sql_type = MYSQL_TYPE_VARCHAR;
f->length = length;
return f;
}
static
Create_field* getUnsignedIntField(){
Create_field *f = new Create_field;
f->sql_type = MYSQL_TYPE_LONG;
f->flags |= UNSIGNED_FLAG;
return f;
}
*/
static
void
control
(
DET_str
*
ds
,
Item
*
plain
,
int
num_of_tests
,
int
length
)
{
Item
*
enc
=
NULL
;
...
...
@@ -137,6 +103,7 @@ main(int argc,char**argv) {
std
::
cout
<<
"num_of_tests:length"
<<
std
::
endl
;
return
0
;
}
for
(
int
i
=
1
;
i
<=
100
;
i
++
)
{
std
::
string
input
=
ggetpRandomName
(
length
*
i
);
Item
*
plain
=
getItemString
(
input
)
;
...
...
test_enclayers/bench_layer_HOM.cc
View file @
8c6635c3
...
...
@@ -25,16 +25,10 @@ using std::vector;
using
std
::
string
;
using
std
::
to_string
;
static
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
static
std
::
map
<
std
::
string
,
WrapperState
*>
clients
;
//This connection mimics the behaviour of MySQL-Proxy
Connect
*
globalConn
;
/*for each field, convert the format to FieldMeta_Wrapper*/
static
void
init
(){
std
::
string
client
=
"192.168.1.1:1234"
;
//one Wrapper per user.
...
...
@@ -57,37 +51,12 @@ static void init(){
//Connect end!!
globalConn
=
new
Connect
(
ci
.
server
,
ci
.
user
,
ci
.
passwd
,
ci
.
port
);
}
static
Item
*
getItemInt
(
std
::
string
input
)
{
return
new
(
current_thd
->
mem_root
)
Item_int
(
static_cast
<
ulonglong
>
(
valFromStr
(
input
)));
}
/*
static
Item *
getItemString(std::string input) {
return MySQLFieldTypeToItem(MYSQL_TYPE_STRING, input);
}
static
Create_field* getStringField(int length) {
Create_field *f = new Create_field;
f->sql_type = MYSQL_TYPE_VARCHAR;
f->length = length;
return f;
}
static
Create_field* getUnsignedIntField(){
Create_field *f = new Create_field;
f->sql_type = MYSQL_TYPE_LONG;
f->flags |= UNSIGNED_FLAG;
return f;
}
*/
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -96,7 +65,6 @@ main(int argc,char**argv) {
std
::
string
key
=
"key"
;
Create_field
*
cf
=
NULL
;
HOM
*
hm
=
new
HOM
(
*
cf
,
key
);
int
num_of_tests
=
10000
;
if
(
argc
==
2
){
num_of_tests
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
...
...
@@ -107,25 +75,16 @@ main(int argc,char**argv) {
Item
*
plain
=
getItemInt
(
"123456789"
);
Item
*
enc
=
NULL
;
Item
*
dec
=
NULL
;
std
::
cout
<<
"num_of_tests: "
<<
num_of_tests
<<
std
::
endl
;
timer
t
;
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
)
{
enc
=
hm
->
encrypt
(
*
plain
,
0u
);
}
std
::
cout
<<
"HOM_ENC_IN_us: "
<<
t
.
lap
()
*
1.0
/
num_of_tests
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
)
{
dec
=
hm
->
decrypt
(
*
enc
,
0u
);
}
std
::
cout
<<
"HOM_DEC_IN_us: "
<<
t
.
lap
()
*
1.0
/
num_of_tests
<<
std
::
endl
;
(
void
)
dec
;
return
0
;
}
//main/schema.cc:83 is use to create layers of encryption
test_enclayers/bench_layer_OPE_int.cc
View file @
8c6635c3
...
...
@@ -113,7 +113,7 @@ main(int argc,char** argv) {
if
(
argc
==
2
){
num_of_tests
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
}
else
{
std
::
cout
<<
"num_of_tests
:length
"
<<
std
::
endl
;
std
::
cout
<<
"num_of_tests"
<<
std
::
endl
;
return
0
;
}
...
...
test_enclayers/bench_layer_OPE_str.cc
View file @
8c6635c3
...
...
@@ -118,10 +118,8 @@ main(int argc,char** argv) {
std
::
string
key
=
"key"
;
Create_field
*
cf
=
NULL
;
OPE_str
*
op
=
new
OPE_str
(
*
cf
,
key
);
int
num_of_tests
=
10000
;
int
length
=
16
;
if
(
argc
==
3
){
num_of_tests
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
length
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
...
...
@@ -135,8 +133,6 @@ main(int argc,char** argv) {
Item
*
plain
=
getItemString
(
input
);
control
(
op
,
plain
,
num_of_tests
,
length
*
i
);
}
return
0
;
}
//main/schema.cc:83 is use to create layers of encryption
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment