Skip to content

sha1: pass block slices to sha1_asm + remove cfg toggle for constants #285

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

Closed
wants to merge 1 commit into from

Conversation

tlercher
Copy link

@tlercher tlercher commented Jul 4, 2021

This doesn't really depend on RustCrypto/asm-hashes#38 but it is required to make it work for me on a M1 Mac.

As the title says i changed the (internal) API so that block slices instead of independent blocks are passes to sha1_asm.

I also removed the cfg toggles for aarch64, because they are required for the software-fallback and asm-aarch64 is marked deprecated anyway.

Benchmarks on my M1 MacBookPro:

Soft

test bench1_10    ... bench:          14 ns/iter (+/- 0) = 714 MB/s
test bench2_100   ... bench:         120 ns/iter (+/- 1) = 833 MB/s
test bench3_1000  ... bench:       1,151 ns/iter (+/- 4) = 868 MB/s
test bench4_10000 ... bench:      11,465 ns/iter (+/- 130) = 872 MB/s

ASM

test bench1_10    ... bench:           7 ns/iter (+/- 0) = 1428 MB/s
test bench2_100   ... bench:          45 ns/iter (+/- 1) = 2222 MB/s
test bench3_1000  ... bench:         459 ns/iter (+/- 9) = 2178 MB/s
test bench4_10000 ... bench:       4,579 ns/iter (+/- 84) = 2183 MB/s

@tarcieri
Copy link
Member

Oh whoops, didn't see this in time, but the same changes were made in #289. Thanks anyway!

@tarcieri tarcieri closed this Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants