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
c4e2b3b5
Unverified
Commit
c4e2b3b5
authored
4 years ago
by
Oleh Nikolaiev
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #262 from skalenetwork/bug/SKALE-3661-fix-hashing
Bug/skale 3661 fix hashing
parents
734b1572
abe43b81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
DHDkg.c
secure_enclave/DHDkg.c
+7
-1
testw.cpp
testw.cpp
+5
-1
No files found.
secure_enclave/DHDkg.c
View file @
c4e2b3b5
...
...
@@ -345,7 +345,13 @@ int hash_key(char* key, char* hashed_key) {
return
ret
;
}
ret
=
sgx_sha256_msg
((
uint8_t
*
)
key
,
ECDSA_SKEY_LEN
-
1
,
(
uint8_t
*
)
hashed_key
);
uint8_t
key_to_hash
[
33
];
uint64_t
len
;
if
(
!
hex2carray
(
key
,
&
len
,
key_to_hash
))
{
return
ret
;
}
ret
=
sgx_sha256_msg
(
key_to_hash
,
ECDSA_BIN_LEN
-
1
,
(
uint8_t
*
)
hashed_key
);
return
ret
;
}
This diff is collapsed.
Click to expand it.
testw.cpp
View file @
c4e2b3b5
...
...
@@ -946,7 +946,11 @@ TEST_CASE_METHOD(TestFixture, "AES_DKG V2 test", "[aes-dkg-v2]") {
SAFE_CHAR_BUF
(
common_key
,
BUF_LEN
);
REQUIRE
(
sessionKeyRecoverDH
(
dhKey
.
c_str
(),
encr_sshare
,
common_key
)
==
0
);
auto
hashed_key
=
cryptlite
::
sha256
::
hash_hex
(
string
(
common_key
,
64
));
uint8_t
key_to_hash
[
33
];
uint64_t
len
;
REQUIRE
(
hex2carray
(
common_key
,
&
len
,
key_to_hash
,
64
)
);
auto
hashed_key
=
cryptlite
::
sha256
::
hash_hex
(
string
((
char
*
)
key_to_hash
,
32
));
SAFE_CHAR_BUF
(
derived_key
,
33
)
...
...
This diff is collapsed.
Click to expand it.
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