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] TODO: replace after sha2-asm rework #213

Closed
mattcollier opened this issue Dec 24, 2020 · 2 comments · Fixed by #215
Closed

[sha2] TODO: replace after sha2-asm rework #213

mattcollier opened this issue Dec 24, 2020 · 2 comments · Fixed by #215

Comments

@mattcollier
Copy link

Is there an issue to track this TODO? Can some additional description be added?

hashes/sha2/src/sha512.rs

Lines 235 to 236 in 39a55cf

// TODO: replace after sha2-asm rework
fn compress(state: &mut [u64; 8], blocks: &[[u8; 128]]) {

@tarcieri
Copy link
Member

@newpavlov ?

@newpavlov
Copy link
Member

newpavlov commented Jan 13, 2021

The idea was to change signatures of the asm crates to accept &[[u8; 128]] instead of the current single-block &[u8; 128]. Effectively it's a workaround around the noalias LLVM bug, currently after each block was processed the state is saved needlessly, instead of staying in registers. The only workaround which I have found was to copy state to a local variable and work with it, thus the need for the multi-block compression.

The ASM crates currently have a low priority for us and potential performance improvements are quite small, so I probably simply will remove this comment.

newpavlov added a commit that referenced this issue Jan 13, 2021
Closes #213

The comments are removed in favor of RustCrypto/asm-hashes#26.
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 a pull request may close this issue.

3 participants