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
42cbd70d
Unverified
Commit
42cbd70d
authored
4 years ago
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3596 Intel submission
parent
450f1591
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+4
-1
No files found.
secure_enclave/secure_enclave.c
View file @
42cbd70d
...
...
@@ -210,6 +210,8 @@ void *reallocate_function(void *ptr, size_t osize, size_t nsize) {
return
(
void
*
)
nptr
;
}
volatile
uint64_t
counter
;
void
get_global_random
(
unsigned
char
*
_randBuff
,
uint64_t
_size
)
{
char
errString
[
BUF_LEN
];
int
status
;
...
...
@@ -220,10 +222,11 @@ void get_global_random(unsigned char *_randBuff, uint64_t _size) {
CHECK_STATE
(
_size
<=
32
)
CHECK_STATE
(
_randBuff
);
counter
++
;
sgx_sha_state_handle_t
shaStateHandle
;
CHECK_STATE
(
sgx_sha256_init
(
&
shaStateHandle
)
==
SGX_SUCCESS
);
CHECK_STATE
(
sgx_sha256_update
(
globalRandom
,
32
,
shaStateHandle
)
==
SGX_SUCCESS
);
CHECK_STATE
(
sgx_sha256_update
(
&
counter
,
sizeof
(
counter
),
shaStateHandle
)
==
SGX_SUCCESS
);
CHECK_STATE
(
sgx_sha256_get_hash
(
shaStateHandle
,
(
sgx_sha256_hash_t
*
)
globalRandom
)
==
SGX_SUCCESS
);
CHECK_STATE
(
sgx_sha256_close
(
shaStateHandle
)
==
SGX_SUCCESS
);
...
...
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