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
a4382dc4
Unverified
Commit
a4382dc4
authored
Aug 26, 2020
by
Oleh Nikolaiev
Committed by
GitHub
Aug 26, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #154 from skalenetwork/bug/SKALE-3114-bls-sign-error
SKALE-3114 fix bls import/sign error
parents
89a991a7
d294b111
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
BLSCrypto.cpp
BLSCrypto.cpp
+2
-6
docker-compose.yml
run_sgx_sim/docker-compose.yml
+1
-2
EnclaveCommon.cpp
secure_enclave/EnclaveCommon.cpp
+3
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+6
-1
No files found.
BLSCrypto.cpp
View file @
a4382dc4
...
...
@@ -248,11 +248,7 @@ std::string encryptBLSKeyShare2Hex(int *errStatus, char *err_string, const char
auto
encryptedKey
=
make_shared
<
vector
<
uint8_t
>>
(
BUF_LEN
,
0
);
auto
errMsg
=
make_shared
<
vector
<
char
>>
(
BUF_LEN
,
0
);
libff
::
alt_bn128_Fr
key
(
_key
);
string
str_key
=
BLSutils
::
ConvertToString
(
key
);
strncpy
(
keyArray
->
data
(),
str_key
.
data
(),
BUF_LEN
);
strncpy
(
keyArray
->
data
(),
_key
,
BUF_LEN
);
*
errStatus
=
-
1
;
unsigned
int
encryptedLen
=
0
;
...
...
@@ -268,7 +264,7 @@ std::string encryptBLSKeyShare2Hex(int *errStatus, char *err_string, const char
if
(
status
!=
SGX_SUCCESS
)
{
*
errStatus
=
-
1
;
return
nullptr
;
return
""
;
}
std
::
string
result
(
2
*
BUF_LEN
,
'\0'
);
...
...
run_sgx_sim/docker-compose.yml
View file @
a4382dc4
...
...
@@ -16,5 +16,4 @@ services:
max-size
:
"
10m"
max-file
:
"
4"
restart
:
unless-stopped
command
:
-s
command
:
-s -y
secure_enclave/EnclaveCommon.cpp
View file @
a4382dc4
...
...
@@ -145,8 +145,10 @@ libff::alt_bn128_Fr *keyFromString(const char *_keyStringHex) {
SAFE_CHAR_BUF
(
skey_dec
,
BUF_LEN
);
libff
::
alt_bn128_Fr
*
ret
=
nullptr
;
if
(
mpz_set_str
(
skey
,
_keyStringHex
,
16
)
==
-
1
)
{
goto
clean
;
}
mpz_set_str
(
skey
,
_keyStringHex
,
16
);
mpz_get_str
(
skey_dec
,
10
,
skey
);
ret
=
new
libff
::
alt_bn128_Fr
(
skey_dec
);
...
...
secure_enclave/secure_enclave.c
View file @
a4382dc4
...
...
@@ -668,7 +668,12 @@ void trustedBlsSignMessageAES(int *errStatus, char *errString, uint8_t *encrypte
CHECK_STATUS
(
"AES decrypt failed"
)
enclave_sign
(
key
,
_hashX
,
_hashY
,
sig
);
if
(
!
enclave_sign
(
key
,
_hashX
,
_hashY
,
sig
))
{
strncpy
(
errString
,
"Enclave failed to create bls signature"
,
BUF_LEN
);
LOG_ERROR
(
errString
);
*
errStatus
=
-
1
;
goto
clean
;
}
strncpy
(
signature
,
sig
,
BUF_LEN
);
...
...
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