Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Yes, sha3 reads every input byte only once. It does hold a pretty large internal state that doesn't fit in only registers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: