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
69116ef1
Unverified
Commit
69116ef1
authored
Sep 10, 2019
by
kladkogex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BLS signature
y
parent
8f26d497
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
BLSCrypto.cpp
BLSCrypto.cpp
+4
-0
BLSPrivateKeyShareSGX.cpp
BLSPrivateKeyShareSGX.cpp
+3
-2
BLSPrivateKeyShareSGX.h
BLSPrivateKeyShareSGX.h
+1
-0
testw.cpp
testw.cpp
+6
-0
No files found.
BLSCrypto.cpp
View file @
69116ef1
...
...
@@ -102,6 +102,10 @@ bool sign(const char* _encryptedKeyHex, const char* _hashHex, size_t _t, size_t
auto
sigShare
=
keyShare
->
signWithHelperSGX
(
hash
,
_signerIndex
);
auto
sigShareStr
=
sigShare
->
toString
();
strncpy
(
_sig
,
sigShareStr
->
c_str
(),
BUF_LEN
);
return
true
;
}
...
...
BLSPrivateKeyShareSGX.cpp
View file @
69116ef1
...
...
@@ -184,8 +184,6 @@ std::shared_ptr<BLSSigShare> BLSPrivateKeyShareSGX::signWithHelperSGX(
}
cerr
<<
"Signature is:"
<<
signature
<<
endl
;
std
::
string
hint
=
BLSutils
::
ConvertToString
(
hash_with_hint
.
first
.
Y
)
+
":"
+
...
...
@@ -193,6 +191,9 @@ std::shared_ptr<BLSSigShare> BLSPrivateKeyShareSGX::signWithHelperSGX(
auto
sig
=
make_shared
<
string
>
(
signature
);
sig
->
append
(
":"
);
sig
->
append
(
hint
);
auto
s
=
make_shared
<
BLSSigShare
>
(
sig
,
_signerIndex
,
requiredSigners
,
totalSigners
);
...
...
BLSPrivateKeyShareSGX.h
View file @
69116ef1
...
...
@@ -25,6 +25,7 @@
#define SGXWALLET_BLSPRIVATEKEYSHARESGX_H
#define SGXWALLET_BLSPRIVATEKEYSHARESGX_H
#include "BLSSigShare.h"
#include "BLSPrivateKeyShare.h"
class
BLSPrivateKeyShareSGX
{
...
...
testw.cpp
View file @
69116ef1
...
...
@@ -197,10 +197,16 @@ 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
);
}
...
...
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