News for hackers. Stuff that matters.
Re:Show HN: SHA-256 explained step-by-step visually by anonymousDan on Tuesday February 08, 2022 @02:00AM (#30255659)
I have an odd request regarding e.g. SHA-3. Can anyone tell me if it is implemented in a way that is in a sense 'one-pass' over its input, i.e. each byte of its input in memory is accessed only once, after which all of the algorithm state is held in registers and the original input is never accessed again? My scenario is one where I'm concerned about TOCTOU-like attacks on the memory where the input is stored, but I don't want to pay the overhead of first copying the whole input to a 'safe' memory location, e.g. imagine I have kernel code wanting to compute a hash over data stored in userspace.
Re:Show HN: SHA-256 explained step-by-step visually by oib on Tuesday February 08, 2022 @02:22AM (#30255768)
Yes, sha3 reads every input byte only once. It does hold a pretty large internal state that doesn't fit in only registers.