keeweb / kdbxweb

Web Kdbx library
https://app.keeweb.info
MIT License
409 stars 57 forks source link

Incorrect Argon documentation? #39

Closed TomMettam closed 3 years ago

TomMettam commented 3 years ago

The readme says this:

// your implementation makes hash (Uint32Array, 'length' bytes)

so I did this:

const result: Argon2BrowserHashResult = await argon.hash({
        pass: new Uint8Array(password),
        salt: new Uint8Array(salt),
        time: iterations,
        mem: memory,
        parallelism: parallelism,
        hashLen: length,
        type: type,
});

// your implementation makes hash (Uint32Array, 'length' bytes)
return new Uint32Array(result.hash.buffer);

(Note the new UInt32Array) This resulted in a failure to decrypt. When I simply returned the Uint8Array in result.hash, everything was fine.

Is the doc wrong or did I misunderstand?

antelle commented 3 years ago

Thanks! That's a typo indeed.