Sha3 refactor unsafe#338
Conversation
|
Thank you! |
Perhaps we should have cross-based tests for big endian architectures like we have for |
|
I think the author meant performance difference. This PR has removed different endianness-dependent code paths, so such tests would be less important. |
|
I was concerned wrt the functionality. As the code in the LE path matched the BE path I was quite confident to not break anything. Looking into the sha2 github actions I stumbled across the Nevertheless, having cross-based tests for all crates would be nice to catch any errors in advance. If wanted, I could create a PR to add them. |
|
I'd be in favor of them, especially as |
I was looking into the sha3 implementation and would like to propose this PR to avoid the use of unsafe.
While the implementation differentiated between little & big endian, I ended for the little endian path with more or less similar code than it was existing in the big endian path already. Thus, I assume that there is no differentiation needed. Unfortunately, I could only test it on my machine, which is LE.
Performance-wise it does not really change anything, see below first without unsafe as it is now and second as it was before:
850bcc2 sha3: Add forbid(unsafe_code) crate attribute
894f62f build(deps): bump digest from 0.10.0 to 0.10.1 (#337