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
8d95c501
Unverified
Commit
8d95c501
authored
Nov 17, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3481-NIGHTLY
parent
359a1912
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
SGXWalletServer.cpp
SGXWalletServer.cpp
+5
-1
TestUtils.cpp
TestUtils.cpp
+8
-3
secure_enclave.config.xml.sim
secure_enclave/secure_enclave.config.xml.sim
+1
-1
No files found.
SGXWalletServer.cpp
View file @
8d95c501
...
...
@@ -545,6 +545,8 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
shared_ptr
<
string
>
encryptedKeyHex_ptr
=
readFromDb
(
_ethKeyName
);
CHECK_STATE
(
encryptedKeyHex_ptr
);
bool
res
=
createBLSShare
(
_blsKeyName
,
_secretShare
.
c_str
(),
encryptedKeyHex_ptr
->
c_str
());
if
(
res
)
{
spdlog
::
info
(
"BLS KEY SHARE CREATED "
);
...
...
@@ -552,6 +554,7 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
throw
SGXException
(
-
122
,
"Error while creating BLS key share"
);
}
for
(
int
i
=
0
;
i
<
_n
;
i
++
)
{
string
name
=
_polyName
+
"_"
+
to_string
(
i
)
+
":"
;
LevelDB
::
getLevelDb
()
->
deleteDHDKGKey
(
name
);
...
...
@@ -560,6 +563,7 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
}
LevelDB
::
getLevelDb
()
->
deleteKey
(
_polyName
);
string
encryptedSecretShareName
=
"encryptedSecretShare:"
+
_polyName
;
LevelDB
::
getLevelDb
()
->
deleteKey
(
encryptedSecretShareName
);
...
...
@@ -848,9 +852,9 @@ void SGXWalletServer::writeKeyShare(const string &_keyShareName, const string &_
}
void
SGXWalletServer
::
writeDataToDB
(
const
string
&
name
,
const
string
&
value
)
{
if
(
LevelDB
::
getLevelDb
()
->
readString
(
name
)
!=
nullptr
)
{
throw
SGXException
(
KEY_NAME_ALREADY_EXISTS
,
"Name already exists"
);
}
LevelDB
::
getLevelDb
()
->
writeString
(
name
,
value
);
}
TestUtils.cpp
View file @
8d95c501
...
...
@@ -247,7 +247,7 @@ void TestUtils::sendRPCRequest() {
Json
::
Value
blsPublicKeys
;
for
(
int
i6
=
0
;
i6
<
2
;
i6
++
)
{
for
(
int
i6
=
0
;
i6
<
1
;
i6
++
)
{
blsPublicKeys
=
c
.
calculateAllBLSPublicKeys
(
publicShares
,
t
,
n
);
CHECK_STATE
(
blsPublicKeys
[
"status"
]
==
0
);
}
...
...
@@ -257,9 +257,14 @@ void TestUtils::sendRPCRequest() {
string
blsName
=
"BLS_KEY"
+
polyNames
[
i
].
substr
(
4
);
string
secretShare
=
secretShares
[
i
][
"secretShare"
].
asString
();
auto
response
=
c
.
createBLSPrivateKey
(
blsName
,
ethKeys
[
i
][
"keyName"
].
asString
(),
polyNames
[
i
],
secShares
[
i
],
t
,
n
);
auto
response
=
c
.
createBLSPrivateKey
(
blsName
,
ethKeys
[
i
][
"keyName"
].
asString
(),
polyNames
[
i
],
secShares
[
i
],
t
,
n
);
CHECK_STATE
(
response
[
"status"
]
==
0
);
pubBLSKeys
[
i
]
=
c
.
getBLSPublicKeyShare
(
blsName
);
for
(
int
i7
=
0
;
i7
<
10000
;
i7
++
)
{
pubBLSKeys
[
i
]
=
c
.
getBLSPublicKeyShare
(
blsName
);
}
CHECK_STATE
(
pubBLSKeys
[
i
][
"status"
]
==
0
);
libff
::
alt_bn128_G2
publicKey
(
libff
::
alt_bn128_Fq2
(
libff
::
alt_bn128_Fq
(
pubBLSKeys
[
i
][
"blsPublicKeyShare"
][
0
].
asCString
()),
...
...
secure_enclave/secure_enclave.config.xml.sim
View file @
8d95c501
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>1</ISVSVN>
<StackMaxSize>0x
1
00000</StackMaxSize>
<StackMaxSize>0x
2
00000</StackMaxSize>
<HeapMaxSize>0x200000</HeapMaxSize>
<TCSNum>16</TCSNum>
<TCSMaxNum>16</TCSMaxNum>
...
...
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