SHA1 rewrite.#3216
Conversation
|
@NotsoanoNimus I started. |
|
So far, std.hash.sha1.ll size reduced from 938620 bytes to 191464 bytes, where the original is |
|
938620 -> 238203 bytes |
|
General rewrite; basically no difference, but is cheaper to compile and will compile smaller for less optimized builds. |
|
I'm trying to make it identical to current master, and it seems to be a tiny difference in how the compiler handles the same algorithm inlined differently. |
|
Nope. It's just the volatile erasure. Didn't realize not commenting it out in both parts was the only difference. Code is identical to master. |
|
@lerno Do we omit state erasure on the grounds that this primitive is broken? |
Secure-erase omitted for the broken primitive.
|
Maybe make secure erasure a compile-time option/$feature instead of removing it entirely? Most SHA1 usage probably does not benefit from wiping, but some users may still want the hardening for HMAC/password-related contexts 🤷️ |
|
State erasure is good, but is it costly? |
0.8% faster without |
|
Ready to merge? |
|
Something's wrong, the tests fail: |
|
Yikes, okay. |
|
Silly me; handled. Improved my test: 0.63% faster without zeroing. |
|
Interesting! This seems to have triggered a lowering bug. Don't change the code, I need to look at it. |
|
Thank you! |
Made some adjustments based on https://github.com/halloweeks/sha1/blob/main/sha1.h
Not done yet