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
8d59222d
Unverified
Commit
8d59222d
authored
Nov 17, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3481-NIGHTLY
parent
f1502c60
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
18 deletions
+14
-18
SGXWalletServer.cpp
SGXWalletServer.cpp
+3
-0
TestUtils.cpp
TestUtils.cpp
+3
-0
secure_enclave.c
secure_enclave/secure_enclave.c
+7
-17
testw.cpp
testw.cpp
+1
-1
No files found.
SGXWalletServer.cpp
View file @
8d59222d
...
...
@@ -121,6 +121,9 @@ void SGXWalletServer::printDB() {
int
SGXWalletServer
::
initHttpsServer
(
bool
_checkCerts
)
{
spdlog
::
info
(
"Entering {}"
,
__FUNCTION__
);
spdlog
::
info
(
"Initing server, number of threads: {}"
,
NUM_THREADS
);
string
rootCAPath
=
string
(
SGXDATA_FOLDER
)
+
"cert_data/rootCA.pem"
;
string
keyCAPath
=
string
(
SGXDATA_FOLDER
)
+
"cert_data/rootCA.key"
;
...
...
TestUtils.cpp
View file @
8d59222d
...
...
@@ -177,6 +177,7 @@ void TestUtils::sendRPCRequest() {
int
schainID
=
counter
.
fetch_add
(
1
);
int
dkgID
=
counter
.
fetch_add
(
1
);
for
(
uint8_t
i
=
0
;
i
<
n
;
i
++
)
{
usleep
(
100000
);
ethKeys
[
i
]
=
c
.
generateECDSAKey
();
CHECK_STATE
(
ethKeys
[
i
][
"status"
]
==
0
);
string
polyName
=
...
...
@@ -191,6 +192,7 @@ void TestUtils::sendRPCRequest() {
}
for
(
uint8_t
i
=
0
;
i
<
n
;
i
++
)
{
usleep
(
100000
);
secretShares
[
i
]
=
c
.
getSecretShare
(
polyNames
[
i
],
pubEthKeys
,
t
,
n
);
for
(
uint8_t
k
=
0
;
k
<
t
;
k
++
)
{
for
(
uint8_t
j
=
0
;
j
<
4
;
j
++
)
{
...
...
@@ -206,6 +208,7 @@ void TestUtils::sendRPCRequest() {
for
(
int
j
=
0
;
j
<
n
;
j
++
)
{
string
secretShare
=
secretShares
[
i
][
"secretShare"
].
asString
().
substr
(
192
*
j
,
192
);
secShares
[
i
]
+=
secretShares
[
j
][
"secretShare"
].
asString
().
substr
(
192
*
i
,
192
);
usleep
(
100000
);
Json
::
Value
verif
=
c
.
dkgVerification
(
pubShares
[
i
],
ethKeys
[
j
][
"keyName"
].
asString
(),
secretShare
,
t
,
n
,
j
);
CHECK_STATE
(
verif
[
"status"
]
==
0
);
}
...
...
secure_enclave/secure_enclave.c
View file @
8d59222d
...
...
@@ -507,15 +507,6 @@ void trustedGetPublicEcdsaKey(int *errStatus, char *errString,
point_clear
(
pKey
);
point_clear
(
pKey_test
);
static
uint64_t
counter
=
0
;
if
(
counter
%
1000
==
0
)
{
LOG_INFO
(
__FUNCTION__
);
LOG_INFO
(
"Thousand SGX calls completed"
);
}
counter
++
;
}
static
uint64_t
sigCounter
=
0
;
...
...
@@ -537,7 +528,8 @@ void trustedEcdsaSign(int *errStatus, char *errString, uint8_t *encryptedPrivate
mpz_init
(
privateKeyMpz
);
mpz_t
msgMpz
;
mpz_init
(
msgMpz
);
signature
sign
=
signature_init
();
signature
sign
=
NULL
;
sign
=
signature_init
();
uint8_t
type
=
0
;
uint8_t
exportable
=
0
;
...
...
@@ -603,7 +595,8 @@ void trustedEcdsaSign(int *errStatus, char *errString, uint8_t *encryptedPrivate
mpz_clear
(
privateKeyMpz
);
mpz_clear
(
msgMpz
);
signature_free
(
sign
);
if
(
sign
)
signature_free
(
sign
);
LOG_DEBUG
(
__FUNCTION__
);
LOG_DEBUG
(
"SGX call completed"
);
}
...
...
@@ -1139,12 +1132,9 @@ trustedGetBlsPubKey(int *errStatus, char *errString, uint8_t *encryptedPrivateKe
CHECK_STATUS
(
"could not calculate bls public key"
);
SET_SUCCESS
static
uint64_t
counter
=
0
;
clean:
if
(
counter
%
1000
==
0
)
{
LOG_INFO
(
__FUNCTION__
);
LOG_INFO
(
"Thousand SGX calls completed"
);
}
;
counter
++
;
}
testw.cpp
View file @
8d59222d
...
...
@@ -781,7 +781,7 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
TEST_CASE_METHOD
(
TestFixture
,
"Many threads ecdsa dkg bls"
,
"[many-threads-crypto]"
)
{
vector
<
thread
>
threads
;
int
num_threads
=
4
;
int
num_threads
=
16
;
for
(
int
i
=
0
;
i
<
num_threads
;
i
++
)
{
threads
.
push_back
(
thread
(
TestUtils
::
sendRPCRequest
));
}
...
...
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