jedisct1 / libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Other
968 stars 138 forks source link

libsodium.js 0.7.11 does not include crypto_pwhash functions #312

Closed marius-wieschollek closed 1 year ago

marius-wieschollek commented 1 year ago

The crypto_pwhash function is missing after the update from 0.7.10 to 0.7.11.

I have the following code using the function:

        let passwordHash = sodium.crypto_pwhash(
            sodium.crypto_box_SEEDBYTES,
            genericHash,
            passwordHashSalt,
            sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE,
            sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE,
            sodium.crypto_pwhash_ALG_DEFAULT
        );

This works fine with libsodium-browser 0.7.10, but in 0.7.11 it fails with TypeError: A().crypto_pwhash is not a function.

jedisct1 commented 1 year ago

You need the Sumo version for these functions.

marius-wieschollek commented 1 year ago

ok, i see that has changed. but wouldn't it be better to make this a breaking change? Currently npm will ship that update without warning to anyone.

cooper667 commented 1 year ago

ok, i see that has changed. but wouldn't it be better to make this a breaking change? Currently npm will ship that update without warning to anyone.

Also the GH readme is accurate, but the NPM readme still states:

The crypto_pwhash_* function set is included in both versions.