`blake2` code size very high (overuse of`#[inline(always)]`?)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cryptography
Research direction
Start in blake2/src/blake2.rs at VarBlake2b::compress, focusing on the #[inline(always)] annotations and manually unrolled round calls. Compare generated code under -Copt-level=z and -Copt-level=3, then verify that the implementation still produces the same Blake2b results while reducing the unusually large function size.
Written by the indexing model from the issue text.
Description
I have ~150kb of code for blake2::blake2b::VarBlake2b::compress under -Copt-level=z, which is around 3x larger than any other function in my binary. It would be nice if it were smaller.
Looking at https://github.com/RustCrypto/hashes/blob/master/blake2/src/blake2.rs, a lot is #[inline(always)], and the round calls are manually unrolled.
There's a good chance these would still get inlined and unrolled on -Copt-level=3 if it were written using #[inline] and a loop, but it would make a big difference to use cases where large code is undesirable.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 343
- Avg merge
- 1h 27m
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustCrypto/hashes
-
`blake2::Blake2b512` does not implement `ZeroizeOnDrop`Possibly taken @Johnsonajibi claimed this 38 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
RustCrypto/hashes#912 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
RustCrypto/hashes#909 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
RustCrypto/hashes#908 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
RustCrypto/hashes#763 · 1 comment ·
Maintainers usually reply within 1 day
-
blake2: implement `CustomizedInit` using `digest` macroMay be free again @MavenRain claimed this 72 days ago, and no pull request is open. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
RustCrypto/hashes#747 · 1 comment ·
Maintainers usually reply within 1 day
All issues in RustCrypto/hashes
Similar issues
-
[Bug]: Web chat input doesn't regain focus after a reply finishesPossibly taken @GaijinSystems claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zeroclaw-labs/zeroclaw#11658 ·
Maintainers usually reply within 2 days
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NuSkooler/enigma-bbs#907 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day