Remix.run Logo
▲ nullc 3 hours ago

Because the MD length extension attacks only show up in a fairly limited set of cases and have mitigations which are considered bog standard (e.g. HMAC). If you're doing something where a MD length extension attack would harm you ... you're already lost in the dark and are going to be eaten by a grue-- avoiding SHA-256 will not save you.

Swapping out sha256 with something else when you would have had an extension attack means you're probably going to flub domain separation or miss committing to segment lengths or something else that is an inherent footgun that can't be misuse resistance your way out of but which harder to get right and more easily consequential than avoiding MD extensions.

Misuse resistance is important for sure, but the MD length extension is not in the same fragility class as stuff like 'relied on the caller to provide randomness for ECDSA'. And the hardware implementations of SHA256 have quite good energy efficiency and the algorithm overall has held up exceptionally well.