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
1b12bcfd
Unverified
Commit
1b12bcfd
authored
Nov 19, 2019
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-1795 GetPublicBLSKey fixed
parent
93b8db50
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
258 additions
and
101 deletions
+258
-101
BLSPrivateKeyShareSGX.cpp
BLSPrivateKeyShareSGX.cpp
+2
-1
DKGCrypto.cpp
DKGCrypto.cpp
+33
-17
DKGCrypto.h
DKGCrypto.h
+1
-2
SGXWalletServer.cpp
SGXWalletServer.cpp
+15
-10
ServerDataChecker.cpp
ServerDataChecker.cpp
+21
-0
ServerDataChecker.h
ServerDataChecker.h
+8
-0
ServerInit.cpp
ServerInit.cpp
+4
-1
abstractstubserver.h
abstractstubserver.h
+8
-2
BLSEnclave.cpp
secure_enclave/BLSEnclave.cpp
+8
-2
DKGUtils.cpp
secure_enclave/DKGUtils.cpp
+46
-15
DKGUtils.h
secure_enclave/DKGUtils.h
+3
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+45
-32
secure_enclave.edl
secure_enclave/secure_enclave.edl
+4
-2
sgxwallet_common.h
sgxwallet_common.h
+1
-1
spec.json
spec.json
+2
-2
stubclient.h
stubclient.h
+15
-1
testw.cpp
testw.cpp
+40
-12
bigint.hpp
trusted_libff/libff/algebra/fields/bigint.hpp
+2
-0
No files found.
BLSPrivateKeyShareSGX.cpp
View file @
1b12bcfd
...
...
@@ -165,7 +165,7 @@ std::string BLSPrivateKeyShareSGX::signWithHelperSGXstr(
// strncpy(signature, "8175162913343900215959836578795929492705714455632345516427532159927644835012:15265825550804683171644566522808807137117748565649051208189914766494241035855", 1024);
printf
(
"
---
: %s
\n
"
,
signature
);
printf
(
"
sig is
: %s
\n
"
,
signature
);
if
(
status
!=
SGX_SUCCESS
)
{
...
...
@@ -301,6 +301,7 @@ std::shared_ptr<BLSSigShare> BLSPrivateKeyShareSGX::signWithHelperSGX(
std
::
string
signature
=
signWithHelperSGXstr
(
hash_byte_arr
,
_signerIndex
);
auto
sig
=
make_shared
<
string
>
(
signature
);
//BLSSigShare* sig_test = new BLSSigShare(sig, _signerIndex, requiredSigners, totalSigners);
...
...
DKGCrypto.cpp
View file @
1b12bcfd
...
...
@@ -9,6 +9,7 @@
#include <memory>
#include "SGXWalletServer.hpp"
#include "RPCException.h"
#include <../trusted_libff/libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
#include <../trusted_libff/libff/algebra/fields/fp.hpp>
...
...
@@ -128,22 +129,25 @@ std::string get_secret_shares(const std::string& polyName, const char* encrypted
uint32_t
dec_len
;
char
cur_share
[
193
];
char
s_shareG2
[
320
];
std
::
string
pub_keyB
=
publicKeys
.
at
(
i
);
//publicKeys.substr(128*i, 128*i + 128);
std
::
cerr
<<
"pub_keyB is "
<<
pub_keyB
<<
std
::
endl
;
char
pubKeyB
[
129
];
strncpy
(
pubKeyB
,
pub_keyB
.
c_str
(),
128
);
pubKeyB
[
128
]
=
0
;
get_encr_sshare
(
eid
,
&
err_status
,
errMsg1
,
encrypted_skey
,
&
dec_len
,
cur_share
,
pubKeyB
,
t
,
n
,
i
+
1
);
cur_share
,
s_shareG2
,
pubKeyB
,
t
,
n
,
i
+
1
);
result
+=
cur_share
;
uint32_t
enc_len
=
BUF_LEN
;
carray2Hex
(
encrypted_skey
,
enc_len
,
hexEncrKey
);
//std::cerr << "hexEncrKey: " << hexEncrKey << std::endl;
std
::
string
name
=
"DKG_DH_KEY_"
+
polyName
+
"_"
+
std
::
to_string
(
i
)
+
":"
;
//writeDataToDB(name, hexEncrKey);
std
::
cerr
<<
"name to write to db is "
<<
name
<<
std
::
endl
;
std
::
cerr
<<
"hexEncrKey: "
<<
hexEncrKey
<<
std
::
endl
;
// writeDataToDB(name, hexEncrKey);
std
::
cerr
<<
errMsg1
<<
std
::
endl
<<
std
::
endl
;
//std::cerr << "iteration " << i <<" result length is " << result.length() << std::endl ;
...
...
@@ -197,9 +201,10 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const
uint8_t
encr_bls_key
[
BUF_LEN
];
uint8_t
encr_key
[
BUF_LEN
];
hex2carray
(
encryptedKeyHex
,
&
dec_key_len
,
encr_key
);
uint32_t
enc_bls_len
=
0
;
//std::cerr << " key hex is " << encryptedKeyHex << std::endl;
create_bls_key
(
eid
,
&
err_status
,
errMsg1
,
s_shares
,
encr_key
,
dec_key_len
,
encr_bls_key
);
create_bls_key
(
eid
,
&
err_status
,
errMsg1
,
s_shares
,
encr_key
,
dec_key_len
,
encr_bls_key
,
&
enc_bls_len
);
std
::
cerr
<<
"er msg is "
<<
errMsg1
<<
std
::
endl
;
if
(
err_status
!=
0
){
...
...
@@ -207,16 +212,19 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const
}
else
{
char
*
hexBLSKey
=
(
char
*
)
calloc
(
2
*
BUF_LEN
,
1
);
uint32_t
enc_len
=
BUF_LEN
;
carray2Hex
(
encr_bls_key
,
enc_len
,
hexBLSKey
);
writeDataToDB
(
BLSKeyName
,
hexBLSKey
);
std
::
cerr
<<
"enc_bls_len "
<<
enc_bls_len
<<
std
::
endl
;
carray2Hex
(
encr_bls_key
,
enc_bls_len
,
hexBLSKey
);
writeDataToDB
(
BLSKeyName
,
hexBLSKey
);
std
::
cerr
<<
"hexBLSKey length is "
<<
strlen
(
hexBLSKey
)
<<
std
::
endl
;
std
::
cerr
<<
"bls key "
<<
BLSKeyName
<<
" is "
<<
hexBLSKey
<<
std
::
endl
;
free
(
hexBLSKey
);
return
true
;
}
}
std
::
string
GetBLSPubKey
(
const
char
*
encryptedKeyHex
){
std
::
vector
<
std
::
string
>
GetBLSPubKey
(
const
char
*
encryptedKeyHex
){
char
*
errMsg1
=
(
char
*
)
calloc
(
1024
,
1
);
int
err_status
=
0
;
...
...
@@ -224,11 +232,18 @@ std::string GetBLSPubKey(const char * encryptedKeyHex){
uint8_t
encr_bls_key
[
BUF_LEN
];
uint8_t
encr_key
[
BUF_LEN
];
hex2carray
(
encryptedKeyHex
,
&
dec_key_len
,
encr_key
);
// for ( int i = 0; i < BUF_LEN; i++ )
// std::cerr << encr_key[i] << " ";
char
pub_key
[
320
];
std
::
cerr
<<
"dec_key_len is "
<<
dec_key_len
<<
std
::
endl
;
get_bls_pub_key
(
eid
,
&
err_status
,
errMsg1
,
encr_key
,
dec_key_len
,
pub_key
);
std
::
string
result
=
pub_key
;
std
::
cerr
<<
"errMsg1 is "
<<
errMsg1
<<
std
::
endl
;
std
::
vector
<
std
::
string
>
pub_key_vect
=
SplitString
(
pub_key
,
':'
);
std
::
cerr
<<
"pub key is"
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
std
::
cerr
<<
pub_key_vect
.
at
(
i
)
<<
std
::
endl
;
return
pub_key_vect
;
}
std
::
pair
<
std
::
string
,
std
::
string
>
response_to_complaint
(
const
std
::
string
&
polyName
,
const
char
*
encryptedPolyHex
,
int
n
,
int
t
,
int
ind
){
...
...
@@ -241,10 +256,11 @@ std::pair<std::string, std::string> response_to_complaint(const std::string& pol
uint8_t
*
encr_dkg_poly
=
(
uint8_t
*
)
calloc
(
DKG_MAX_SEALED_LEN
,
1
);
hex2carray2
(
encryptedPolyHex
,
&
enc_len
,
encr_dkg_poly
,
6100
);
status
=
set_encrypted_dkg_poly
(
eid
,
&
err_status
,
errMsg1
,
encr_dkg_poly
);
std
::
string
DH_key_name
=
polyName
+
"_"
+
std
::
to_string
(
ind
)
+
":"
;
std
::
shared_ptr
<
std
::
string
>
hexEncrKey_ptr
=
readFromDb
(
DH_key_name
,
"DKG_DH_KEY_"
);
std
::
cerr
<<
"encr DH key is "
<<
hexEncrKey_ptr
<<
std
::
endl
;
char
*
hexEncrKey
=
(
char
*
)
calloc
(
2
*
BUF_LEN
,
1
);
...
...
@@ -255,25 +271,25 @@ std::pair<std::string, std::string> response_to_complaint(const std::string& pol
uint32_t
dec_len
;
char
decrpyted_DHkey
[
ECDSA_SKEY_LEN
];
char
s_shareG2
[
257
];
char
s_shareG2
[
320
];
//[
257];
status
=
complaint_response
(
eid
,
&
err_status
,
errMsg1
,
encrypted_DHkey
,
encr_dkg_poly
,
&
dec_len
,
decrpyted_DHkey
,
s_shareG2
,
t
,
n
,
ind
);
decrpyted_DHkey
,
s_shareG2
,
t
,
n
,
ind
);
std
::
pair
<
std
::
string
,
std
::
string
>
result
;
result
.
first
=
decrpyted_DHkey
;
result
.
second
=
s_shareG2
;
//
std::cerr << errMsg1 << std::endl << std::endl;
std
::
cerr
<<
errMsg1
<<
std
::
endl
<<
std
::
endl
;
//std::cerr << "iteration " << i <<" result length is " << result.length() << std::endl ;
//std::cerr << "iteration " << i <<" share length is " << strlen(cur_share) << std::endl;
//std::cerr << "iteration " << i <<" share is " << cur_share << std::endl;
//result += '\0';
free
(
encr_dkg_poly
);
free
(
errMsg1
);
free
(
hexEncrKey
);
return
result
;
}
\ No newline at end of file
}
DKGCrypto.h
View file @
1b12bcfd
...
...
@@ -22,8 +22,7 @@ std::pair<std::string, std::string> response_to_complaint(const std::string& pol
bool
CreateBLSShare
(
const
std
::
string
&
BLSKeyName
,
const
char
*
s_shares
,
const
char
*
encryptedKeyHex
);
std
::
string
GetBLSPubKey
(
const
char
*
encryptedKeyHex
);
std
::
vector
<
std
::
string
>
GetBLSPubKey
(
const
char
*
encryptedKeyHex
);
#endif //SGXD_DKGCRYPTO_H
SGXWalletServer.cpp
View file @
1b12bcfd
...
...
@@ -115,7 +115,7 @@ Json::Value blsSignMessageHashImpl(const std::string &keyShareName, const std::s
try
{
value
=
read
KeyShare
(
keyShareName
);
value
=
read
FromDb
(
keyShareName
);
}
catch
(
RPCException
_e
)
{
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
...
...
@@ -174,7 +174,8 @@ Json::Value generateECDSAKeyImpl() {
throw
RPCException
(
UNKNOWN_ERROR
,
""
);
}
// std::cerr << "write encr key" << keys.at(0) << std::endl;
std
::
string
keyName
=
"tmp_NEK:"
+
keys
.
at
(
2
);
std
::
cerr
<<
"encr key length is"
<<
keys
.
at
(
0
).
length
()
<<
std
::
endl
;
std
::
string
keyName
=
"NEK:"
+
keys
.
at
(
2
);
//writeECDSAKey(keyName, keys.at(0));
writeDataToDB
(
keyName
,
keys
.
at
(
0
));
...
...
@@ -409,7 +410,6 @@ Json::Value DKGVerificationImpl(const std::string& publicShares, const std::stri
Json
::
Value
CreateBLSPrivateKeyImpl
(
const
std
::
string
&
BLSKeyName
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
polyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
){
std
::
cerr
<<
"CreateBLSPrivateKeyImpl entered"
<<
std
::
endl
;
std
::
cerr
<<
" enter DKGVerificationImpl"
<<
std
::
endl
;
Json
::
Value
result
;
result
[
"status"
]
=
0
;
...
...
@@ -422,7 +422,7 @@ Json::Value CreateBLSPrivateKeyImpl(const std::string & BLSKeyName, const std::s
return
result
;
}
std
::
vector
<
std
::
string
>
sshares_vect
;
//std::cerr << "sshares are "
<< std::endl;
std
::
cerr
<<
"sshares are "
<<
SecretShare
<<
std
::
endl
;
char
sshares
[
192
*
n
+
1
];
for
(
int
i
=
0
;
i
<
n
;
i
++
){
std
::
string
cur_share
=
SecretShare
.
substr
(
192
*
i
,
192
*
i
+
192
);
...
...
@@ -469,8 +469,12 @@ Json::Value GetBLSPublicKeyShareImpl(const std::string & BLSKeyName){
try
{
std
::
shared_ptr
<
std
::
string
>
encryptedKeyHex_ptr
=
readFromDb
(
BLSKeyName
,
""
);
std
::
string
public_key
=
GetBLSPubKey
(
encryptedKeyHex_ptr
->
c_str
());
result
[
"BLSPublicKeyShare"
]
=
public_key
;
std
::
cerr
<<
"encr_bls_key_share is "
<<
*
encryptedKeyHex_ptr
<<
std
::
endl
;
std
::
cerr
<<
"length is "
<<
encryptedKeyHex_ptr
->
length
()
<<
std
::
endl
;
std
::
vector
<
std
::
string
>
public_key_vect
=
GetBLSPubKey
(
encryptedKeyHex_ptr
->
c_str
());
for
(
uint8_t
i
=
0
;
i
<
4
;
i
++
)
{
result
[
"BLSPublicKeyShare"
][
i
]
=
public_key_vect
.
at
(
i
);
}
}
catch
(
RPCException
&
_e
)
{
std
::
cerr
<<
" err str "
<<
_e
.
errString
<<
std
::
endl
;
...
...
@@ -487,6 +491,7 @@ Json::Value ComplaintResponseImpl(const std::string& polyName, int n, int t, int
result
[
"errorMessage"
]
=
""
;
try
{
std
::
shared_ptr
<
std
::
string
>
encr_poly_ptr
=
readFromDb
(
polyName
,
"DKGPoly:"
);
std
::
cerr
<<
"encr_poly is "
<<
*
encr_poly_ptr
<<
std
::
endl
;
std
::
pair
<
std
::
string
,
std
::
string
>
response
=
response_to_complaint
(
polyName
,
encr_poly_ptr
->
c_str
(),
n
,
t
,
ind
);
result
[
"share*G2"
]
=
response
.
second
;
...
...
@@ -622,7 +627,7 @@ void writeKeyShare(const string &_keyShareName, const string &value, int index,
auto
key
=
"BLSKEYSHARE:"
+
_keyShareName
;
if
(
levelDb
->
readString
(
_keyShareName
)
!=
nullptr
)
{
throw
new
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Key share with this name already exists"
);
throw
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Key share with this name already exists"
);
}
levelDb
->
writeString
(
key
,
value
);
...
...
@@ -648,7 +653,7 @@ void writeECDSAKey(const string &_keyName, const string &value) {
auto
key
=
"ECDSAKEY:"
+
_keyName
;
if
(
levelDb
->
readString
(
_keyName
)
!=
nullptr
)
{
throw
new
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Key with this name already exists"
);
throw
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Key with this name already exists"
);
}
levelDb
->
writeString
(
key
,
value
);
...
...
@@ -664,7 +669,7 @@ void writeDKGPoly(const string &_polyName, const string &value) {
auto
key
=
"DKGPoly:"
+
_polyName
;
if
(
levelDb
->
readString
(
_polyName
)
!=
nullptr
)
{
throw
new
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Poly with this name already exists"
);
throw
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Poly with this name already exists"
);
}
levelDb
->
writeString
(
key
,
value
);
...
...
@@ -681,7 +686,7 @@ void writeDataToDB(const string & Name, const string &value) {
if
(
levelDb
->
readString
(
Name
)
!=
nullptr
)
{
std
::
cerr
<<
"name "
<<
Name
<<
" already exists"
<<
std
::
endl
;
throw
new
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Data with this name already exists"
);
throw
RPCException
(
KEY_SHARE_ALREADY_EXISTS
,
"Data with this name already exists"
);
}
levelDb
->
writeString
(
key
,
value
);
...
...
ServerDataChecker.cpp
0 → 100644
View file @
1b12bcfd
//
// Created by kladko on 11/19/19.
//
std
::
vector
<
std
::
string
>
BLSutils
::
SplitString
(
std
::
string
&
str
,
const
std
::
string
&
delim
){
std
::
vector
<
std
::
string
>
tokens
;
size_t
prev
=
0
,
pos
=
0
;
do
{
pos
=
str
.
find
(
delim
,
prev
);
if
(
pos
==
std
::
string
::
npos
)
pos
=
str
.
length
();
std
::
string
token
=
str
.
substr
(
prev
,
pos
-
prev
);
if
(
!
token
.
empty
())
tokens
.
push_back
(
token
);
prev
=
pos
+
delim
.
length
();
}
while
(
pos
<
str
.
length
()
&&
prev
<
str
.
length
());
return
tokens
;
}
bool
checkPolyName
(
std
::
string
polyName
){
}
\ No newline at end of file
ServerDataChecker.h
0 → 100644
View file @
1b12bcfd
//
// Created by kladko on 11/19/19.
//
#ifndef SGXD_SERVERDATACHECKER_H
#define SGXD_SERVERDATACHECKER_H
#endif // SGXD_SERVERDATACHECKER_H
ServerInit.cpp
View file @
1b12bcfd
...
...
@@ -30,7 +30,7 @@
#include "BLSCrypto.h"
#include "ServerInit.h"
#include <iostream>
...
...
@@ -42,6 +42,7 @@ void init_daemon() {
static
std
::
string
dbName
(
"./"
WALLETDB_NAME
);
levelDb
=
new
LevelDB
(
dbName
);
}
...
...
@@ -63,6 +64,8 @@ void init_enclave() {
}
#endif
std
::
cerr
<<
"SGX_DEBUG_FLAG = "
<<
SGX_DEBUG_FLAG
<<
std
::
endl
;
status
=
sgx_create_enclave_search
(
ENCLAVE_NAME
,
SGX_DEBUG_FLAG
,
&
token
,
&
updated
,
&
eid
,
0
);
...
...
abstractstubserver.h
View file @
1b12bcfd
...
...
@@ -27,8 +27,9 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
this
->
bindAndAddMethod
(
jsonrpc
::
Procedure
(
"DKGVerification"
,
jsonrpc
::
PARAMS_BY_NAME
,
jsonrpc
::
JSON_OBJECT
,
"publicShares"
,
jsonrpc
::
JSON_STRING
,
"EthKeyName"
,
jsonrpc
::
JSON_STRING
,
"SecretShare"
,
jsonrpc
::
JSON_STRING
,
"t"
,
jsonrpc
::
JSON_INTEGER
,
"n"
,
jsonrpc
::
JSON_INTEGER
,
"index"
,
jsonrpc
::
JSON_INTEGER
,
NULL
),
&
AbstractStubServer
::
DKGVerificationI
);
this
->
bindAndAddMethod
(
jsonrpc
::
Procedure
(
"CreateBLSPrivateKey"
,
jsonrpc
::
PARAMS_BY_NAME
,
jsonrpc
::
JSON_OBJECT
,
"BLSKeyName"
,
jsonrpc
::
JSON_STRING
,
"EthKeyName"
,
jsonrpc
::
JSON_STRING
,
"polyName"
,
jsonrpc
::
JSON_STRING
,
"SecretShare"
,
jsonrpc
::
JSON_STRING
,
"t"
,
jsonrpc
::
JSON_INTEGER
,
"n"
,
jsonrpc
::
JSON_INTEGER
,
NULL
),
&
AbstractStubServer
::
CreateBLSPrivateKeyI
);
this
->
bindAndAddMethod
(
jsonrpc
::
Procedure
(
"GetBLSPublicKeyShare"
,
jsonrpc
::
PARAMS_BY_NAME
,
jsonrpc
::
JSON_OBJECT
,
"BLSKeyName"
,
jsonrpc
::
JSON_STRING
,
NULL
),
&
AbstractStubServer
::
GetBLSPublicKeyShareI
);
this
->
bindAndAddMethod
(
jsonrpc
::
Procedure
(
"ComplaintResponse"
,
jsonrpc
::
PARAMS_BY_NAME
,
jsonrpc
::
JSON_OBJECT
,
"polyName"
,
jsonrpc
::
JSON_STRING
,
"n"
,
jsonrpc
::
JSON_INTEGER
,
"t"
,
jsonrpc
::
JSON_INTEGER
,
"ind"
,
jsonrpc
::
JSON_INTEGER
,
NULL
),
&
AbstractStubServer
::
ComplaintResponseI
);
}
}
inline
virtual
void
importBLSKeyShareI
(
const
Json
::
Value
&
request
,
Json
::
Value
&
response
)
{
...
...
@@ -36,7 +37,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
}
inline
virtual
void
blsSignMessageHashI
(
const
Json
::
Value
&
request
,
Json
::
Value
&
response
)
{
response
=
this
->
blsSignMessageHash
(
request
[
"keyShareName"
].
asString
(),
request
[
"messageHash"
].
asString
(),
request
[
"n"
].
asInt
(),
request
[
"
signerIndex"
].
asInt
(),
request
[
"t
"
].
asInt
());
response
=
this
->
blsSignMessageHash
(
request
[
"keyShareName"
].
asString
(),
request
[
"messageHash"
].
asString
(),
request
[
"n"
].
asInt
(),
request
[
"
t"
].
asInt
(),
request
[
"signerIndex
"
].
asInt
());
}
inline
virtual
void
importECDSAKeyI
(
const
Json
::
Value
&
request
,
Json
::
Value
&
response
)
{
...
...
@@ -83,6 +84,10 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
{
response
=
this
->
GetBLSPublicKeyShare
(
request
[
"BLSKeyName"
].
asString
());
}
inline
virtual
void
ComplaintResponseI
(
const
Json
::
Value
&
request
,
Json
::
Value
&
response
)
{
response
=
this
->
ComplaintResponse
(
request
[
"polyName"
].
asString
(),
request
[
"n"
].
asInt
(),
request
[
"t"
].
asInt
(),
request
[
"ind"
].
asInt
());
}
virtual
Json
::
Value
importBLSKeyShare
(
int
index
,
const
std
::
string
&
keyShare
,
const
std
::
string
&
keyShareName
,
int
n
,
int
t
)
=
0
;
virtual
Json
::
Value
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
,
int
n
,
int
signerIndex
,
int
t
)
=
0
;
...
...
@@ -98,6 +103,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
virtual
Json
::
Value
DKGVerification
(
const
std
::
string
&
publicShares
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
,
int
index
)
=
0
;
virtual
Json
::
Value
CreateBLSPrivateKey
(
const
std
::
string
&
BLSKeyName
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
polyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
)
=
0
;
virtual
Json
::
Value
GetBLSPublicKeyShare
(
const
std
::
string
&
BLSKeyName
)
=
0
;
virtual
Json
::
Value
ComplaintResponse
(
const
std
::
string
&
polyName
,
int
n
,
int
t
,
int
ind
)
=
0
;
};
#endif //JSONRPC_CPP_STUB_ABSTRACTSTUBSERVER_H_
secure_enclave/BLSEnclave.cpp
View file @
1b12bcfd
...
...
@@ -61,9 +61,15 @@ std::string *stringFromG1(libff::alt_bn128_G1 *_g1) {
}
libff
::
alt_bn128_Fr
*
keyFromString
(
const
char
*
_keyString
)
{
libff
::
alt_bn128_Fr
*
keyFromString
(
const
char
*
_keyStringHex
)
{
mpz_t
skey
;
mpz_init
(
skey
);
mpz_set_str
(
skey
,
_keyStringHex
,
16
);
return
new
libff
::
alt_bn128_Fr
(
_keyString
);
char
skey_dec
[
mpz_sizeinbase
(
skey
,
10
)
+
2
];
char
*
skey_str
=
mpz_get_str
(
skey_dec
,
10
,
skey
);
return
new
libff
::
alt_bn128_Fr
(
skey_dec
);
}
...
...
secure_enclave/DKGUtils.cpp
View file @
1b12bcfd
...
...
@@ -104,15 +104,16 @@ void gen_dkg_poly( char* secret, unsigned _t ){
libff
::
alt_bn128_Fr
PolynomialValue
(
const
std
::
vector
<
libff
::
alt_bn128_Fr
>&
pol
,
libff
::
alt_bn128_Fr
point
,
unsigned
_t
)
{
libff
::
alt_bn128_Fr
value
=
libff
::
alt_bn128_Fr
::
zero
();
libff
::
alt_bn128_Fr
pow
=
libff
::
alt_bn128_Fr
::
one
();
for
(
size_t
i
=
0
;
i
<
_t
;
++
i
)
{
if
(
i
==
_t
-
1
&&
pol
[
i
]
==
libff
::
alt_bn128_Fr
::
zero
())
{
//snprintf(err_string, BUF_LEN,"sgx_unseal_data failed with status
}
value
+=
pol
[
i
]
*
pow
;
pow
*=
point
;
for
(
unsigned
i
=
0
;
i
<
pol
.
size
()
;
++
i
)
{
//
if (i == _t - 1 && pol[i] == libff::alt_bn128_Fr::zero()) {
//
//snprintf(err_string, BUF_LEN,"sgx_unseal_data failed with status
//
}
value
+=
pol
[
i
]
*
pow
;
pow
*=
point
;
}
return
value
;
...
...
@@ -149,11 +150,16 @@ void calc_secret_share(const char* decrypted_koefs, char * s_share,
}
void
calc_secret_shareG2
(
const
char
*
decrypted_koefs
,
char
*
s_shareG2
,
void
calc_secret_shareG2
_old
(
const
char
*
decrypted_koefs
,
char
*
s_shareG2
,
unsigned
_t
,
unsigned
ind
){
libff
::
init_alt_bn128_params
();
char
symbol
=
':'
;
std
::
vector
<
libff
::
alt_bn128_Fr
>
poly
=
SplitStringToFr
(
decrypted_koefs
,
symbol
);
// if ( poly.size() != _t){
// //"t != poly.size()" +
// //strncpy(s_shareG2, std::to_string(poly.size()).c_str(), 18);
// }
libff
::
alt_bn128_Fr
secret_share
=
PolynomialValue
(
poly
,
libff
::
alt_bn128_Fr
(
ind
),
_t
);
...
...
@@ -161,7 +167,27 @@ void calc_secret_shareG2(const char* decrypted_koefs, char * s_shareG2,
std
::
string
secret_shareG2_str
=
ConvertG2ToString
(
secret_shareG2
);
strncpy
(
s_shareG2
,
secret_shareG2_str
.
c_str
(),
secret_shareG2_str
.
length
());
strncpy
(
s_shareG2
,
secret_shareG2_str
.
c_str
(),
secret_shareG2_str
.
length
()
+
1
);
//strncpy(s_shareG2, decrypted_koefs, 320);
}
void
calc_secret_shareG2
(
const
char
*
s_share
,
char
*
s_shareG2
){
libff
::
init_alt_bn128_params
();
mpz_t
share
;
mpz_init
(
share
);
mpz_set_str
(
share
,
s_share
,
16
);
char
arr
[
mpz_sizeinbase
(
share
,
10
)
+
2
];
char
*
share_str
=
mpz_get_str
(
arr
,
10
,
share
);
libff
::
alt_bn128_Fr
secret_share
(
share_str
);
libff
::
alt_bn128_G2
secret_shareG2
=
secret_share
*
libff
::
alt_bn128_G2
::
one
();
std
::
string
secret_shareG2_str
=
ConvertG2ToString
(
secret_shareG2
);
strncpy
(
s_shareG2
,
secret_shareG2_str
.
c_str
(),
secret_shareG2_str
.
length
()
+
1
);
}
void
calc_public_shares
(
const
char
*
decrypted_koefs
,
char
*
public_shares
,
...
...
@@ -238,11 +264,6 @@ int Verification ( char * public_shares, mpz_t decr_secret_share, int _t, int in
char
*
tmp
=
mpz_get_str
(
arr
,
10
,
decr_secret_share
);
libff
::
alt_bn128_Fr
sshare
(
tmp
);
// strncpy(public_shares, tmp, strlen(tmp));
// std::string res = ConvertHexToDec("fe43567238abcdef98760");
// strncpy(public_shares, res.c_str(), res.length());
...
...
@@ -273,8 +294,18 @@ int Verification ( char * public_shares, mpz_t decr_secret_share, int _t, int in
}
void
calc_bls_public_key
(
char
*
skey
,
char
*
pub_key
){
libff
::
alt_bn128_Fr
bls_skey
(
skey
);
void
calc_bls_public_key
(
char
*
skey_hex
,
char
*
pub_key
){
libff
::
init_alt_bn128_params
();
mpz_t
skey
;
mpz_init
(
skey
);
mpz_set_str
(
skey
,
skey_hex
,
16
);
char
skey_dec
[
mpz_sizeinbase
(
skey
,
10
)
+
2
];
char
*
skey_str
=
mpz_get_str
(
skey_dec
,
10
,
skey
);
libff
::
alt_bn128_Fr
bls_skey
(
skey_dec
);
libff
::
alt_bn128_G2
public_key
=
bls_skey
*
libff
::
alt_bn128_G2
::
one
();
public_key
.
to_affine_coordinates
();
...
...
secure_enclave/DKGUtils.h
View file @
1b12bcfd
...
...
@@ -28,7 +28,9 @@ EXTERNC int Verification ( char * public_shares, mpz_t decr_secret_share, int _t
EXTERNC
void
calc_bls_public_key
(
char
*
skey
,
char
*
pub_key
);
EXTERNC
void
calc_secret_shareG2
(
const
char
*
public_shares
,
char
*
s_shareG2
,
EXTERNC
void
calc_secret_shareG2
_old
(
const
char
*
public_shares
,
char
*
s_shareG2
,
unsigned
_t
,
unsigned
ind
);
EXTERNC
void
calc_secret_shareG2
(
const
char
*
s_share
,
char
*
s_shareG2
);
#endif //SGXD_DKGUTILS_H
secure_enclave/secure_enclave.c
View file @
1b12bcfd
...
...
@@ -332,7 +332,6 @@ void decrypt_key(int *err_status, char *err_string, uint8_t *encrypted_key,
init
();
uint32_t
decLen
;
*
err_status
=
-
9
;
...
...
@@ -345,9 +344,10 @@ void decrypt_key(int *err_status, char *err_string, uint8_t *encrypted_key,
return
;
}
//snprintf(err_string, BUF_LEN, "decr key is %s", key);
if
(
decLen
!=
MAX_KEY_LENGTH
)
{
snprintf
(
err_string
,
BUF_LEN
,
"decLen != MAX_KEY_LENGTH"
);
if
(
decLen
>
MAX_KEY_LENGTH
)
{
snprintf
(
err_string
,
BUF_LEN
,
"
wrong decLen"
);
//"
decLen != MAX_KEY_LENGTH");
return
;
}
...
...
@@ -364,12 +364,14 @@ void decrypt_key(int *err_status, char *err_string, uint8_t *encrypted_key,
// check that key is padded with 0s
for
(
int
i
=
keyLen
;
i
<
MAX_KEY_LENGTH
;
i
++
)
{
if
(
key
[
i
]
!=
0
)
{
snprintf
(
err_string
,
BUF_LEN
,
"Unpadded key"
);
return
;
}
}
// for (int i = keyLen; i < MAX_KEY_LENGTH; i++) {
// if (key[i] != 0) {
// snprintf(err_string, BUF_LEN, "Unpadded key");
// return;
// }
// }
//strncpy(key, "2f993bb09f16c402a27dae868c02791bca7fcf564f1c9e2ba50b142b843a4b60", BUF_LEN);
*
err_status
=
0
;
return
;
...
...
@@ -392,9 +394,12 @@ void bls_sign_message(int *err_status, char *err_string, uint8_t *encrypted_key,
decrypt_key
(
err_status
,
err_string
,
encrypted_key
,
enc_len
,
key
);
if
(
*
err_status
!=
0
)
{
strncpy
(
signature
,
err_string
,
BUF_LEN
);
return
;
}
enclave_sign
(
key
,
_hashX
,
_hashY
,
sig
);
strncpy
(
signature
,
sig
,
BUF_LEN
);
...
...
@@ -435,7 +440,7 @@ void decrypt_dkg_secret (int *err_status, char* err_string, uint8_t* encrypted_d
(
const
sgx_sealed_data_t
*
)
encrypted_dkg_secret
,
NULL
,
0
,
decrypted_dkg_secret
,
&
decr_len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data
- encrypted_dkg_secret
failed with status %d"
,
status
);
return
;
}
...
...
@@ -455,7 +460,7 @@ void get_secret_shares(int *err_status, char* err_string, uint8_t* encrypted_dkg
// (const sgx_sealed_data_t *)encrypted_dkg_secret, NULL, 0, (uint8_t*)decrypted_dkg_secret, &decr_len);
if
(
*
err_status
!=
0
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
*
err_status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data
- encrypted_dkg_secret
failed with status %d"
,
*
err_status
);
return
;
}
...
...
@@ -493,7 +498,7 @@ void ecdsa_sign1(int *err_status, char *err_string, uint8_t *encrypted_key, uint
(
const
sgx_sealed_data_t
*
)
encrypted_key
,
NULL
,
0
,
skey
,
&
dec_len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed
- encrypted_key
with status %d"
,
status
);
return
;
}
...
...
@@ -561,14 +566,14 @@ void set_encrypted_dkg_poly(int *err_status, char *err_string, uint8_t* encrypte
(
const
sgx_sealed_data_t
*
)
encrypted_poly
,
NULL
,
0
,
Decrypted_dkg_poly
,
&
decr_len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data
- encrypted_poly
failed with status %d"
,
status
);
return
;
}
}
void
get_encr_sshare
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_skey
,
uint32_t
*
dec_len
,
char
*
result_str
,
char
*
pub_keyB
,
uint8_t
_t
,
uint8_t
_n
,
uint8_t
ind
){
char
*
result_str
,
char
*
s_shareG2
,
char
*
pub_keyB
,
uint8_t
_t
,
uint8_t
_n
,
uint8_t
ind
){
char
skey
[
ECDSA_SKEY_LEN
];
char
*
pub_key_x
=
(
char
*
)
calloc
(
1024
,
1
);
...
...
@@ -583,7 +588,7 @@ void get_encr_sshare(int *err_status, char *err_string, uint8_t *encrypted_skey,
(
const
sgx_sealed_data_t
*
)
encrypted_skey
,
NULL
,
0
,
(
uint8_t
*
)
skey
,
&
enc_len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed
- encrypted_skey
with status %d"
,
status
);
return
;
}
snprintf
(
err_string
,
BUF_LEN
,
"unsealed random skey is %s
\n
"
,
skey
);
...
...
@@ -599,6 +604,8 @@ void get_encr_sshare(int *err_status, char *err_string, uint8_t *encrypted_skey,
calc_secret_share
(
Decrypted_dkg_poly
,
s_share
,
_t
,
_n
,
ind
);
snprintf
(
err_string
+
88
,
BUF_LEN
,
"
\n
secret share is %s"
,
s_share
);
calc_secret_shareG2
(
s_share
,
s_shareG2
);
char
*
cypher
=
(
char
*
)
malloc
(
65
);
xor_encrypt
(
common_key
,
s_share
,
cypher
);
//snprintf(err_string, BUF_LEN ,"cypher is %s length is %d", cypher, strlen(cypher));
...
...
@@ -623,22 +630,27 @@ void complaint_response(int *err_status, char *err_string, uint8_t *encrypted_DH
uint32_t
enc_len
;
sgx_status_t
status
=
sgx_unseal_data
(
(
const
sgx_sealed_data_t
*
)
encrypted_DHkey
,
NULL
,
0
,
(
uint8_t
*
)
DH_key
,
&
enc_len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data
failed with status %d"
,
status
);
return
;
}
//
sgx_status_t status = sgx_unseal_data(
//
(const sgx_sealed_data_t *)encrypted_DHkey, NULL, 0, (uint8_t *)DH_key, &enc_len);
//
if (status != SGX_SUCCESS) {
// snprintf(err_string, BUF_LEN,"sgx_unseal_data - encrypted_DHkey
failed with status %d", status);
//
return;
//
}
char
*
decrypted_dkg_secret
=
(
char
*
)
malloc
(
DKG_BUFER_LENGTH
);
uint32_t
decr_len
;
decrypt_dkg_secret
(
err_status
,
err_string
,
encrypted_dkg_secret
,
(
uint8_t
*
)
decrypted_dkg_secret
,
&
decr_len
);
if
(
*
err_status
!=
0
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
*
err_status
);
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data
- encrypted_dkg_secret
failed with status %d"
,
*
err_status
);
return
;
}
calc_secret_shareG2
(
decrypted_dkg_secret
,
s_shareG2
,
_t
,
ind1
);
calc_secret_shareG2_old
(
decrypted_dkg_secret
,
s_shareG2
,
_t
,
ind1
);
//snprintf(err_string, BUF_LEN,"poly:%s", decrypted_dkg_secret);
// snprintf(err_string, BUF_LEN,"what the fuck");
//snprintf(err_string, BUF_LEN,"s_shareG2:%s", s_shareG2);
free
(
decrypted_dkg_secret
);
}
...
...
@@ -686,7 +698,7 @@ void dkg_verification(int *err_status, char* err_string, const char * public_sha
}
void
create_bls_key
(
int
*
err_status
,
char
*
err_string
,
const
char
*
s_shares
,
uint8_t
*
encrypted_key
,
uint64_t
key_len
,
uint8_t
*
encr_bls_key
){
uint8_t
*
encrypted_key
,
uint64_t
key_len
,
uint8_t
*
encr_bls_key
,
uint32_t
*
enc_bls_key_len
){
//uint32_t dec_len = 625;
char
skey
[
ECDSA_SKEY_LEN
];
...
...
@@ -762,18 +774,19 @@ void create_bls_key(int *err_status, char* err_string, const char* s_shares,
mpz_mod
(
bls_key
,
sum
,
q
);
char
key_share
[
mpz_sizeinbase
(
bls_key
,
1
0
)
+
2
];
char
*
key
=
mpz_get_str
(
key_share
,
1
0
,
bls_key
);
char
key_share
[
mpz_sizeinbase
(
bls_key
,
1
6
)
+
2
];
char
*
key
=
mpz_get_str
(
key_share
,
1
6
,
bls_key
);
snprintf
(
err_string
,
BUF_LEN
,
"bls private key is %s"
,
key_share
);
uint32_t
sealedLen
=
sgx_calc_sealed_data_size
(
0
,
ECDSA_SKEY_LEN
);
status
=
sgx_seal_data
(
0
,
NULL
,
ECDSA_SKEY_LEN
,
(
uint8_t
*
)
key_share
,
sealedLen
,(
sgx_sealed_data_t
*
)
encr_bls_key
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"seal bls private key failed with status %d "
,
status
);
return
;
}
*
enc_bls_key_len
=
sealedLen
;
//snprintf(err_string, BUF_LEN,"sshare is %s", decr_sshare);
//snprintf(err_string, BUF_LEN,"encr_share is %s", encr_sshare);
//snprintf(err_string, BUF_LEN,"common_key is %s", common_key);
...
...
@@ -793,18 +806,18 @@ void create_bls_key(int *err_status, char* err_string, const char* s_shares,
void
get_bls_pub_key
(
int
*
err_status
,
char
*
err_string
,
uint8_t
*
encrypted_key
,
uint64_t
key_len
,
char
*
bls_pub_key
){
char
skey
[
ECDSA_SKEY_LEN
];
char
skey
_hex
[
ECDSA_SKEY_LEN
];
sgx_status_t
status
=
sgx_unseal_data
(
(
const
sgx_sealed_data_t
*
)
encrypted_key
,
NULL
,
0
,
(
uint8_t
*
)
skey
,
&
key_len
);
uint32_t
len
=
key_len
;
sgx_status_t
status
=
sgx_unseal_data
(
(
const
sgx_sealed_data_t
*
)
encrypted_key
,
NULL
,
0
,
(
uint8_t
*
)
skey_hex
,
&
len
);
if
(
status
!=
SGX_SUCCESS
)
{
snprintf
(
err_string
,
BUF_LEN
,
"sgx_unseal_data failed with status %d"
,
status
);
return
;
}
calc_bls_public_key
(
skey
,
bls_pub_key
);
calc_bls_public_key
(
skey_hex
,
bls_pub_key
);
}
...
...
secure_enclave/secure_enclave.edl
View file @
1b12bcfd
...
...
@@ -113,6 +113,7 @@ enclave {
[out, count = 1024] uint8_t *encrypted_skey,
[user_check] uint32_t* dec_len,
[out, count = 193] char* result_str,
[out, count = 320] char* s_shareG2,
[in, count = 129] char* pub_keyB,
uint8_t _t,
uint8_t _n,
...
...
@@ -135,7 +136,8 @@ enclave {
[in, count = 6145] const char* s_shares,
[in, count = 1024] uint8_t* encrypted_key,
uint64_t key_len,
[out, count = 1024] uint8_t * encr_bls_key);
[out, count = 1024] uint8_t * encr_bls_key,
[user_check] uint32_t *enc_bls_key_len);
public void get_bls_pub_key(
[user_check]int *err_status,
...
...
@@ -151,7 +153,7 @@ enclave {
[in, count = 3050] uint8_t *encrypted_dkg_secret,
[user_check] uint32_t* dec_len,
[out, count = 65] char* DH_key,
[out, count =
257
] char* s_shareG2,
[out, count =
320
] char* s_shareG2,
uint8_t _t,
uint8_t _n,
uint8_t ind1);
...
...
sgxwallet_common.h
View file @
1b12bcfd
...
...
@@ -46,7 +46,7 @@
#define COULD_NOT_ACCESS_DATABASE -9
#define NULL_DATABASE -10
#define WALLETDB_NAME
"sgxwallet.db"
#define WALLETDB_NAME
"sgxwallet.db" //"test_sgxwallet.db"//
#define ENCLAVE_NAME "secure_enclave.signed.so"
...
...
spec.json
View file @
1b12bcfd
...
...
@@ -98,7 +98,7 @@
{
"name"
:
"generateDKGPoly"
,
"params"
:
{
"polyName"
:
"
key1
"
,
"polyName"
:
"
POLY:SCHAIN_ID :NODE_ID :DKG_ID
"
,
"t"
:
3
},
"returns"
:
{
...
...
@@ -176,7 +176,7 @@
"returns"
:
{
"status"
:
0
,
"errorMessage"
:
"12345"
,
"BLSPublicKeyShare"
:
"123"
"BLSPublicKeyShare"
:
[]
}
},
...
...
stubclient.h
View file @
1b12bcfd
...
...
@@ -26,7 +26,7 @@ class StubClient : public jsonrpc::Client
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
Json
::
Value
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
,
int
n
,
int
signerIndex
,
int
t
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
,
int
n
,
int
t
,
int
signerIndex
)
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
p
;
p
[
"keyShareName"
]
=
keyShareName
;
...
...
@@ -173,6 +173,20 @@ class StubClient : public jsonrpc::Client
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
Json
::
Value
ComplaintResponse
(
const
std
::
string
&
polyName
,
int
n
,
int
t
,
int
ind
)
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
p
;
p
[
"polyName"
]
=
polyName
;
p
[
"n"
]
=
n
;
p
[
"t"
]
=
t
;
p
[
"ind"
]
=
ind
;
Json
::
Value
result
=
this
->
CallMethod
(
"ComplaintResponse"
,
p
);
if
(
result
.
isObject
())
return
result
;
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
};
#endif //JSONRPC_CPP_STUB_STUBCLIENT_H_
testw.cpp
View file @
1b12bcfd
This diff is collapsed.
Click to expand it.
trusted_libff/libff/algebra/fields/bigint.hpp
View file @
1b12bcfd
...
...
@@ -13,6 +13,8 @@
#include <sgx_tgmp.h>
namespace
libff
{
template
<
mp_size_t
n
>
class
bigint
;
...
...
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