jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.06k stars 1.72k forks source link

strict-aliasing violation in blkxor pwhash_scryptsalsa208sha256_nosse.c #1301

Closed MatzeB closed 10 months ago

MatzeB commented 10 months ago

The blkxor function in pwhash_scryptsalsa208sha256_nosse.c breaks strict aliasing rules (for ARCH_BITS==64). It load/stores from a buffer via uint64_t* that is otherwise accessed via uint32_t* only. We just had trouble with this in core scrypt and clang-15 LTO mode and found upstream scrypt had already fixed it in https://github.com/Tarsnap/scrypt/commit/209fd279c9357010d1dabd446c458dfeb9820e6c

I noticed a copy / similar problematic code for ARCH_BITS==64 in libsodum version.

jedisct1 commented 10 months ago

Thanks for the heads up!

It should be fixed now, including in stable.

Thanks again!