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
8c5e06bf
Commit
8c5e06bf
authored
May 17, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test bench_pailliar
parent
06de6245
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
bench_pailliar.cc
test_crypto/bench_pailliar.cc
+46
-0
No files found.
test_crypto/bench_pailliar.cc
0 → 100644
View file @
8c5e06bf
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include "main/CryptoHandlers.hh"
#include "crypto/arc4.hh"
#include "util/timer.hh"
#include "util/util.hh"
#include <NTL/ZZ.h>
using
std
::
cout
;
using
std
::
cin
;
using
std
::
endl
;
using
std
::
vector
;
using
std
::
string
;
using
std
::
to_string
;
using
namespace
NTL
;
static
void
test_pailliar
(
int
num_of_tests
)
{
Paillier_priv
*
sk
;
uint
nbits
=
1024
;
const
std
::
unique_ptr
<
streamrng
<
arc4
>>
prng
(
new
streamrng
<
arc4
>
(
"123456"
));
sk
=
new
Paillier_priv
(
Paillier_priv
::
keygen
(
prng
.
get
(),
nbits
));
ZZ
pt0
=
NTL
::
to_ZZ
(
1
);
ZZ
enc0
;
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
){
enc0
=
sk
->
encrypt
(
pt0
);
}
for
(
int
i
=
0
;
i
<
num_of_tests
;
i
++
){
const
ZZ
dec0
=
sk
->
decrypt
(
enc0
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
test_pailliar
(
100
);
return
0
;
}
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