forked from openenclave/openenclave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add oe_sha256() internal convenience function
Signed-off-by: Thomas Tendyck <[email protected]>
- Loading branch information
Showing
6 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Open Enclave SDK contributors. | ||
// Licensed under the MIT License. | ||
|
||
#include <openenclave/internal/crypto/sha.h> | ||
#include <openenclave/internal/raise.h> | ||
|
||
oe_result_t oe_sha256(const void* data, size_t size, OE_SHA256* sha256) | ||
{ | ||
oe_result_t result = OE_FAILURE; | ||
oe_sha256_context_t ctx = {0}; | ||
OE_CHECK(oe_sha256_init(&ctx)); | ||
OE_CHECK(oe_sha256_update(&ctx, data, size)); | ||
OE_CHECK(oe_sha256_final(&ctx, sha256)); | ||
result = OE_OK; | ||
done: | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ list( | |
APPEND | ||
PLATFORM_HOST_MR_SRC | ||
../common/safecrt.c | ||
../common/sha.c | ||
hexdump.c | ||
dupenv.c | ||
fopen.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters