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
5a424dff
Commit
5a424dff
authored
Jan 17, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
need to debug the ASHE_RAW algorithm, the overall process is finished
parent
0822f1ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
CryptoHandlers.cc
main/CryptoHandlers.cc
+6
-4
CryptoHandlers.hh
main/CryptoHandlers.hh
+1
-1
No files found.
main/CryptoHandlers.cc
View file @
5a424dff
...
@@ -1825,7 +1825,8 @@ ASHE::newCreateField(const Create_field &cf,
...
@@ -1825,7 +1825,8 @@ ASHE::newCreateField(const Create_field &cf,
// if (charset != NULL) {
// if (charset != NULL) {
// f0->charset = charset;
// f0->charset = charset;
// }
// }
f0
->
flags
=
f0
->
flags
^
UNSIGNED_FLAG
;
f0
->
sql_type
=
MYSQL_TYPE_LONGLONG
;
if
(
anonname
.
size
()
>
0
)
{
if
(
anonname
.
size
()
>
0
)
{
f0
->
field_name
=
make_thd_string
(
anonname
);
f0
->
field_name
=
make_thd_string
(
anonname
);
}
}
...
@@ -1836,17 +1837,18 @@ ASHE::newCreateField(const Create_field &cf,
...
@@ -1836,17 +1837,18 @@ ASHE::newCreateField(const Create_field &cf,
Item
*
Item
*
ASHE
::
encrypt
(
const
Item
&
ptext
,
uint64_t
IV
)
const
{
ASHE
::
encrypt
(
const
Item
&
ptext
,
uint64_t
IV
)
const
{
ulonglong
pt
=
const_cast
<
Item
&>
(
ptext
).
val_uint
();
ulonglong
pt
=
const_cast
<
Item
&>
(
ptext
).
val_uint
();
auto
res
=
ashe
.
encrypt
(
pt
,
IV
);
return
new
(
current_thd
->
mem_root
)
return
new
(
current_thd
->
mem_root
)
Item_int
(
static_cast
<
ulonglong
>
(
p
t
));
Item_int
(
static_cast
<
longlong
>
(
res
.
firs
t
));
}
}
Item
*
Item
*
ASHE
::
decrypt
(
const
Item
&
ctext
,
uint64_t
IV
)
const
ASHE
::
decrypt
(
const
Item
&
ctext
,
uint64_t
IV
)
const
{
{
long
long
ct
=
const_cast
<
Item
&>
(
ctext
).
val_uint
();
long
long
ct
=
const_cast
<
Item
&>
(
ctext
).
val_uint
();
auto
res
=
ashe
.
decrypt
(
ct
,
IV
);
return
new
(
current_thd
->
mem_root
)
return
new
(
current_thd
->
mem_root
)
Item_int
(
static_cast
<
ulonglong
>
(
ct
));
Item_int
(
static_cast
<
ulonglong
>
(
res
));
}
}
ASHE
::~
ASHE
()
{
ASHE
::~
ASHE
()
{
...
...
main/CryptoHandlers.hh
View file @
5a424dff
...
@@ -139,7 +139,7 @@ public:
...
@@ -139,7 +139,7 @@ public:
Item
*
decrypt
(
const
Item
&
c
,
uint64_t
IV
)
const
;
Item
*
decrypt
(
const
Item
&
c
,
uint64_t
IV
)
const
;
protected
:
protected
:
std
::
string
const
seed_key
;
std
::
string
const
seed_key
;
const
RAW_ASHE
ashe
;
mutable
RAW_ASHE
ashe
;
};
};
...
...
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