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
ed546ca9
Unverified
Commit
ed546ca9
authored
Aug 14, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3087
parent
d0c753aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
15 deletions
+32
-15
intel-sgx-ssl
intel-sgx-ssl
+1
-1
libBLS
libBLS
+1
-1
linux-sgx-driver
linux-sgx-driver
+1
-1
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+28
-11
EnclaveCommon.h
secure_enclave/EnclaveCommon.h
+1
-1
No files found.
intel-sgx-ssl
@
8dc9f547
Subproject commit
f980b79f086b27b187bb696de1d7b99a0988859b
Subproject commit
8dc9f547c612010ea0b6257d86bcbd4ff7149565
libBLS
@
78ea56c3
Subproject commit
6c863ecc15eb5580e469f6b7f59817fdd08da1d1
Subproject commit
78ea56c3b5251e9d840ef65705bb2c5f8f193662
linux-sgx-driver
@
95eaa6f6
Subproject commit
b0a445ba09e96e1d0507487e5c496485a9cf3742
Subproject commit
95eaa6f6693cd86c35e10a22b4f8e483373c987c
secure_enclave/EnclaveCommon.cpp
View file @
ed546ca9
...
...
@@ -43,7 +43,7 @@ uint8_t *getThreadLocalDecryptedDkgPoly() {
}
string
*
stringFromKey
(
libff
::
alt_bn128_Fr
*
_key
)
{
string
*
stringFromKey
(
libff
::
alt_bn128_Fr
*
_key
)
{
string
*
ret
=
nullptr
;
mpz_t
t
;
mpz_init
(
t
);
...
...
@@ -55,8 +55,11 @@ string *stringFromKey(libff::alt_bn128_Fr *_key) {
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
t
);
if
(
!
tmp
)
{
LOG_ERROR
(
"stringFromKey: mpz_get_str failed"
);
goto
clean
;
}
ret
=
new
string
(
tmp
);
goto
clean
;
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
goto
clean
;
...
...
@@ -78,9 +81,7 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
SAFE_CHAR_BUF
(
arr
,
BUF_LEN
);
try
{
_fq
->
as_bigint
().
to_mpz
(
t
);
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
tmp
);
}
catch
(
exception
&
e
)
{
...
...
@@ -98,27 +99,43 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
string
*
stringFromG1
(
libff
::
alt_bn128_G1
*
_g1
)
{
string
*
sX
=
nullptr
;
string
*
sY
=
nullptr
;
string
*
ret
=
nullptr
;
try
{
_g1
->
to_affine_coordinates
();
auto
sX
=
stringFromFq
(
&
_g1
->
X
);
auto
sY
=
stringFromFq
(
&
_g1
->
Y
);
auto
sG1
=
new
string
(
*
sX
+
":"
+
*
sY
);
if
(
!
sX
)
{
goto
clean
;
}
delete
(
sX
);
delete
(
sY
);
auto
sY
=
stringFromFq
(
&
_g1
->
Y
);
return
sG1
;
if
(
!
sY
)
{
goto
clean
;
}
ret
=
new
string
(
*
sX
+
":"
+
*
sY
);
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
return
nullptr
;
goto
clean
;
}
catch
(...)
{
LOG_ERROR
(
"Unknown throwable"
);
return
nullptr
;
goto
clean
;
}
clean:
SAFE_FREE
(
sX
);
SAFE_FREE
(
sY
);
return
ret
;
}
libff
::
alt_bn128_Fr
*
keyFromString
(
const
char
*
_keyStringHex
)
{
...
...
secure_enclave/EnclaveCommon.h
View file @
ed546ca9
...
...
@@ -64,7 +64,7 @@ extern unsigned char* globalRandom;
extern
domain_parameters
curve
;
#define SAFE_FREE(__X__) if (
!
__X__) {free(__X__); __X__ = NULL;}
#define SAFE_FREE(__X__) if (__X__) {free(__X__); __X__ = NULL;}
#define SAFE_CHAR_BUF(__X__, __Y__) ;char __X__ [ __Y__ ]; memset(__X__, 0, __Y__);
...
...
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