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
c8b9e50d
Unverified
Commit
c8b9e50d
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 MERGE_DEVELOP
parents
18a40039
f467f71e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+9
-9
secure_enclave.c
secure_enclave/secure_enclave.c
+0
-2
testw.cpp
testw.cpp
+1
-1
testw.h
testw.h
+1
-1
No files found.
secure_enclave/EnclaveCommon.cpp
View file @
c8b9e50d
...
...
@@ -82,8 +82,8 @@ string *stringFromFq(libff::alt_bn128_Fq *_fq) {
try
{
_fq
->
as_bigint
().
to_mpz
(
t
);
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
tmp
);
mpz_get_str
(
arr
,
10
,
t
);
ret
=
new
string
(
arr
);
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
goto
clean
;
...
...
@@ -107,13 +107,13 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
try
{
_g1
->
to_affine_coordinates
();
auto
sX
=
stringFromFq
(
&
_g1
->
X
);
sX
=
stringFromFq
(
&
_g1
->
X
);
if
(
!
sX
)
{
goto
clean
;
}
auto
sY
=
stringFromFq
(
&
_g1
->
Y
);
sY
=
stringFromFq
(
&
_g1
->
Y
);
if
(
!
sY
)
{
goto
clean
;
...
...
@@ -131,8 +131,8 @@ string *stringFromG1(libff::alt_bn128_G1 *_g1) {
clean:
SAFE_
FRE
E
(
sX
);
SAFE_
FRE
E
(
sY
);
SAFE_
DELET
E
(
sX
);
SAFE_
DELET
E
(
sY
);
return
ret
;
...
...
@@ -226,7 +226,7 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
}
try
{
auto
key
=
keyFromString
(
_keyString
);
key
=
keyFromString
(
_keyString
);
if
(
!
key
)
{
LOG_ERROR
(
"Null key"
);
...
...
@@ -243,13 +243,13 @@ bool enclave_sign(const char *_keyString, const char *_hashXString, const char *
sign
.
to_affine_coordinates
();
auto
r
=
stringFromG1
(
&
sign
);
r
=
stringFromG1
(
&
sign
);
memset
(
sig
,
0
,
BUF_LEN
);
strncpy
(
sig
,
r
->
c_str
(),
BUF_LEN
);
ret
=
true
;
ret
=
true
;
}
catch
(
exception
&
e
)
{
LOG_ERROR
(
e
.
what
());
...
...
secure_enclave/secure_enclave.c
View file @
c8b9e50d
...
...
@@ -1118,8 +1118,6 @@ trustedGetBlsPubKey(int *errStatus, char *errString, uint8_t *encryptedPrivateKe
uint8_t
type
=
0
;
uint8_t
exportable
=
0
;
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
key_len
,
skey_hex
,
BUF_LEN
,
&
type
,
&
exportable
);
...
...
testw.cpp
View file @
c8b9e50d
...
...
@@ -779,8 +779,8 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
status
=
trustedDecryptKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrypted_key
.
data
(),
encLen
,
decr_key
.
data
());
REQUIRE
(
status
==
0
);
REQUIRE
(
errStatus
==
0
);
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
REQUIRE
(
errStatus
==
0
);
}
...
...
testw.h
View file @
c8b9e50d
...
...
@@ -31,7 +31,7 @@
#define SAMPLE_KEY_NAME "tmp_NEK:8abc8e8280fb060988b65da4b8cb00779a1e816ec42f8a40ae2daa520e484a01"
#define SAMPLE_AES_KEY "123456789"
#define SAMPLE_POLY_NAME
"POLY:SCHAIN_ID:1:NODE_ID:1:DKG_ID:1"
#define SAMPLE_POLY_NAME "POLY:SCHAIN_ID:1:NODE_ID:1:DKG_ID:1"
#define RPC_ENDPOINT "http://localhost:1029"
#define SAMPLE_PUBLIC_KEY_B "c0152c48bf640449236036075d65898fded1e242c00acb45519ad5f788ea7cbf9a5df1559e7fc87932eee5478b1b9023de19df654395574a690843988c3ff475"
...
...
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