Which cryptographic hash function does Ethereum use?
Many sources refer to the use of the "SHA3" cryptographic hash function within Ethereum, but the Ethereum project began before the SHA3 standard was finalised, and there was some confusion/controversy around the final parameters selected for the standard. Which function specifically did Ethereum actually end up with? Is it the same as the actual SHA3 standard, or one of the variants within the standard? Or is it a parameterisation of Keccak that doesn't match any of the variants?
According to this, NIST changed the padding to
SHA3-256(M) = KECCAK  (M || 01, 256).This was different from the padding proposed by the Keccak team in The Keccak SHA-3 submission version 3 (final, winning version). The difference is the additional '01' bits appended to the message. People are now calling the "submitted version 3" SHA-3 Keccak hashing "Keccak" and the finalized NIST SHA-3 standard "SHA-3".
Ethereum SHA3 function in Solidity =
SHA3-256 (NIST Standard) =
For clarity's sake I think we should call it "Keccak-256" rather than anything that explicitly says "SHA3" in it.
lol, yup familiar with that one. But I actually meant here in the answer, so that we don't confuse readers.
Oh, and excellent answer by the way. Everyone reading this, please upvote this answer. It is an ideal example of the kind of answers we'd like to have on this site!!
Solidity 0.4.3 has introduced `keccak256`, an alias which can safely be used as a replacement for `sha3`.
@MattSayar [kɛtʃak], like “ketchak”, as seen here: https://www.quora.com/Cryptography-How-should-you-pronounce-Keccak