sodium-friends / sodium-javascript

Pure Javascript version of sodium-native
MIT License
92 stars 24 forks source link

sodium-test failure: Error: "key" must be crypto_kdf_KEYBYTES bytes long #45

Closed christianbundy closed 4 years ago

christianbundy commented 4 years ago

It looks like there's some problem here: https://github.com/sodium-friends/sodium-test/blob/1e6ecf7326d95ae8b6a5fcc1365e9f6007f7aeba/crypto_kdf.js#L12

Error: "key" must be crypto_kdf_KEYBYTES bytes long
    at Test.<anonymous> (/home/christianbundy/src/sodium-test/crypto_kdf.js:12:12)
    at Test.bound [as _cb] (/home/christianbundy/src/sodium-test/node_modules/tape/lib/test.js:80:32)
    at Test.run (/home/christianbundy/src/sodium-test/node_modules/tape/lib/test.js:96:10)
    at Test.bound [as run] (/home/christianbundy/src/sodium-test/node_modules/tape/lib/test.js:80:32)
    at Immediate.next (/home/christianbundy/src/sodium-test/node_modules/tape/lib/results.js:83:19)
    at processImmediate (internal/timers.js:456:21)
chm-diederichs commented 4 years ago

this is a sodium-native issue I believe, sodium-javascript only checks minimum length whereas native checks exact length