5 ms·
Not pictured: the wall of incomprehensible math code implementing SHA1. Most languages do not provide such implementations by default so I struggle to really ca
by ranger_danger 4y ago
Not pictured: the wall of incomprehensible math code implementing SHA1. Most languages do not provide such implementations by default so I struggle to really call this only 20 lines.
- bvrmn 4y agoWhat other library functions you consider as "cheating"?
- otachack 4y agoFair assessment, but the crypto community has that one high standard of "don't roll your own crypto" unless you have to or it's a learning project. Now I'm interested in a minimal SHA-1 implementation!
- ranger_danger 4y agohttps://github.com/RavuAlHemio/cpptotp/blob/master/src/libcppotp/sha1.cpp https://github.com/RavuAlHemio/cpptotp/blob/master/src/libcp...
- daneel_w 4y agoThe hmac can be forgiven, in my opinion. But the ~30 lines of code for the Python stdlib's Base32-decoder, which would inflate the line count by 150%, is harder to forgive. b32-decoding can be made compact, of course: https://github.com/stolendata/totp/blob/master/totp.php#L16-L30 https://github.com/stolendata/totp/blob/master/totp.php#L16-...
- pletnes 4y agoBase32? The hard part is to implement QR code scanning across a range of different cameras, lighting conditions and shaky hands. Not to mention melting your own sand to make silicon.
- masklinn 4y agoDon't forget creating the rock which you then weather into sand. Frankly TFA should work a bit harder on this apple pie, this is just lazy.