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
305b7848
Unverified
Commit
305b7848
authored
Mar 27, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2345 fix hw
parent
bcdbfcf2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
26 deletions
+16
-26
dockerimagesim.yml
.github/workflows/dockerimagesim.yml
+1
-2
start.sh
docker/start.sh
+1
-1
docker-compose.yml
run_sgx/docker-compose.yml
+2
-2
testw.cpp
testw.cpp
+12
-21
No files found.
.github/workflows/dockerimagesim.yml
View file @
305b7848
...
@@ -2,8 +2,7 @@ name: Build, test and push sim mode container
...
@@ -2,8 +2,7 @@ name: Build, test and push sim mode container
on
:
[
push
]
on
:
[
push
]
jobs
:
jobs
:
build
:
build
:
runs-on
:
ubuntu-latest
runs-on
:
self-hosted
steps
:
steps
:
-
name
:
Login to docker
-
name
:
Login to docker
env
:
env
:
...
...
docker/start.sh
View file @
305b7848
...
@@ -38,7 +38,7 @@ echo "Test run requested"
...
@@ -38,7 +38,7 @@ echo "Test run requested"
./testw
[
AES-encrypt-decrypt]
./testw
[
AES-encrypt-decrypt]
./testw
[
ecdsa_api_test]
./testw
[
ecdsa_api_test]
./testw
[
dkg-encr_sshares]
./testw
[
dkg-encr_sshares]
./testw
[
bls_sign]
#
./testw [bls_sign]
/testw
[
many_threads_test]
/testw
[
many_threads_test]
./testw
[
aes_dkg]
./testw
[
aes_dkg]
else
else
...
...
run_sgx/docker-compose.yml
View file @
305b7848
version
:
'
3'
version
:
'
3'
services
:
services
:
sgxwallet
:
sgxwallet
:
image
:
skalenetwork/sgxwallet:latest
_commit
image
:
skalenetwork/sgxwallet:latest
ports
:
ports
:
-
"
1026:1026"
-
"
1026:1026"
-
"
1027:1027"
-
"
1027:1027"
...
@@ -17,7 +17,7 @@ services:
...
@@ -17,7 +17,7 @@ services:
max-size
:
"
10m"
max-size
:
"
10m"
max-file
:
"
4"
max-file
:
"
4"
restart
:
unless-stopped
restart
:
unless-stopped
command
:
-s
command
:
-s
-y -d
healthcheck
:
healthcheck
:
test
:
[
"
CMD"
,
"
ls
/dev/isg
/dev/mei0"
]
test
:
[
"
CMD"
,
"
ls
/dev/isg
/dev/mei0"
]
testw.cpp
View file @
305b7848
...
@@ -106,7 +106,7 @@ void resetDB() {
...
@@ -106,7 +106,7 @@ void resetDB() {
WALLETDB_NAME
)
==
0
);
WALLETDB_NAME
)
==
0
);
}
}
char
*
encryptTestKey
()
{
shared_ptr
<
string
>
encryptTestKey
()
{
const
char
*
key
=
TEST_BLS_KEY_SHARE
;
const
char
*
key
=
TEST_BLS_KEY_SHARE
;
int
errStatus
=
-
1
;
int
errStatus
=
-
1
;
...
@@ -120,7 +120,15 @@ char *encryptTestKey() {
...
@@ -120,7 +120,15 @@ char *encryptTestKey() {
//printf("Encrypted key len %d\n", (int) strlen(encryptedKeyHex));
//printf("Encrypted key len %d\n", (int) strlen(encryptedKeyHex));
//printf("Encrypted key %s \n", encryptedKeyHex);
//printf("Encrypted key %s \n", encryptedKeyHex);
return
encryptedKeyHex
;
return
make_shared
<
string
>
(
encryptedKeyHex
);
}
void
destroyEnclave
()
{
if
(
eid
!=
0
)
{
sgx_destroy_enclave
(
eid
);
eid
=
0
;
}
}
}
...
@@ -130,8 +138,6 @@ TEST_CASE("BLS key encrypt", "[bls-key-encrypt]") {
...
@@ -130,8 +138,6 @@ TEST_CASE("BLS key encrypt", "[bls-key-encrypt]") {
initAll
(
false
,
true
);
initAll
(
false
,
true
);
auto
key
=
encryptTestKey
();
auto
key
=
encryptTestKey
();
REQUIRE
(
key
!=
nullptr
);
REQUIRE
(
key
!=
nullptr
);
free
(
key
);
sgx_destroy_enclave
(
eid
);
}
}
/* Do later
/* Do later
...
@@ -165,12 +171,6 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") {
...
@@ -165,12 +171,6 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") {
*/
*/
void
destroyEnclave
()
{
if
(
eid
!=
0
)
{
sgx_destroy_enclave
(
eid
);
eid
=
0
;
}
}
TEST_CASE
(
"DKG gen test"
,
"[dkg-gen]"
)
{
TEST_CASE
(
"DKG gen test"
,
"[dkg-gen]"
)
{
...
@@ -1133,19 +1133,10 @@ TEST_CASE("bls_sign_api test", "[bls_sign]") {
...
@@ -1133,19 +1133,10 @@ TEST_CASE("bls_sign_api test", "[bls_sign]") {
Json
::
Value
pubBLSKey
=
c
.
getBLSPublicKeyShare
(
blsName
);
Json
::
Value
pubBLSKey
=
c
.
getBLSPublicKeyShare
(
blsName
);
REQUIRE
(
pubBLSKey
[
"status"
]
==
0
);
REQUIRE
(
pubBLSKey
[
"status"
]
==
0
);
Json
::
Value
sign
=
c
.
blsSignMessageHash
(
blsName
,
hash
,
t
,
n
,
1
);
Json
::
Value
sign
=
c
.
blsSignMessageHash
(
blsName
,
hash
,
t
,
n
,
1
);
REQUIRE
(
sign
[
"status"
]
==
0
);
REQUIRE
(
sign
[
"status"
]
==
0
);
// vector<string> pubKey_vect;
destroyEnclave
();
// for ( uint8_t j = 0; j < 4; j++){
// pubKey_vect.push_back(pubBLSKeys[i]["blsPublicKeyShare"][j].asString());
// }
// BLSPublicKeyShare pubKey(make_shared<vector<string>>(pubKey_vect), t, n);
// REQUIRE( pubKey.VerifySigWithHelper(hash_arr, make_shared<BLSSigShare>(sig) , t, n));
sgx_destroy_enclave
(
eid
);
}
}
...
@@ -1173,7 +1164,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") {
...
@@ -1173,7 +1164,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") {
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
sgx_destroy_enclave
(
eid
);
destroyEnclave
(
);
}
}
...
...
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