antelle/argon2-browser

'Encoding failed' error on any `hashLen > 352`

D-Nice opened this issue · 2 comments

According to spec

Tag length T may be any integer number of bytes from 4 to 2^32-1.
The Argon2 output is a T-length string.

These higher lengths work fine for me with argon2 cli and with the argon2 c reference library.

Reproducible example usable on runkit:

var a2 = require("argon2-browser")
a2.hash({
    pass: 'pass',
    salt: 'somesalt',
    hashLen: 373
}).then(res => console.log(res.hash))
Promise (rejected)
Object {code: -31, message: "Encoding failed"}

Hi! Thanks, fixed in v1.15.2.

Thank you for the fix, impressed by your quick turnaround time :)

Indeed appears working with greater lengths!