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
be4ac6f6
Commit
be4ac6f6
authored
May 17, 2017
by
casualet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to show onion type and onion name
parent
9c93ef99
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
cdb_test.cc
main/cdb_test.cc
+15
-3
No files found.
main/cdb_test.cc
View file @
be4ac6f6
...
@@ -48,6 +48,8 @@ using std::cout;
...
@@ -48,6 +48,8 @@ using std::cout;
using
std
::
cin
;
using
std
::
cin
;
using
std
::
endl
;
using
std
::
endl
;
std
::
map
<
SECLEVEL
,
std
::
string
>
gmp
;
std
::
map
<
SECLEVEL
,
std
::
string
>
gmp
;
std
::
map
<
onion
,
std
::
string
>
gmp2
;
static
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
static
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
...
@@ -456,9 +458,10 @@ struct transField{
...
@@ -456,9 +458,10 @@ struct transField{
int
numOfOnions
;
int
numOfOnions
;
//onions
//onions
std
::
vector
<
std
::
string
>
fields
;
std
::
vector
<
std
::
string
>
fields
;
std
::
vector
<
onion
>
onions
;
void
show
(){
void
show
(){
for
(
auto
i
tem
:
fields
){
for
(
auto
i
=
0U
;
i
<
fields
.
size
();
i
++
){
cout
<<
item
<<
"
\t
"
;
cout
<<
fields
[
i
]
<<
" : "
<<
gmp2
[
onions
[
i
]]
<<
"
\t
"
;
}
}
cout
<<
endl
;
cout
<<
endl
;
if
(
hasSalt
){
if
(
hasSalt
){
...
@@ -475,6 +478,7 @@ static std::vector<transField> getTransField(std::vector<FieldMeta *> pfms){
...
@@ -475,6 +478,7 @@ static std::vector<transField> getTransField(std::vector<FieldMeta *> pfms){
for
(
std
::
pair
<
const
OnionMetaKey
*
,
OnionMeta
*>
&
ompair
:
pfm
->
orderedOnionMetas
()){
for
(
std
::
pair
<
const
OnionMetaKey
*
,
OnionMeta
*>
&
ompair
:
pfm
->
orderedOnionMetas
()){
tf
.
numOfOnions
++
;
tf
.
numOfOnions
++
;
tf
.
fields
.
push_back
((
ompair
.
second
)
->
getAnonOnionName
());
tf
.
fields
.
push_back
((
ompair
.
second
)
->
getAnonOnionName
());
tf
.
onions
.
push_back
(
ompair
.
first
->
getValue
());
}
}
if
(
pfm
->
getHasSalt
()){
if
(
pfm
->
getHasSalt
()){
tf
.
hasSalt
=
true
;
tf
.
hasSalt
=
true
;
...
@@ -965,6 +969,15 @@ main() {
...
@@ -965,6 +969,15 @@ main() {
gmp
[
SECLEVEL
::
HOM
]
=
"HOM"
;
gmp
[
SECLEVEL
::
HOM
]
=
"HOM"
;
gmp
[
SECLEVEL
::
RND
]
=
"RND"
;
gmp
[
SECLEVEL
::
RND
]
=
"RND"
;
gmp2
[
oDET
]
=
"oDET"
;
gmp2
[
oOPE
]
=
"oOPE"
;
gmp2
[
oAGG
]
=
"oAGG"
;
gmp2
[
oSWP
]
=
"oSWP"
;
gmp2
[
oPLAIN
]
=
"oPLAIN"
;
gmp2
[
oBESTEFFORT
]
=
"oBESTEFFORT"
;
gmp2
[
oINVALID
]
=
"oINVALID"
;
std
::
string
client
=
"192.168.1.1:1234"
;
std
::
string
client
=
"192.168.1.1:1234"
;
//one Wrapper per user.
//one Wrapper per user.
clients
[
client
]
=
new
WrapperState
();
clients
[
client
]
=
new
WrapperState
();
...
@@ -1008,7 +1021,6 @@ main() {
...
@@ -1008,7 +1021,6 @@ main() {
for
(
auto
&
item
:
res
){
for
(
auto
&
item
:
res
){
item
.
show
();
item
.
show
();
}
}
}
else
{
}
else
{
std
::
cout
<<
GREEN_BEGIN
<<
"curQuery: "
<<
curQuery
<<
"
\n
"
<<
COLOR_END
<<
std
::
endl
;
std
::
cout
<<
GREEN_BEGIN
<<
"curQuery: "
<<
curQuery
<<
"
\n
"
<<
COLOR_END
<<
std
::
endl
;
batchTogether
(
client
,
curQuery
,
_thread_id
);
batchTogether
(
client
,
curQuery
,
_thread_id
);
...
...
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