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
f6583f7c
Unverified
Commit
f6583f7c
authored
Jun 16, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2678-BLS-test-vectors
parent
09e8c990
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
13 deletions
+37
-13
TestUtils.cpp
TestUtils.cpp
+0
-1
TestUtils.h
TestUtils.h
+4
-0
sgxwall.cpp
sgxwall.cpp
+33
-12
No files found.
TestUtils.cpp
View file @
f6583f7c
...
@@ -57,7 +57,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -57,7 +57,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SGXWalletServer.hpp"
#include "SGXWalletServer.hpp"
#include "catch.hpp"
#include "catch.hpp"
#include "stubclient.h"
#include "BLSSigShare.h"
#include "BLSSigShare.h"
#include "BLSSigShareSet.h"
#include "BLSSigShareSet.h"
#include "BLSPublicKeyShare.h"
#include "BLSPublicKeyShare.h"
...
...
TestUtils.h
View file @
f6583f7c
...
@@ -23,9 +23,13 @@
...
@@ -23,9 +23,13 @@
#include <jsonrpccpp/client/connectors/httpclient.h>
#include <jsonrpccpp/client/connectors/httpclient.h>
#include <sgx_tcrypto.h>
#include <sgx_tcrypto.h>
#include "stubclient.h"
#include "stubclient.h"
#include <jsonrpccpp/server/connectors/httpserver.h>
#include "abstractstubserver.h"
using
namespace
std
;
using
namespace
std
;
using
namespace
jsonrpc
;
class
TestUtils
{
class
TestUtils
{
...
...
sgxwall.cpp
View file @
f6583f7c
...
@@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "TestUtils.h"
#include "TestUtils.h"
#include "testw.h"
#include "sgxwall.h"
#include "sgxwall.h"
#include "sgxwallet.h"
#include "sgxwallet.h"
...
@@ -51,22 +52,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -51,22 +52,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void
SGXWallet
::
usage
()
{
void
SGXWallet
::
usage
()
{
fprintf
(
stderr
,
"usage: sgxwallet
\n
"
)
;
cerr
<<
"usage: sgxwallet
\n
"
;
exit
(
1
);
exit
(
1
);
}
}
void
SGXWallet
::
printUsage
()
{
void
SGXWallet
::
printUsage
()
{
fprintf
(
stderr
,
"Available flags:
\n
"
)
;
cerr
<<
"Available flags:
\n
"
;
fprintf
(
stderr
,
"-c do not verify client certificate
\n
"
)
;
cerr
<<
"-c do not verify client certificate
\n
"
;
fprintf
(
stderr
,
"-s sign client certificate without human confirmation
\n
"
)
;
cerr
<<
"-s sign client certificate without human confirmation
\n
"
;
fprintf
(
stderr
,
"-d turn on debug output
\n
"
)
;
cerr
<<
"-d turn on debug output
\n
"
;
fprintf
(
stderr
,
"-v verbose mode: turn on debug output
\n
"
)
;
cerr
<<
"-v verbose mode: turn on debug output
\n
"
;
fprintf
(
stderr
,
"-vv detailed verbose mode: turn on debug and trace outputs
\n
"
)
;
cerr
<<
"-vv detailed verbose mode: turn on debug and trace outputs
\n
"
;
fprintf
(
stderr
,
"-n launch SGXWalletServer using http (not https)
\n
"
)
;
cerr
<<
"-n launch SGXWalletServer using http (not https)
\n
"
;
fprintf
(
stderr
,
"-b Restore from back up (you will need to enter backup key)
\n
"
)
;
cerr
<<
"-b Restore from back up (you will need to enter backup key)
\n
"
;
fprintf
(
stderr
,
"-y Do not ask user to acknowledge receipt of backup key
\n
"
)
;
cerr
<<
"-y Do not ask user to acknowledge receipt of backup key
\n
"
;
}
}
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
...
@@ -92,7 +93,7 @@ int main(int argc, char *argv[]) {
...
@@ -92,7 +93,7 @@ int main(int argc, char *argv[]) {
exit
(
1
);
exit
(
1
);
}
}
while
((
opt
=
getopt
(
argc
,
argv
,
"cshd0abyvVn"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"cshd0abyvVn
T
"
))
!=
-
1
)
{
switch
(
opt
)
{
switch
(
opt
)
{
case
'h'
:
case
'h'
:
SGXWallet
::
printUsage
();
SGXWallet
::
printUsage
();
...
@@ -151,7 +152,27 @@ int main(int argc, char *argv[]) {
...
@@ -151,7 +152,27 @@ int main(int argc, char *argv[]) {
initAll
(
enclaveLogLevel
,
checkClientCertOption
,
autoSignClientCertOption
);
initAll
(
enclaveLogLevel
,
checkClientCertOption
,
autoSignClientCertOption
);
if
(
generateTestKeys
)
{
if
(
generateTestKeys
)
{
SGXWallet
::
genTestKeys
();
cerr
<<
"Generating test keys ..."
<<
endl
;
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
vector
<
string
>
ecdsaKeyNames
;
vector
<
string
>
blsKeyNames
;
int
schainID
=
1
;
int
dkgID
=
1
;
TestUtils
::
doDKG
(
c
,
4
,
1
,
ecdsaKeyNames
,
blsKeyNames
,
schainID
,
dkgID
);
schainID
=
2
;
dkgID
=
2
;
TestUtils
::
doDKG
(
c
,
16
,
5
,
ecdsaKeyNames
,
blsKeyNames
,
schainID
,
dkgID
);
cerr
<<
"Successfully completed generating test keys into sgx_data"
<<
endl
;
}
}
while
(
true
)
{
while
(
true
)
{
...
...
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