Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
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
董子豪
sgxwallet
Commits
df1446d5
Unverified
Commit
df1446d5
authored
May 11, 2021
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4162 add check point is in G2
parent
49262e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
DKGUtils.cpp
secure_enclave/DKGUtils.cpp
+9
-0
No files found.
secure_enclave/DKGUtils.cpp
View file @
df1446d5
...
@@ -174,6 +174,11 @@ vector <libff::alt_bn128_Fr> SplitStringToFr(const char *coeffs, const char symb
...
@@ -174,6 +174,11 @@ vector <libff::alt_bn128_Fr> SplitStringToFr(const char *coeffs, const char symb
return
result
;
return
result
;
}
}
bool
isG2
(
const
libff
::
alt_bn128_G2
&
point
)
{
return
point
.
is_well_formed
()
&&
libff
::
alt_bn128_G2
::
order
()
*
point
==
libff
::
alt_bn128_G2
::
zero
();
}
int
gen_dkg_poly
(
char
*
secret
,
unsigned
_t
)
{
int
gen_dkg_poly
(
char
*
secret
,
unsigned
_t
)
{
int
status
=
1
;
int
status
=
1
;
...
@@ -456,6 +461,10 @@ int Verification(char *public_shares, mpz_t decr_secret_share, int _t, int ind)
...
@@ -456,6 +461,10 @@ int Verification(char *public_shares, mpz_t decr_secret_share, int _t, int ind)
pub_share
.
Y
.
c1
=
libff
::
alt_bn128_Fq
(
y_c1_str
.
c_str
());
pub_share
.
Y
.
c1
=
libff
::
alt_bn128_Fq
(
y_c1_str
.
c_str
());
pub_share
.
Z
=
libff
::
alt_bn128_Fq2
::
one
();
pub_share
.
Z
=
libff
::
alt_bn128_Fq2
::
one
();
if
(
!
isG2
(
pub_share
)
)
{
ret
=
3
;
return
ret
;
}
pub_shares
.
push_back
(
pub_share
);
pub_shares
.
push_back
(
pub_share
);
}
}
...
...
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