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

sha2: Add inline-asm backend for LoongArch64 targets #507

Merged
merged 1 commit into from Sep 26, 2023
Merged

sha2: Add inline-asm backend for LoongArch64 targets #507

merged 1 commit into from Sep 26, 2023

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Sep 26, 2023

Tests

default features

$ cargo test
running 8 tests
test sha224_main ... ok
test sha256_main ... ok
test sha512_224_main ... ok
test sha384_main ... ok
test sha512_256_main ... ok
test sha512_main ... ok
test sha512_rand ... ok
test sha256_rand ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s

loongarch64_asm feature

$ cargo test -F loongarch64_asm
running 8 tests
test sha224_main ... ok
test sha384_main ... ok
test sha256_main ... ok
test sha512_224_main ... ok
test sha512_256_main ... ok
test sha512_main ... ok
test sha512_rand ... ok
test sha256_rand ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s

Bench

Without this patch

test sha256_10    ... bench:          59 ns/iter (+/- 0) = 169 MB/s
test sha256_100   ... bench:         569 ns/iter (+/- 1) = 175 MB/s
test sha256_1000  ... bench:       5,068 ns/iter (+/- 3) = 197 MB/s
test sha256_10000 ... bench:      50,033 ns/iter (+/- 26) = 199 MB/s
test sha512_10    ... bench:          42 ns/iter (+/- 0) = 238 MB/s
test sha512_100   ... bench:         402 ns/iter (+/- 0) = 248 MB/s
test sha512_1000  ... bench:       3,613 ns/iter (+/- 2) = 276 MB/s
test sha512_10000 ... bench:      35,465 ns/iter (+/- 22) = 281 MB/s

With this patch

test sha256_10    ... bench:          52 ns/iter (+/- 0) = 192 MB/s
test sha256_100   ... bench:         498 ns/iter (+/- 1) = 200 MB/s
test sha256_1000  ... bench:       4,517 ns/iter (+/- 5) = 221 MB/s
test sha256_10000 ... bench:      44,695 ns/iter (+/- 23) = 223 MB/s
test sha512_10    ... bench:          33 ns/iter (+/- 0) = 303 MB/s
test sha512_100   ... bench:         319 ns/iter (+/- 0) = 313 MB/s
test sha512_1000  ... bench:       2,871 ns/iter (+/- 0) = 348 MB/s
test sha512_10000 ... bench:      28,302 ns/iter (+/- 5) = 353 MB/s

@newpavlov newpavlov merged commit c6decdf into RustCrypto:master Sep 26, 2023
211 checks passed
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.

None yet

2 participants