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
1b059402
Unverified
Commit
1b059402
authored
Nov 09, 2020
by
Stan Kladko
Committed by
GitHub
Nov 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'SECURE_ENCLAVE_CHANGES' into bug/SKALE-3480-remove-set-dkg-poly
parents
178bc543
c6c828a9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+9
-9
secure_enclave.c
secure_enclave/secure_enclave.c
+0
-2
testw.cpp
testw.cpp
+1
-1
No files found.
secure_enclave/EnclaveCommon.cpp
View file @
1b059402
...
@@ -82,8 +82,8 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
...
@@ -82,8 +82,8 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
try
{
try
{
_fq
->
as_bigint
().
to_mpz
(
t
);
_fq
->
as_bigint
().
to_mpz
(
t
);
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
t
);
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
tmp
);
ret
=
new
string
(
arr
);
}
catch
(
exception
&
e
)
{
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
LOG_ERROR
(
e
.
what
());
goto
clean
;
goto
clean
;
...
@@ -107,13 +107,13 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
...
@@ -107,13 +107,13 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
try
{
try
{
_g1
->
to_affine_coordinates
();
_g1
->
to_affine_coordinates
();
auto
sX
=
stringFromFq
(
&
_g1
->
X
);
sX
=
stringFromFq
(
&
_g1
->
X
);
if
(
!
sX
)
{
if
(
!
sX
)
{
goto
clean
;
goto
clean
;
}
}
auto
sY
=
stringFromFq
(
&
_g1
->
Y
);
sY
=
stringFromFq
(
&
_g1
->
Y
);
if
(
!
sY
)
{
if
(
!
sY
)
{
goto
clean
;
goto
clean
;
...
@@ -131,8 +131,8 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
...
@@ -131,8 +131,8 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
clean:
clean:
SAFE_
FRE
E
(
sX
);
SAFE_
DELET
E
(
sX
);
SAFE_
FRE
E
(
sY
);
SAFE_
DELET
E
(
sY
);
return
ret
;
return
ret
;
...
@@ -226,7 +226,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
...
@@ -226,7 +226,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
}
}
try
{
try
{
auto
key
=
keyFromString
(
_keyString
);
key
=
keyFromString
(
_keyString
);
if
(
!
key
)
{
if
(
!
key
)
{
LOG_ERROR
(
"Null key"
);
LOG_ERROR
(
"Null key"
);
...
@@ -243,7 +243,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
...
@@ -243,7 +243,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
sign
.
to_affine_coordinates
();
sign
.
to_affine_coordinates
();
auto
r
=
stringFromG1
(
&
sign
);
r
=
stringFromG1
(
&
sign
);
memset
(
sig
,
0
,
BUF_LEN
);
memset
(
sig
,
0
,
BUF_LEN
);
...
...
secure_enclave/secure_enclave.c
View file @
1b059402
...
@@ -1127,8 +1127,6 @@ trustedGetBlsPubKey(int *errStatus, char *errString, uint8_t *encryptedPrivateKe
...
@@ -1127,8 +1127,6 @@ trustedGetBlsPubKey(int *errStatus, char *errString, uint8_t *encryptedPrivateKe
uint8_t
type
=
0
;
uint8_t
type
=
0
;
uint8_t
exportable
=
0
;
uint8_t
exportable
=
0
;
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
key_len
,
skey_hex
,
BUF_LEN
,
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
key_len
,
skey_hex
,
BUF_LEN
,
&
type
,
&
exportable
);
&
type
,
&
exportable
);
...
...
testw.cpp
View file @
1b059402
...
@@ -774,8 +774,8 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
...
@@ -774,8 +774,8 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
status
=
trustedDecryptKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrypted_key
.
data
(),
encLen
,
decr_key
.
data
());
status
=
trustedDecryptKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrypted_key
.
data
(),
encLen
,
decr_key
.
data
());
REQUIRE
(
status
==
0
);
REQUIRE
(
status
==
0
);
REQUIRE
(
errStatus
==
0
);
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
REQUIRE
(
errStatus
==
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