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
24d705dd
Unverified
Commit
24d705dd
authored
Nov 17, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3481-NIGHTLY
parent
40b0336f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
+23
-12
TestUtils.cpp
TestUtils.cpp
+22
-11
secure_enclave.config.xml.sim
secure_enclave/secure_enclave.config.xml.sim
+1
-1
No files found.
TestUtils.cpp
View file @
24d705dd
...
...
@@ -79,14 +79,12 @@ string TestUtils::convertDecToHex(string dec, int numBytes) {
mpz_t
num
;
mpz_init
(
num
);
mpz_set_str
(
num
,
dec
.
c_str
(),
10
);
vector
<
char
>
tmp
(
mpz_sizeinbase
(
num
,
16
)
+
2
,
0
);
char
*
hex
=
mpz_get_str
(
tmp
.
data
(),
16
,
num
);
string
result
=
hex
;
int
n_zeroes
=
numBytes
*
2
-
result
.
length
();
result
.
insert
(
0
,
n_zeroes
,
'0'
);
mpz_clear
(
num
);
return
result
;
}
...
...
@@ -180,7 +178,7 @@ void TestUtils::sendRPCRequest() {
usleep
(
100000
);
ethKeys
[
i
]
=
c
.
generateECDSAKey
();
for
(
int
i2
=
0
;
i2
<
10000
;
i2
++
)
{
for
(
int
i2
=
0
;
i2
<
3
;
i2
++
)
{
auto
keyName
=
ethKeys
[
i
][
"keyName"
].
asString
();
Json
::
Value
sig
=
c
.
ecdsaSignMessageHash
(
16
,
keyName
,
SAMPLE_HASH
);
CHECK_STATE
(
sig
[
"status"
].
asInt
()
==
0
);
...
...
@@ -193,15 +191,20 @@ void TestUtils::sendRPCRequest() {
auto
response
=
c
.
generateDKGPoly
(
polyName
,
t
);
CHECK_STATE
(
response
[
"status"
]
==
0
);
polyNames
[
i
]
=
polyName
;
for
(
int
i3
=
0
;
i3
<
3
;
i3
++
)
{
verifVects
[
i
]
=
c
.
getVerificationVector
(
polyName
,
t
,
n
);
CHECK_STATE
(
verifVects
[
i
][
"status"
]
==
0
);
}
pubEthKeys
.
append
(
ethKeys
[
i
][
"publicKey"
]);
}
for
(
uint8_t
i
=
0
;
i
<
n
;
i
++
)
{
usleep
(
100000
);
for
(
int
i4
=
0
;
i4
<
1
;
i4
++
)
{
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
++
)
{
string
pubShare
=
verifVects
[
i
][
"verificationVector"
][
k
][
j
].
asString
();
...
...
@@ -217,9 +220,12 @@ void TestUtils::sendRPCRequest() {
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
);
for
(
int
i5
=
0
;
i5
<
1
;
i5
++
)
{
Json
::
Value
verif
=
c
.
dkgVerification
(
pubShares
[
i
],
ethKeys
[
j
][
"keyName"
].
asString
(),
secretShare
,
t
,
n
,
j
);
CHECK_STATE
(
verif
[
"status"
]
==
0
);
}
}
BLSSigShareSet
sigShareSet
(
t
,
n
);
...
...
@@ -238,8 +244,13 @@ void TestUtils::sendRPCRequest() {
publicShares
[
"publicShares"
][
i
]
=
pubShares
[
i
];
}
Json
::
Value
blsPublicKeys
;
for
(
int
i6
=
0
;
i6
<
10000
;
i6
++
)
{
Json
::
Value
blsPublicKeys
=
c
.
calculateAllBLSPublicKeys
(
publicShares
,
t
,
n
);
CHECK_STATE
(
blsPublicKeys
[
"status"
]
==
0
);
}
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
string
endName
=
polyNames
[
i
].
substr
(
4
);
...
...
secure_enclave/secure_enclave.config.xml.sim
View file @
24d705dd
...
...
@@ -2,7 +2,7 @@
<ProdID>0</ProdID>
<ISVSVN>1</ISVSVN>
<StackMaxSize>0x100000</StackMaxSize>
<HeapMaxSize>0x
2
0000</HeapMaxSize>
<HeapMaxSize>0x
10
0000</HeapMaxSize>
<TCSNum>16</TCSNum>
<TCSMaxNum>16</TCSMaxNum>
<TCSMinPool>16</TCSMinPool>
...
...
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