jedisct1 / libsodium.js

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

function crypto_generichash_blake2b_salt_personal id and ctx can't be null ? #303

Closed vitock closed 1 year ago

vitock commented 1 year ago

in blake2b-ref.c I found that both salt and personal could be null.

how could I set salt without setting ctx ?

OR, blake2b has a default salt or ctx ? I tried Uint8Array filled with 0, it did not generate correct hash

jedisct1 commented 1 year ago

Good catch.

The type for these parameters is buf. I guess it should be something like buf_optional.

It's quite surprising to see that such type is not implemented yet, as there are other functions with nullable fixed-size buffers.