Skip to content
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

Performance Enhancements and Memory Footprint Reduction in mbedtls_internal_sha(256|512)_process_c() #9542

Open
wants to merge 10 commits into
base: development
Choose a base branch
from

Conversation

manoel-serafim
Copy link

@manoel-serafim manoel-serafim commented Sep 5, 2024

Description

This PR regards to performance and memory footprint improvements inside the compression functions of sha512.c and sha256.c.
This PR solves #9467 in the sense that it merges the word schedule and intermediate digest state loops. It also makes the code defined under MBEDTLS_SHA512_SMALLER even smaller and recicles operations inside the intermediate digest state loops.

PR checklist

  • changelog provided
  • development PR provided
  • framework PR not required
  • 3.6 PR provided # | not required because:
  • 2.28 PR provided # | not required because:
  • tests not required because: existing tests already cover this enhancements

@manoel-serafim
Copy link
Author

Hello @gilles-peskine-arm ! As we discussed in the issue referenced in this PR, I've completed benchmarking these changes on both x86-64 and ARMv8 (With Clang and gcc). I would be happy to share the results— Is there any preferred method for receiving them?

@gilles-peskine-arm
Copy link
Contributor

Is there any preferred method for receiving them?

Please just post them to GitHub.

…e inside the first 16 intermediate hash calculations

Signed-off-by: Manoel Serafim <[email protected]>
…f MBEDTLS_SHA256_SMALLER

Signed-off-by: Manoel Serafim <[email protected]>
… K, now we directly add to i and use it as a general index as it should be used

Signed-off-by: Manoel Serafim <[email protected]>
…on is unrroled for performance, however continues in a loop when MBEDTLS_SHA256_SMALLER is defined

Signed-off-by: Manoel Serafim <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members, component-crypto Crypto primitives and low-level interfaces needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) priority-medium Medium priority - this can be reviewed as time permits labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)
Projects
Status: In Development
Development

Successfully merging this pull request may close these issues.

2 participants