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

Neon impl of ChaCha20 (better size & perf) #159

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

Conversation

daverodgman
Copy link
Contributor

@daverodgman daverodgman commented Jan 15, 2025

Description

Neon implementation of ChaCha20 which, depending on how it's configured, is ~500b smaller than the existing impl, or up to 4.6x faster. In its default setting it has slightly better code size than the existing impl, and is 2-2.7x faster.

Tested on all combinations of Armv7 arm/thumb2; Armv8 arm/thumb2/aarch64 on clang 14, gcc 11, and some more recent versions, plus Armv8 aarch64_be on gcc 7.5.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided
  • development PR provided
  • framework PR not required
  • 3.6 PR not required because: non-functional change
  • 2.28 PR not required because: non-functional change
  • tests to follow via separate PR in mbedtls repo - see Mbed-TLS/mbedtls@a8e9a88
multiblock setting size delta c.f. development (aarch64) perf delta c.f. development (aarch64)
clang 0 -84 0%
1 -548 14%
2 -344 64%
3 -144 98%
4 76 172%
5 352 161%
6 576 224%
gcc 0 -71 0%
1 -519 57%
2 -275 129%
3 1 177%
4 309 280%
5 665 273%
6 881 355%

@ronald-cron-arm
Copy link
Contributor

Thanks for moving your PR to the new repo.

@davidhorstmann-arm davidhorstmann-arm self-requested a review January 16, 2025 14:02
@minosgalanakis minosgalanakis added size-m Estimated task size: medium (~1w) 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 size-optimisation priority-medium Medium priority - this can be reviewed as time permits labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-m Estimated task size: medium (~1w) size-optimisation
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants