Closed Atemu closed 2 years ago
there's no plan to tap in SHA instructions at the moment nor SIMD, so that's an expected slowdown. someone will have to add the instructions support and the layers of compat and fallback for this to happen.
this is a lot of work all in all, I've did this in rust here: https://github.com/typed-io/cryptoxide/tree/master/src/hashing/sha2/impl256
Thanks for the answer.
Couldn't the Rust implementation be used instead of the C one here?
Could cryptonite hook into existing implementations of all that complexity like openssl?
I made a minimal
sha256sum
rewrite out of cryptonite:However, it is 4-8 times slower than the regular
sha256sum
oropenssl sha256
on machines with SHA accelerator. (Except on an M1 Pro where my coreutils'sha256sum
also doesn't make use of SHA extensions but openssl does.)Celeron J4105:
M1 Pro:
5800x:
(This is a minimal reproducer for a bug in git-annex: https://git-annex.branchable.com/bugs/git-annex_is_slow_at_reading_file_content/)