From bf87add18ddd0b1e36810433183ddb5b05893084 Mon Sep 17 00:00:00 2001 From: byGalax Date: Sat, 16 May 2026 16:37:09 +0200 Subject: [PATCH] feat(mobile): extend cryptoBackend with pwhash + scalarMultBase --- apps/mobile/lib/cryptoBackend.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/mobile/lib/cryptoBackend.ts b/apps/mobile/lib/cryptoBackend.ts index 0e6b6a8..76e1c9f 100644 --- a/apps/mobile/lib/cryptoBackend.ts +++ b/apps/mobile/lib/cryptoBackend.ts @@ -24,5 +24,13 @@ export function createLibsodiumBackend(): CryptoBackend { s.crypto_box_open_easy(ciphertext, nonce, senderPublicKey, recipientPrivateKey), secretbox: (plaintext, nonce, key) => s.crypto_secretbox_easy(plaintext, nonce, key), secretboxOpen: (ciphertext, nonce, key) => s.crypto_secretbox_open_easy(ciphertext, nonce, key), + pwhashConsts: { + OPSLIMIT_MODERATE: s.crypto_pwhash_OPSLIMIT_MODERATE, + MEMLIMIT_MODERATE: s.crypto_pwhash_MEMLIMIT_MODERATE, + ALG_ARGON2ID13: s.crypto_pwhash_ALG_ARGON2ID13, + }, + pwhash: (outLen, password, salt, opslimit, memlimit, alg) => + s.crypto_pwhash(outLen, password, salt, opslimit, memlimit, alg), + scalarMultBase: (priv) => s.crypto_scalarmult_base(priv), }; }