A from-scratch implementation of the SHA-1 hash algorithm in Rust, following RFC 3174 (US Secure Hash Algorithm 1, SHA1).
Computes the SHA-1 digest of a hardcoded input (b"mukul") and prints it as a hex string. The implementation covers:
- Message padding (
pad_sha1) per RFC 3174 section 4 - Message schedule expansion into 80 32-bit words (
create_words) - The four rounds of nonlinear functions
f(t, b, c, d)(section 5) - The round constants
k(t)(section 5) - The main compression loop over 80 rounds, producing the final 160-bit digest
cargo run