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
da3ab97d
Commit
da3ab97d
authored
Jan 04, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to insert small data
parent
5fb9030d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
8 deletions
+44
-8
.gitignore
.gitignore
+2
-0
ASHE.cc
crypto/ASHE.cc
+23
-0
ASHE.hh
crypto/ASHE.hh
+2
-0
insert.sh
packages/operation/insert.sh
+14
-5
limit_pipe.sh
packages/operation/limit_pipe.sh
+3
-3
No files found.
.gitignore
View file @
da3ab97d
...
@@ -28,3 +28,5 @@ packages/tls/mysqlWrapper/backFieldsToFiles
...
@@ -28,3 +28,5 @@ packages/tls/mysqlWrapper/backFieldsToFiles
packages/tls/mysqlWrapper/createInsert
packages/tls/mysqlWrapper/createInsert
packages/tls/mysqlWrapper/createSelect
packages/tls/mysqlWrapper/createSelect
packages/tls/mysqlWrapper/main
packages/tls/mysqlWrapper/main
*allTables*
*pipelinefile*
crypto/ASHE.cc
View file @
da3ab97d
...
@@ -13,3 +13,26 @@ std::pair<long,uint64_t> ASHE::encrypt(unsigned long plaintext){
...
@@ -13,3 +13,26 @@ std::pair<long,uint64_t> ASHE::encrypt(unsigned long plaintext){
unsigned
long
ASHE
::
decrypt
(
long
ciphertext
){
unsigned
long
ASHE
::
decrypt
(
long
ciphertext
){
return
(
ciphertext
+
bf
.
encrypt
(
IV
)
-
bf
.
encrypt
(
IV
-
1
))
%
ASHE_MAX
;
return
(
ciphertext
+
bf
.
encrypt
(
IV
)
-
bf
.
encrypt
(
IV
-
1
))
%
ASHE_MAX
;
}
}
/*Cannot declare member function ...to have static linkage*/
std
::
pair
<
long
,
std
::
vector
<
uint64_t
>>
ASHE
::
sum
(
std
::
vector
<
std
::
pair
<
long
,
uint64_t
>>
input
){
std
::
vector
<
uint64_t
>
IVs
;
long
res
=
0
;
for
(
auto
&
item
:
input
){
res
+=
item
.
first
;
IVs
.
push_back
(
item
.
second
);
}
return
std
::
make_pair
(
res
,
IVs
);
}
unsigned
long
ASHE
::
decrypt_sum
(
std
::
pair
<
long
,
std
::
vector
<
uint64_t
>>
input
){
long
res
=
input
.
first
;
for
(
auto
item
:
input
.
second
){
item
++
;
res
++
;
}
return
res
;
}
crypto/ASHE.hh
View file @
da3ab97d
...
@@ -12,4 +12,6 @@ public:
...
@@ -12,4 +12,6 @@ public:
std
::
pair
<
long
,
uint64_t
>
encrypt
(
unsigned
long
plaintext
);
std
::
pair
<
long
,
uint64_t
>
encrypt
(
unsigned
long
plaintext
);
int
getIV
();
int
getIV
();
unsigned
long
decrypt
(
long
ciphertext
);
unsigned
long
decrypt
(
long
ciphertext
);
static
std
::
pair
<
long
,
std
::
vector
<
uint64_t
>>
sum
(
std
::
vector
<
std
::
pair
<
long
,
uint64_t
>>
input
);
static
unsigned
long
decrypt_sum
(
std
::
pair
<
long
,
std
::
vector
<
uint64_t
>>
input
);
};
};
packages/operation/insert.sh
View file @
da3ab97d
files
=
`
find ~/Insert/
-type
f
`
dir
=
"~/Insert/"
arrayfiles
=(
$files
)
cur_dir
=
`
pwd
`
cdb_test_dir
=
"../../"
target_db
=
"tdb2"
cd
${
cdb_test_dir
}
#IFS=' ' read -r -a arrayfiles <<< "$files"
if
[
$#=
1
]
;
then
dir
=
${
cur_dir
}
/
$1
fi
files
=
`
find
${
dir
}
-type
f
`
arrayfiles
=(
$files
)
for
data
in
${
arrayfiles
[@]
}
for
data
in
${
arrayfiles
[@]
}
do
do
ss
=
"
cdb_test tpcc1000
<
$data
"
ss
=
"
./obj/main/cdb_test
${
target_db
}
<
$data
"
eval
$ss
##
eval $ss
echo
$ss
echo
$ss
done
done
packages/operation/limit_pipe.sh
View file @
da3ab97d
#backup data with limited pipecount
#backup data with limited pipecount
current_dir
=
`
pwd
`
current_dir
=
`
pwd
`
db
=
t
pcc1000
db
=
t
db2
pipe
=
100
pipe
=
100
tables
=
`
mysql
-
uroot
-
h127
.0.0.1
-P3306
$db
-e
"show tables"
|
awk
'{print $1}'
`
tables
=
`
mysql
-h127
.0.0.1
-P3306
$db
-e
"show tables"
|
awk
'{print $1}'
`
table_array
=(
$tables
)
table_array
=(
$tables
)
len
=
${#
table_array
[@]
}
len
=
${#
table_array
[@]
}
back_dir
=
pipe_
$pipe
back_dir
=
pipe
linefile
_
$pipe
rm
-rf
$back_dir
rm
-rf
$back_dir
mkdir
$back_dir
mkdir
$back_dir
cd
../tls/mysql_wrapper/
cd
../tls/mysql_wrapper/
...
...
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