LoupVaillant / Monocypher

An easy to use, easy to deploy crypto library
https://monocypher.org
Other
580 stars 80 forks source link

Multi-lane Argon2 non-conforming #263

Closed LoupVaillant closed 11 months ago

LoupVaillant commented 11 months ago

Argon2 fails to behave the same as the reference implementation when used with multiple lanes. Worse, I believe it reads uninitialised memory, making its behaviour non-deterministic (not to mention undefined). Unfortunately the current test suite is insufficient here: libsodium uses only one lane, and by unfortunate coincidence the test vectors from the RFC don’t catch the error.

The error here is selecting the wrong reference set (and ultimately the wrong reference block). There are 3 criteria we fail to observe:

To be fixed & shipped ASAP.