Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ppann
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boston University PhD
IPFRE
ppann
Commits
b4f90eee
Commit
b4f90eee
authored
Apr 9, 2023
by
Weiqi
Browse files
Options
Downloads
Patches
Plain Diff
Refactor scheme
parent
a5531328
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/app.cpp
+27
-1
27 additions, 1 deletion
apps/app.cpp
src/ipre.cpp
+1
-1
1 addition, 1 deletion
src/ipre.cpp
tests/test_ipre.cpp
+4
-4
4 additions, 4 deletions
tests/test_ipre.cpp
with
32 additions
and
6 deletions
apps/app.cpp
+
27
−
1
View file @
b4f90eee
#include
<iostream>
#include
"ipre.h"
using
namespace
std
;
int
main
()
{
cout
<<
"Hello from app."
<<
endl
;
cout
<<
"Testing in the app."
<<
endl
;
// Init core and setup.
core_init
();
pc_param_set_any
();
// Testing.
g
base
,
test_value
;
gen
(
base
);
g1_mul_dig
(
test_value
,
base
,
2
);
g
table
[
200
];
cout
<<
RLC_EP_TABLE_MAX
<<
endl
<<
endl
;
g1_mul_pre
(
table
,
base
);
g1_print
(
table
[
0
]);
cout
<<
endl
;
g1_print
(
table
[
1
]);
cout
<<
endl
;
g1_print
(
table
[
2
]);
cout
<<
endl
;
g1_print
(
test_value
);
cout
<<
endl
;
cout
<<
(
g1_cmp
(
table
[
9
],
test_value
)
==
RLC_EQ
)
<<
endl
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/ipre.cpp
+
1
−
1
View file @
b4f90eee
...
...
@@ -58,7 +58,7 @@ int eval(key key, ct x, ct y, int size, int bound) {
gt_inv
(
ct
,
ct
);
gt_mul
(
xy
,
xy
,
ct
);
// Get a
G_t
element holder.
// Get a
target group
element holder.
gt
output
;
// Iterate through a loop to find correct answer.
...
...
This diff is collapsed.
Click to expand it.
tests/test_ipre.cpp
+
4
−
4
View file @
b4f90eee
...
...
@@ -2,17 +2,17 @@
int
test_scheme
()
{
// Set x, y vectors.
int
x
[]
=
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
};
int
y
[]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
int
x
[]
=
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
};
int
y
[]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
00
};
// Initialize the scheme.
key
key
=
setup
(
10
);
// Encrypt the messages.
ct
ct_x
=
enc
(
key
,
x
,
10
);
ct
ct_y
=
enc
(
key
,
y
,
10
);
// Evaluate the two ciphertexts.
int
output
=
eval
(
key
,
ct_x
,
ct_y
,
10
,
1
00
);
int
output
=
eval
(
key
,
ct_x
,
ct_y
,
10
,
50
00
);
return
output
==
6
5
;
return
output
==
104
5
;
}
int
main
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment