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
ac569b3f
Unverified
Commit
ac569b3f
authored
Sep 03, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing SGX
parent
35044c70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
BLSCrypto.cpp
BLSCrypto.cpp
+14
-2
BLSCrypto.h
BLSCrypto.h
+4
-0
BLSPrivateKeyShareSGX.cpp
BLSPrivateKeyShareSGX.cpp
+1
-1
BLSPrivateKeyShareSGX.h
BLSPrivateKeyShareSGX.h
+12
-10
No files found.
BLSCrypto.cpp
View file @
ac569b3f
//
// Created by kladko on 9/2/19.
//
#include <memory>
#include "BLSCrypto.h"
...
...
@@ -12,6 +13,7 @@
#include "leveldb/db.h"
#include <jsonrpccpp/server/connectors/httpserver.h>
#include "BLSPrivateKeyShareSGX.h"
extern
"C"
void
init_daemon
()
{
...
...
@@ -28,8 +30,18 @@ extern "C" void init_daemon() {
}
class
BLSCrypto
{
bool
sign
(
char
*
encryptedKeyHex
,
char
*
hashHex
,
size_t
t
,
size_t
n
,
char
*
_sig
)
{
auto
keyStr
=
std
::
make_shared
<
std
::
string
>
(
encryptedKeyHex
);
auto
keyShare
=
std
::
make_shared
<
BLSPrivateKeyShareSGX
>
(
keyStr
,
t
,
n
);
return
true
;
}
};
BLSCrypto.h
View file @
ac569b3f
...
...
@@ -13,6 +13,10 @@
EXTERNC
void
init_daemon
();
EXTERNC
bool
sign
(
char
*
encryptedKeyHex
,
char
*
hashHex
,
size_t
t
,
size_t
n
,
char
*
_sig
);
#endif //SGXD_BLSCRYPTO_H
BLSPrivateKeyShareSGX.cpp
View file @
ac569b3f
...
...
@@ -181,6 +181,6 @@ std::shared_ptr<BLSSigShare> BLSPrivateKeyShareSGX::signWithHelperSGX(
auto
s
=
make_shared
<
BLSSigShare
>
(
sig
,
_signerIndex
,
requiredSigners
,
totalSigners
);
return
s
;
}
BLSPrivateKeyShareSGX.h
View file @
ac569b3f
...
...
@@ -23,23 +23,25 @@
#ifndef SGXD_BLSPRIVATEKEYSHARESGX_H
#define SGXD_BLSPRIVATEKEYSHARESGX_H
#define SGXD_BLSPRIVATEKEYSHARESGX_H
#include "BLSPrivateKeyShare.h"
class
BLSPrivateKeyShareSGX
{
size_t
requiredSigners
;
class
BLSPrivateKeyShareSGX
{
size_t
total
Signers
;
size_t
required
Signers
;
size_t
totalSigners
;
shared_ptr
<
string
>
encryptedKeyHex
;
std
::
shared_ptr
<
std
::
string
>
encryptedKeyHex
;
std
::
shared_ptr
<
BLSSigShare
>
signWithHelperSGX
(
std
::
shared_ptr
<
std
::
array
<
uint8_t
,
32
>>
_hash
,
size_t
_signerIndex
);
BLSPrivateKeyShareSGX
(
shared_ptr
<
std
::
string
>
_encryptedKeyHex
,
size_t
_requiredSigners
,
size_t
_totalSigners
);
public
:
std
::
shared_ptr
<
BLSSigShare
>
signWithHelperSGX
(
std
::
shared_ptr
<
std
::
array
<
uint8_t
,
32
>>
_hash
,
size_t
_signerIndex
);
BLSPrivateKeyShareSGX
(
std
::
shared_ptr
<
std
::
string
>
_encryptedKeyHex
,
size_t
_requiredSigners
,
size_t
_totalSigners
);
};
#endif // LIBBLS_BLSPRIVATEKEYSHARE_H
#endif // LIBBLS_BLSPRIVATEKEYSHARE_H
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