Post
Topic
Board Development & Technical Discussion
Re: What made satoshi go for sha256?
by
pooya87
on 12/09/2019, 14:15:50 UTC
That is true. There is no point in using SHA256 any longer, as SHA512 is faster in 64-bit processors

not entirely true. nowadays most CPUs have SHA-extensions (mostly Intel but some AMDs) which are working for SHA1 and SHA256 but not SHA512. the speed gained using these intrinsic are huge.
additionally in bitcoin we are doing a lot of hashing on small bytes such as 33 byte public key, 80 bytes block header,... SHA256 is still faster on them because the higher rounds and bigger blocks of SHA512 adds overhead that slows it down.

Quote
Even if what you need is 256-bit hash, you can still use the more secure SHA512, and just use the first 256-bits.
if you want to replace a hash function you should never replace it with the SAME hash function that has the SAME EXACT construction.
as for SHA512-256, the only thing that it provides over SHA256 (and similarly over SHA512 itself) is protection against length extension attacks which doesn't even concern bitcoin usage.

in short if the hash function is to be replaced it must be replaced with something different. for example one of those sponge based constructions instead of Merkle–Damgård, like Keccak (standardized as SHA-3).