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
5d99fbec
Unverified
Commit
5d99fbec
authored
Sep 17, 2019
by
kladkogex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dobavili eshe fignju
parent
3c31e5a9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
15 deletions
+20
-15
BLSCrypto.h
BLSCrypto.h
+2
-1
Makefile.am
Makefile.am
+2
-2
sgx_app.am
build-aux/sgx_app.am
+1
-1
sgx_enclave.am
build-aux/sgx_enclave.am
+1
-1
sgx_tlib.am
build-aux/sgx_tlib.am
+1
-1
Makefile.am
secure_enclave/Makefile.am
+2
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+1
-1
secure_enclave.edl
secure_enclave/secure_enclave.edl
+2
-0
testw.cpp
testw.cpp
+8
-7
No files found.
BLSCrypto.h
View file @
5d99fbec
...
...
@@ -18,7 +18,8 @@ EXTERNC void init_daemon();
EXTERNC
void
init_enclave
();
EXTERNC
bool
sign
(
const
char
*
encryptedKeyHex
,
const
char
*
hashHex
,
size_t
t
,
size_t
n
,
size_t
signerIndex
,
char
*
_sig
);
EXTERNC
bool
sign
(
const
char
*
encryptedKeyHex
,
const
char
*
hashHex
,
size_t
t
,
size_t
n
,
size_t
signerIndex
,
char
*
_sig
);
EXTERNC
int
char2int
(
char
_input
);
...
...
Makefile.am
View file @
5d99fbec
...
...
@@ -88,9 +88,9 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
## Use the variables, not the actual library names to ensure these
## targets work on simulation builds.
sgxwallet_LDADD
=
-l
$(SGX_URTS_LIB)
-Lleveldb
/build
-LlibBLS
/build
-LlibBLS
/build/libff/libff
-l
:libbls.a
-l
:libleveldb.a
-l
:libff.a
-lgmp
-ldl
-l
:libsgx_capable.a
-l
:libsgx_tprotected_fs.a
-ljsonrpccpp-stub
-lpthread
-ljsonrpccpp-common
-ljsonrpccpp-server
-ljsoncpp
-lprocps
sgxwallet_LDADD
=
-l
$(SGX_URTS_LIB)
-Lleveldb
/build
-LlibBLS
/build
-LlibBLS
/build/libff/libff
-l
:libbls.a
-l
:libleveldb.a
-l
:libff.a
-lgmp
-ldl
-l
:libsgx_capable.a
-l
:libsgx_tprotected_fs.a
-ljsonrpccpp-stub
-lpthread
-ljsonrpccpp-common
-ljsonrpccpp-server
-ljsoncpp
-lprocps
intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a
testw_SOURCES
=
testw.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp BLSPrivateKeyShareSGX.cpp
$(COMMON_SRC)
nodist_testw_SOURCES
=
${
nodist_sgxwallet_SOURCES
}
EXTRA_testw_DEPENDENCIES
=
${
EXTRA_sgxwallet_DEPENDENCIES
}
testw_LDADD
=
${
sgxwallet_LDADD
}
\ No newline at end of file
testw_LDADD
=
${
sgxwallet_LDADD
}
build-aux/sgx_app.am
View file @
5d99fbec
...
...
@@ -33,5 +33,5 @@ SGX_UAE_SERVICE_LIB=@SGX_UAE_SERVICE_LIB@
if SGX_ENABLED
%_u.h %_u.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --untrusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR)
:/d/sgxwallet/intel-sgx-ssl/Linux/package/include
$(SGX_EDGER8R_FLAGS) --untrusted $<
endif
build-aux/sgx_enclave.am
View file @
5d99fbec
...
...
@@ -47,7 +47,7 @@ CLEANFILES = $(ENCLAVE).signed.so
## Rule to make trusted proxy functions from an EDL file.
%_t.h %_t.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --trusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR)
:/d/sgxwallet/intel-sgx-ssl/Linux/package/include
$(SGX_EDGER8R_FLAGS) --trusted $<
## When building a debug enclave, go ahead and sign directly using the
## supplied private key.
...
...
build-aux/sgx_tlib.am
View file @
5d99fbec
...
...
@@ -22,5 +22,5 @@ AM_CXXFLAGS=@SGX_TLIB_CXXFLAGS@
## Rule to make trusted proxy functions from an EDL file.
%_t.h %_t.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --trusted $<
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR)
:/d/sgxwallet/intel-sgx-ssl/Linux/package/include
$(SGX_EDGER8R_FLAGS) --trusted $<
secure_enclave/Makefile.am
View file @
5d99fbec
...
...
@@ -113,7 +113,8 @@ secure_enclave_LDADD = @SGX_ENCLAVE_LDADD@
## --startgroup and --endgroup flags. (This would be where you'd add
## SGXSSL libraries, and your trusted c++ library
SGX_EXTRA_TLIBS
=
-lsgx_tgmp
-lsgx_tservice
-lsgx_urts
-lsgx_tcxx
../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a
SGX_EXTRA_TLIBS
=
-lsgx_tgmp
-lsgx_tservice
-lsgx_urts
-lsgx_tcxx
../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a
\
../intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl.a
...
...
secure_enclave/secure_enclave.c
View file @
5d99fbec
...
...
@@ -277,7 +277,7 @@ void ecdsa_sign_message(int *err_status, char *err_string, uint8_t *encrypted_ke
decrypt_key
(
err_status
,
err_string
,
encrypted_key
,
enc_len
,
key
);
if
(
err_status
!=
0
)
{
if
(
*
err_status
!=
0
)
{
return
;
}
...
...
secure_enclave/secure_enclave.edl
View file @
5d99fbec
enclave {
from "sgx_tsgxssl.edl" import *;
trusted {
include "sgx_tgmp.h"
...
...
testw.cpp
View file @
5d99fbec
...
...
@@ -94,6 +94,14 @@ char* encryptTestKey() {
}
class
StartFromScratch
{
public
:
StartFromScratch
()
{
}
};
TEST_CASE
(
"BLS key encrypt"
,
"[bls-key-encrypt]"
)
{
...
...
@@ -162,17 +170,12 @@ TEST_CASE("BLS sign test", "[bls-sign]") {
strncpy
(
hexHashBuf
,
hexHash
,
BUF_LEN
);
char
sig
[
BUF_LEN
];
REQUIRE
(
sign
(
encryptedKeyHex
,
hexHashBuf
,
2
,
2
,
1
,
sig
));
printf
(
"Signature is: %s
\n
"
,
sig
);
}
TEST_CASE
(
"Server BLS sign test"
,
"[bls-server-sign]"
)
{
...
...
@@ -187,10 +190,8 @@ TEST_CASE("Server BLS sign test", "[bls-server-sign]") {
REQUIRE
(
result
[
"encryptedKeyShare"
]
!=
""
);
const
char
*
hexHash
=
"001122334455667788"
"001122334455667788"
"001122334455667788"
"001122334455667788"
;
REQUIRE_NOTHROW
(
result
=
blsSignMessageHashImpl
(
TEST_BLS_KEY_NAME
,
hexHash
));
if
(
result
[
"status"
]
!=
0
)
{
...
...
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