P-H-C / phc-winner-argon2

The password hash Argon2, winner of PHC
Other
4.78k stars 406 forks source link

Function to get the encoded length before encoding #347

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

Currently, you have to guess how big of a buffer you should allocate for an encoded hash. If it's not big enough you just get an error. In practice it should be safe to allocate hashlen * 2 bytes or so, but it would be nice to know in advance.

LoganDark commented 2 years ago

Oh, it looks like there is one here:

https://github.com/P-H-C/phc-winner-argon2/blob/96ddae8937462d84cc95c642090b7910d3707dc7/include/argon2.h#L419-L431

whoops lol!