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
2d415307
Commit
2d415307
authored
Jan 21, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updat
parent
90bf3426
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
.gitignore
.gitignore
+1
-0
test_ASHE.cc
debug/test_ASHE.cc
+2
-2
random_insert.sh
packages/operation/random_insert.sh
+12
-0
reuse.cc
wrapper/reuse.cc
+1
-4
No files found.
.gitignore
View file @
2d415307
...
@@ -30,3 +30,4 @@ packages/tls/mysqlWrapper/createSelect
...
@@ -30,3 +30,4 @@ packages/tls/mysqlWrapper/createSelect
packages/tls/mysqlWrapper/main
packages/tls/mysqlWrapper/main
*allTables*
*allTables*
*pipelinefile*
*pipelinefile*
*.conf
debug/test_ASHE.cc
View file @
2d415307
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include "crypto/ASHE.hh"
#include "crypto/ASHE.hh"
#include "util/util.cc"
#include "util/util.cc"
int
main
(){
int
main
(){
const
int
num_of_tests
=
100
;
const
int
num_of_tests
=
32768
;
unsigned
int
seed
=
1u
;
unsigned
int
seed
=
1u
;
std
::
vector
<
unsigned
int
>
plain
;
std
::
vector
<
unsigned
int
>
plain
;
std
::
vector
<
RAW_ASHE
>
ass
;
std
::
vector
<
RAW_ASHE
>
ass
;
...
@@ -14,7 +14,7 @@ int main(){
...
@@ -14,7 +14,7 @@ int main(){
ass
.
push_back
(
RAW_ASHE
(
IV
));
ass
.
push_back
(
RAW_ASHE
(
IV
));
ass
.
back
().
encrypt
(
seed
,
IV
);
ass
.
back
().
encrypt
(
seed
,
IV
);
unsigned
int
res
=
ass
.
back
().
decrypt
(
ass
.
back
().
get_ciphertext
(),
IV
);
unsigned
int
res
=
ass
.
back
().
decrypt
(
ass
.
back
().
get_ciphertext
(),
IV
);
if
(
res
==
seed
)
std
::
cout
<<
"pass"
<<
std
::
endl
;
if
(
res
==
seed
)
;
else
std
::
cout
<<
"not pass!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
<<
std
::
endl
;
else
std
::
cout
<<
"not pass!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
<<
std
::
endl
;
seed
++
;
seed
++
;
}
}
...
...
packages/operation/random_insert.sh
View file @
2d415307
##echo $(rand 0 65535)
function
rand
(){
min
=
$1
max
=
$((
$2
-
$min
+
1
))
num
=
$((
$RANDOM
+
1000000000
))
#增加一个10位的数再求余
echo
$((
$num
%
$max
+
$min
))
}
##[0, 32767]
function
generate_insert_int
(){
function
generate_insert_int
(){
head
=
$1
head
=
$1
pipe
=
$2
pipe
=
$2
...
...
wrapper/reuse.cc
View file @
2d415307
...
@@ -387,7 +387,6 @@ STORE_STRATEGY currentStrategy = STORE_STRATEGY::ALL;
...
@@ -387,7 +387,6 @@ STORE_STRATEGY currentStrategy = STORE_STRATEGY::ALL;
/*storage used when we store*/
/*storage used when we store*/
void
storeStrategies
(
std
::
vector
<
FieldMetaTrans
>&
res
){
void
storeStrategies
(
std
::
vector
<
FieldMetaTrans
>&
res
){
if
(
currentStrategy
==
STORE_STRATEGY
::
FIRST
){
if
(
currentStrategy
==
STORE_STRATEGY
::
FIRST
){
std
::
vector
<
int
>
in
{
0
};
std
::
vector
<
int
>
in
{
0
};
for
(
auto
&
item
:
res
){
for
(
auto
&
item
:
res
){
...
@@ -410,10 +409,8 @@ void storeStrategies(std::vector<FieldMetaTrans>& res){
...
@@ -410,10 +409,8 @@ void storeStrategies(std::vector<FieldMetaTrans>& res){
static
const
std
::
vector
<
onion
>
onion_order
=
{
static
const
std
::
vector
<
onion
>
onion_order
=
{
oDET
,
oDET
,
oOPE
,
oOPE
,
oAGG
,
oASHE
,
oASHE
,
oSWP
,
oAGG
,
oPLAIN
};
};
int
getDecryptionOnionIndex
(
FieldMetaTrans
&
fdtrans
)
{
int
getDecryptionOnionIndex
(
FieldMetaTrans
&
fdtrans
)
{
...
...
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