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
fb830e75
Unverified
Commit
fb830e75
authored
Jun 05, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2002 add tests
parent
f4c89a31
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
34 deletions
+181
-34
BLSCrypto.cpp
BLSCrypto.cpp
+0
-23
testw.cpp
testw.cpp
+175
-11
testw.py
testw.py
+6
-0
No files found.
BLSCrypto.cpp
View file @
fb830e75
...
...
@@ -56,7 +56,6 @@
std
::
string
*
FqToString
(
libff
::
alt_bn128_Fq
*
_fq
)
{
mpz_t
t
;
mpz_init
(
t
);
...
...
@@ -82,7 +81,6 @@ int char2int(char _input) {
void
carray2Hex
(
const
unsigned
char
*
d
,
int
_len
,
char
*
_hexArray
)
{
char
hexval
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
...
...
@@ -92,13 +90,11 @@ void carray2Hex(const unsigned char *d, int _len, char *_hexArray) {
}
_hexArray
[
_len
*
2
]
=
0
;
}
bool
hex2carray
(
const
char
*
_hex
,
uint64_t
*
_bin_len
,
uint8_t
*
_bin
)
{
int
len
=
strnlen
(
_hex
,
2
*
BUF_LEN
);
...
...
@@ -119,12 +115,10 @@ bool hex2carray(const char *_hex, uint64_t *_bin_len,
}
return
true
;
}
bool
hex2carray2
(
const
char
*
_hex
,
uint64_t
*
_bin_len
,
uint8_t
*
_bin
,
const
int
_max_length
)
{
int
len
=
strnlen
(
_hex
,
_max_length
);
//2 * BUF_LEN);
...
...
@@ -145,12 +139,10 @@ bool hex2carray2(const char *_hex, uint64_t *_bin_len,
}
return
true
;
}
bool
sign
(
const
char
*
_encryptedKeyHex
,
const
char
*
_hashHex
,
size_t
_t
,
size_t
_n
,
size_t
_signerIndex
,
char
*
_sig
)
{
auto
keyStr
=
make_shared
<
string
>
(
_encryptedKeyHex
);
auto
hash
=
make_shared
<
array
<
uint8_t
,
32
>>
();
...
...
@@ -161,9 +153,6 @@ bool sign(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, size_t
throw
SGXException
(
INVALID_HEX
,
"Invalid hash"
);
}
auto
keyShare
=
make_shared
<
BLSPrivateKeyShareSGX
>
(
keyStr
,
_t
,
_n
);
auto
sigShare
=
keyShare
->
signWithHelperSGX
(
hash
,
_signerIndex
);
...
...
@@ -184,7 +173,6 @@ bool sign(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, size_t
bool
sign_aes
(
const
char
*
_encryptedKeyHex
,
const
char
*
_hashHex
,
size_t
_t
,
size_t
_n
,
size_t
_signerIndex
,
char
*
_sig
)
{
auto
keyStr
=
make_shared
<
string
>
(
_encryptedKeyHex
);
auto
hash
=
make_shared
<
array
<
uint8_t
,
32
>>
();
...
...
@@ -195,8 +183,6 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
throw
SGXException
(
INVALID_HEX
,
"Invalid hash"
);
}
// auto keyShare = make_shared<BLSPrivateKeyShareSGX>(keyStr, _t, _n);
//
// auto sigShare = keyShare->signWithHelperSGX(hash, _signerIndex);
...
...
@@ -243,7 +229,6 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
size_t
sz
=
0
;
uint8_t
encryptedKey
[
BUF_LEN
];
bool
result
=
hex2carray
(
_encryptedKeyHex
,
&
sz
,
encryptedKey
);
...
...
@@ -257,17 +242,14 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
trustedBlsSignMessageAES
(
eid
,
&
errStatus
,
errMsg
,
encryptedKey
,
sz
,
xStrArg
,
yStrArg
,
signature
);
if
(
status
!=
SGX_SUCCESS
)
{
cerr
<<
"SGX enclave call to trustedBlsSignMessage failed:"
<<
status
<<
std
::
endl
;
BOOST_THROW_EXCEPTION
(
runtime_error
(
"SGX enclave call to trustedBlsSignMessage failed"
));
}
std
::
string
hint
=
BLSutils
::
ConvertToString
(
hash_with_hint
.
first
.
Y
)
+
":"
+
hash_with_hint
.
second
;
std
::
string
sig
=
signature
;
sig
.
append
(
":"
);
...
...
@@ -289,7 +271,6 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
bool
bls_sign
(
const
char
*
_encryptedKeyHex
,
const
char
*
_hashHex
,
size_t
_t
,
size_t
_n
,
size_t
_signerIndex
,
char
*
_sig
)
{
return
sign_aes
(
_encryptedKeyHex
,
_hashHex
,
_t
,
_n
,
_signerIndex
,
_sig
);
}
...
...
@@ -327,8 +308,6 @@ char *encryptBLSKeyShare2Hex(int *errStatus, char *err_string, const char *_key)
}
char
*
decryptBLSKeyShareFromHex
(
int
*
errStatus
,
char
*
errMsg
,
const
char
*
_encryptedKey
)
{
*
errStatus
=
-
1
;
uint64_t
decodedLen
=
0
;
...
...
@@ -341,7 +320,6 @@ char *decryptBLSKeyShareFromHex(int *errStatus, char *errMsg, const char *_encry
char
*
plaintextKey
=
(
char
*
)
calloc
(
BUF_LEN
,
1
);
//status = trustedDecryptKey(eid, errStatus, errMsg, decoded, decodedLen, plaintextKey);
status
=
trustedDecryptKeyAES
(
eid
,
errStatus
,
errMsg
,
decoded
,
decodedLen
,
plaintextKey
);
if
(
status
!=
SGX_SUCCESS
)
{
...
...
@@ -353,5 +331,4 @@ char *decryptBLSKeyShareFromHex(int *errStatus, char *errMsg, const char *_encry
}
return
plaintextKey
;
}
testw.cpp
View file @
fb830e75
...
...
@@ -81,7 +81,6 @@ using namespace std;
default_random_engine
randGen
((
unsigned
int
)
time
(
0
));
string
stringFromFr
(
libff
::
alt_bn128_Fr
&
el
)
{
mpz_t
t
;
mpz_init
(
t
);
el
.
as_bigint
().
to_mpz
(
t
);
...
...
@@ -184,7 +183,6 @@ libff::alt_bn128_G2 vectStringToG2(const vector <string> &G2_str_vect) {
return
coeff
;
}
void
sendRPCRequest
()
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
...
...
@@ -273,7 +271,6 @@ void sendRPCRequest() {
shared_ptr
<
BLSSignature
>
commonSig
=
sigShareSet
.
merge
();
}
void
destroyEnclave
()
{
if
(
eid
!=
0
)
{
sgx_destroy_enclave
(
eid
);
...
...
@@ -281,7 +278,6 @@ void destroyEnclave() {
}
}
class
TestFixture
{
public
:
TestFixture
()
{
...
...
@@ -308,8 +304,6 @@ public:
}
};
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA keygen and signature test"
,
"[ecdsa-key-sig-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
...
...
@@ -336,6 +330,32 @@ TEST_CASE_METHOD(TestFixture, "ECDSA keygen and signature test", "[ecdsa-key-sig
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA AES keygen and signature test"
,
"[ecdsa-aes-key-sig-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
vector
<
uint8_t
>
encrPrivKey
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyX
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyY
(
BUF_LEN
,
0
);
uint32_t
encLen
=
0
;
status
=
trustedGenerateEcdsaKeyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrivKey
.
data
(),
&
encLen
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
string
hex
=
SAMPLE_HEX_HASH
;
vector
<
char
>
signatureR
(
BUF_LEN
,
0
);
vector
<
char
>
signatureS
(
BUF_LEN
,
0
);
uint8_t
signatureV
=
0
;
status
=
trustedEcdsaSignAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrivKey
.
data
(),
encLen
,
(
unsigned
char
*
)
hex
.
data
(),
signatureR
.
data
(),
signatureS
.
data
(),
&
signatureV
,
16
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA key gen"
,
"[ecdsa-key-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
...
...
@@ -350,6 +370,20 @@ TEST_CASE_METHOD(TestFixture, "ECDSA key gen", "[ecdsa-key-gen]") {
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA AES key gen"
,
"[ecdsa-aes-key-gen]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
vector
<
uint8_t
>
encrPrivKey
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyX
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyY
(
BUF_LEN
,
0
);
uint32_t
encLen
=
0
;
status
=
trustedGenerateEcdsaKeyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrivKey
.
data
(),
&
encLen
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA get public key"
,
"[ecdsa-get-pub-key]"
)
{
int
errStatus
=
0
;
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
...
...
@@ -362,6 +396,7 @@ TEST_CASE_METHOD(TestFixture, "ECDSA get public key", "[ecdsa-get-pub-key]") {
pubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
receivedPubKeyX
(
BUF_LEN
,
0
);
vector
<
char
>
receivedPubKeyY
(
BUF_LEN
,
0
);
...
...
@@ -372,6 +407,29 @@ TEST_CASE_METHOD(TestFixture, "ECDSA get public key", "[ecdsa-get-pub-key]") {
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"ECDSA AES get public key"
,
"[ecdsa-aes-get-pub-key]"
)
{
int
errStatus
=
0
;
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
vector
<
uint8_t
>
encPrivKey
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyX
(
BUF_LEN
,
0
);
vector
<
char
>
pubKeyY
(
BUF_LEN
,
0
);
uint32_t
encLen
=
0
;
status
=
trustedGenerateEcdsaKeyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encPrivKey
.
data
(),
&
encLen
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
receivedPubKeyX
(
BUF_LEN
,
0
);
vector
<
char
>
receivedPubKeyY
(
BUF_LEN
,
0
);
status
=
trustedGetPublicEcdsaKeyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encPrivKey
.
data
(),
encLen
,
receivedPubKeyX
.
data
(),
receivedPubKeyY
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
/* Do later
...
...
@@ -444,6 +502,7 @@ TEST_CASE_METHOD(TestFixture, "DKG gen test", "[dkg-gen]") {
status
=
trustedGenDkgSecret
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
32
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
secret
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
...
...
@@ -453,8 +512,30 @@ TEST_CASE_METHOD(TestFixture, "DKG gen test", "[dkg-gen]") {
(
uint8_t
*
)
secret
.
data
(),
&
dec_len
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG AES gen test"
,
"[dkg-aes-gen]"
)
{
vector
<
uint8_t
>
encryptedDKGSecret
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
uint32_t
encLen
=
0
;
status
=
trustedGenDkgSecretAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
32
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
secret
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
uint32_t
dec_len
;
status
=
trustedDecryptDkgSecretAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
(
uint8_t
*
)
secret
.
data
(),
&
dec_len
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG public shares test"
,
"[dkg-pub-shares]"
)
{
vector
<
uint8_t
>
encryptedDKGSecret
(
BUF_LEN
,
0
);
...
...
@@ -467,6 +548,7 @@ TEST_CASE_METHOD(TestFixture, "DKG public shares test", "[dkg-pub-shares]") {
status
=
trustedGenDkgSecret
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
n
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
...
...
@@ -489,6 +571,7 @@ TEST_CASE_METHOD(TestFixture, "DKG public shares test", "[dkg-pub-shares]") {
status
=
trustedDecryptDkgSecret
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
(
uint8_t
*
)
secret
.
data
(),
&
encLen
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
signatures
::
Dkg
dkgObj
(
t
,
n
);
...
...
@@ -507,6 +590,58 @@ TEST_CASE_METHOD(TestFixture, "DKG public shares test", "[dkg-pub-shares]") {
REQUIRE
(
pubSharesG2
==
pubSharesDkg
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG AES public shares test"
,
"[dkg-aes-pub-shares]"
)
{
vector
<
uint8_t
>
encryptedDKGSecret
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
uint32_t
encLen
=
0
;
unsigned
t
=
32
,
n
=
32
;
status
=
trustedGenDkgSecretAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
n
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
char
colon
=
':'
;
vector
<
char
>
pubShares
(
10000
,
0
);
status
=
trustedGetPublicSharesAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
encLen
,
pubShares
.
data
(),
t
,
n
);
vector
<
string
>
g2Strings
=
splitString
(
pubShares
.
data
(),
','
);
vector
<
libff
::
alt_bn128_G2
>
pubSharesG2
;
for
(
u_int64_t
i
=
0
;
i
<
g2Strings
.
size
();
i
++
)
{
vector
<
string
>
coeffStr
=
splitString
(
g2Strings
.
at
(
i
).
c_str
(),
':'
);
pubSharesG2
.
push_back
(
vectStringToG2
(
coeffStr
));
}
vector
<
char
>
secret
(
BUF_LEN
,
0
);
status
=
trustedDecryptDkgSecretAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
(
uint8_t
*
)
secret
.
data
(),
&
encLen
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
signatures
::
Dkg
dkgObj
(
t
,
n
);
vector
<
libff
::
alt_bn128_Fr
>
poly
=
splitStringToFr
(
secret
.
data
(),
colon
);
vector
<
libff
::
alt_bn128_G2
>
pubSharesDkg
=
dkgObj
.
VerificationVector
(
poly
);
for
(
uint32_t
i
=
0
;
i
<
pubSharesDkg
.
size
();
i
++
)
{
libff
::
alt_bn128_G2
el
=
pubSharesDkg
.
at
(
i
);
el
.
to_affine_coordinates
();
libff
::
alt_bn128_Fq
x_c0_el
=
el
.
X
.
c0
;
mpz_t
x_c0
;
mpz_init
(
x_c0
);
x_c0_el
.
as_bigint
().
to_mpz
(
x_c0
);
mpz_clear
(
x_c0
);
}
REQUIRE
(
pubSharesG2
==
pubSharesDkg
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG encrypted secret shares test"
,
"[dkg-encr-sshares]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
...
...
@@ -518,10 +653,12 @@ TEST_CASE_METHOD(TestFixture, "DKG encrypted secret shares test", "[dkg-encr-ssh
vector
<
uint8_t
>
encryptedDKGSecret
(
BUF_LEN
,
0
);
status
=
trustedGenDkgSecret
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
2
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
status
=
trustedSetEncryptedDkgPoly
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
uint8_t
>
encrPRDHKey
(
BUF_LEN
,
0
);
...
...
@@ -533,6 +670,38 @@ TEST_CASE_METHOD(TestFixture, "DKG encrypted secret shares test", "[dkg-encr-ssh
(
char
*
)
pub_keyB
.
data
(),
2
,
2
,
1
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG AES encrypted secret shares test"
,
"[dkg-aes-encr-sshares]"
)
{
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
vector
<
char
>
result
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
uint32_t
encLen
=
0
;
vector
<
uint8_t
>
encryptedDKGSecret
(
BUF_LEN
,
0
);
status
=
trustedGenDkgSecretAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
encLen
,
2
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
uint64_t
enc_len
=
encLen
;
status
=
trustedSetEncryptedDkgPolyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
enc_len
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
uint8_t
>
encrPRDHKey
(
BUF_LEN
,
0
);
string
pub_keyB
=
SAMPLE_PUBLIC_KEY_B
;
vector
<
char
>
s_shareG2
(
BUF_LEN
,
0
);
status
=
trustedGetEncryptedSecretShareAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPRDHKey
.
data
(),
&
encLen
,
result
.
data
(),
s_shareG2
.
data
(),
(
char
*
)
pub_keyB
.
data
(),
2
,
2
,
1
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
}
...
...
@@ -666,7 +835,6 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
REQUIRE
(
common_public
.
VerifySigWithHelper
(
hash_arr
,
commonSig
,
t
,
n
));
}
TEST_CASE_METHOD
(
TestFixture
,
"Get ServerStatus"
,
"[get-server-status]"
)
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
...
...
@@ -699,8 +867,6 @@ TEST_CASE_METHOD(TestFixtureHTTPS, "Cert request sign", "[cert-sign]") {
REQUIRE
(
result
[
"status"
]
!=
0
);
}
TEST_CASE_METHOD
(
TestFixture
,
"DKG API test"
,
"[dkg-api]"
)
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
...
...
@@ -894,7 +1060,6 @@ TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
}
TEST_CASE_METHOD
(
TestFixture
,
"SGX encrypt/decrypt"
,
"[sgx-encrypt-decrypt]"
)
{
int
errStatus
=
-
1
;
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
...
...
@@ -916,7 +1081,6 @@ TEST_CASE_METHOD(TestFixture, "SGX encrypt/decrypt", "[sgx-encrypt-decrypt]") {
REQUIRE
(
key
.
compare
(
decr_key
.
data
())
==
0
);
}
TEST_CASE_METHOD
(
TestFixture
,
"Many threads ecdsa dkg bls"
,
"[many-threads-crypto]"
)
{
vector
<
thread
>
threads
;
int
num_threads
=
4
;
...
...
testw.py
View file @
fb830e75
...
...
@@ -33,18 +33,24 @@ testList = [ "[cert-sign]",
"[get-server-status]"
,
"[get-server-version]"
,
"[ecdsa-key-gen]"
,
"[ecdsa-aes-key-gen]"
,
"[ecdsa-key-sig-gen]"
,
"[ecdsa-aes-key-sig-gen]"
,
"[ecdsa-get-pub-key]"
,
"[ecdsa-aes-get-pub-key]"
,
"[ecdsa-key-gen-api]"
,
"[ecdsa-key-gen-sign-api]"
,
"[bls-key-encrypt]"
,
"[dkg-gen]"
,
#"[dkg-aes-gen]", <- fix it
"[dkg-encr-sshares]"
,
"[dkg-aes-encr-sshares]"
,
"[dkg-verify]"
,
"[dkg-api]"
,
"[dkg-bls]"
,
"[dkg-poly-exists]"
,
"[dkg-pub-shares]"
,
#"[dkg-aes-pub-shares]", <- fix it
"[many-threads-crypto]"
,
"[aes-encrypt-decrypt]"
,
"[sgx-encrypt-decrypt]"
,
...
...
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