-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SECLIB-667: Accelerate SHA-512 with A64 crypto extensions #5632
Merged
daverodgman
merged 3 commits into
Mbed-TLS:development
from
tom-cosgrove-arm:seclib-667-sha512-acceleration-mbedtls-internal
Mar 29, 2022
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,2 @@ | ||
Features | ||
* A64 crypto extension support for SHA-512 |
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 |
---|---|---|
|
@@ -49,8 +49,15 @@ | |
defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY) | ||
# include <arm_neon.h> | ||
# endif | ||
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) && defined(__linux__) | ||
# include <sys/auxv.h> | ||
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) | ||
# if defined(__unix__) | ||
# if defined(__linux__) | ||
/* Our preferred method of detection is getauxval() */ | ||
# include <sys/auxv.h> | ||
# endif | ||
/* Use SIGILL on Unix, and fall back to it on Linux */ | ||
# include <signal.h> | ||
# endif | ||
# endif | ||
#elif defined(_M_ARM64) | ||
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) || \ | ||
|
@@ -272,10 +279,10 @@ static size_t mbedtls_internal_sha256_process_many_a64_crypto( | |
uint32x4_t abcd_orig = abcd; | ||
uint32x4_t efgh_orig = efgh; | ||
|
||
uint32x4_t sched0 = vld1q_u32( (const uint32_t *)( msg + 16 * 0 ) ); | ||
uint32x4_t sched1 = vld1q_u32( (const uint32_t *)( msg + 16 * 1 ) ); | ||
uint32x4_t sched2 = vld1q_u32( (const uint32_t *)( msg + 16 * 2 ) ); | ||
uint32x4_t sched3 = vld1q_u32( (const uint32_t *)( msg + 16 * 3 ) ); | ||
uint32x4_t sched0 = (uint32x4_t) vld1q_u8( msg + 16 * 0 ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing it this way avoids |
||
uint32x4_t sched1 = (uint32x4_t) vld1q_u8( msg + 16 * 1 ); | ||
uint32x4_t sched2 = (uint32x4_t) vld1q_u8( msg + 16 * 2 ); | ||
uint32x4_t sched3 = (uint32x4_t) vld1q_u8( msg + 16 * 3 ); | ||
|
||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ /* Will be true if not defined */ | ||
/* Untested on BE */ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing full stop. (To keep it consistent with how you have written the rest of the comments.)