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
157ca8b4
Commit
157ca8b4
authored
Jan 18, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to use onion_order strategy for load
parent
cf942c69
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
loadtemp.cc
debug/loadtemp.cc
+1
-1
reuse.cc
wrapper/reuse.cc
+23
-3
reuse.hh
wrapper/reuse.hh
+1
-1
No files found.
debug/loadtemp.cc
View file @
157ca8b4
...
...
@@ -102,7 +102,7 @@ std::shared_ptr<ReturnMeta> getReturnMeta(std::vector<FieldMeta*> fms,
int
pos
=
0
;
//construct OLK
for
(
auto
i
=
0u
;
i
<
tfds
.
size
();
i
++
){
int
index
=
getDecryptionOnionIndex
(
tfds
);
int
index
=
getDecryptionOnionIndex
(
tfds
[
i
]
);
onion
o
=
tfds
[
i
].
getChoosenOnionO
()[
index
];
SECLEVEL
l
=
tfds
[
i
].
getOriginalFieldMeta
()
->
getOnionMeta
(
o
)
->
getSecLevel
();
FieldMeta
*
k
=
tfds
[
i
].
getOriginalFieldMeta
();
...
...
wrapper/reuse.cc
View file @
157ca8b4
#include "wrapper/reuse.hh"
#include <map>
using
std
::
cout
;
using
std
::
cin
;
using
std
::
endl
;
...
...
@@ -401,9 +402,28 @@ void storeStrategies(std::vector<FieldMetaTrans>& res){
}
int
getDecryptionOnionIndex
(
std
::
vector
<
FieldMetaTrans
>&
fdtrans
)
{
int
res
=
0
;
static
const
std
::
vector
<
onion
>
onion_order
=
{
oDET
,
oOPE
,
oAGG
,
oASHE
,
oSWP
,
oPLAIN
};
int
getDecryptionOnionIndex
(
FieldMetaTrans
&
fdtrans
)
{
int
res
=
-
1
;
auto
onionsO
=
fdtrans
.
getChoosenOnionO
();
std
::
map
<
onion
,
unsigned
int
>
onionIndexPair
;
for
(
unsigned
int
i
=
0u
;
i
<
onionsO
.
size
();
i
++
){
onionIndexPair
[
onionsO
[
i
]]
=
i
;
}
for
(
auto
item
:
onion_order
){
if
(
onionIndexPair
.
find
(
item
)
!=
onionIndexPair
.
end
()){
res
=
onionIndexPair
[
item
];
break
;
}
}
return
res
;
}
...
...
wrapper/reuse.hh
View file @
157ca8b4
...
...
@@ -153,4 +153,4 @@ enum class STORE_STRATEGY{
ALL
};
int
getDecryptionOnionIndex
(
std
::
vector
<
FieldMetaTrans
>&
re
s
);
int
getDecryptionOnionIndex
(
FieldMetaTrans
&
fdtran
s
);
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