Fix crypto_generichash usage in useUserIdentity

Adds the missing third argument (null) to sodium.crypto_generichash to ensure correct hashing behavior when generating the salt for storage key derivation.
This commit is contained in:
Christopher
2026-01-28 06:16:35 -08:00
parent 015d4ecbd8
commit 4ab464bcaa
+1 -1
View File
@@ -144,7 +144,7 @@ export function useUserIdentity() {
const saltString = `synapsis-chat-storage-${identity.did}`;
// Generate a fixed-length salt from the DID
// Hash to 32 bytes, then take first 16 bytes for salt
const fullHash = sodium.crypto_generichash(32, saltString);
const fullHash = sodium.crypto_generichash(32, saltString, null);
const salt = fullHash.slice(0, sodium.crypto_pwhash_SALTBYTES);
console.log('[Identity] Deriving storage key...');