- Self-contained (no external dependencies)
- C11 only (platform-agnostic)
- Includes test vectors (via
The code is available here.
It includes implementations of the following:
This implementation is faster than coreutils, but slower than the assembly-optimized, processor family-specific OpenSSL SHA-2 implementation:
> time -p ./sha256 ~/Videos/8x*avi > /dev/null rleal 9.39 user 9.10 sys 0.29 > time -p sha256sum ~/Videos/8x*avi > /dev/null real 12.04 user 11.73 sys 0.31 > time -p openssl sha256 ~/Videos/8x*avi > /dev/null real 6.36 user 6.01 sys 0.32