diff --git a/src/matrix/ssss/common.ts b/src/matrix/ssss/common.ts index c4d0adeb..b7c06192 100644 --- a/src/matrix/ssss/common.ts +++ b/src/matrix/ssss/common.ts @@ -22,6 +22,7 @@ export interface IKeyDescription { algorithm: string; iterations: number; salt: string; + bits?: number; }; mac: string; iv: string; diff --git a/src/matrix/ssss/index.ts b/src/matrix/ssss/index.ts index f0c72e0f..15e95200 100644 --- a/src/matrix/ssss/index.ts +++ b/src/matrix/ssss/index.ts @@ -15,7 +15,7 @@ limitations under the License. */ import {KeyDescription, Key} from "./common"; -import {keyFromPassphrase} from "./passphrase.js"; +import {keyFromPassphrase} from "./passphrase"; import {keyFromRecoveryKey} from "./recoveryKey.js"; import {SESSION_E2EE_KEY_PREFIX} from "../e2ee/common.js"; import type {Storage} from "../storage/idb/Storage"; diff --git a/src/matrix/ssss/passphrase.js b/src/matrix/ssss/passphrase.ts similarity index 86% rename from src/matrix/ssss/passphrase.js rename to src/matrix/ssss/passphrase.ts index 9460e4db..00e4801e 100644 --- a/src/matrix/ssss/passphrase.js +++ b/src/matrix/ssss/passphrase.ts @@ -15,6 +15,8 @@ limitations under the License. */ import {Key} from "./common"; +import type {KeyDescription} from "./common"; +import type {Platform} from "../../platform/web/Platform.js"; const DEFAULT_ITERATIONS = 500000; const DEFAULT_BITSIZE = 256; @@ -25,7 +27,7 @@ const DEFAULT_BITSIZE = 256; * @param {Platform} platform * @return {Key} */ -export async function keyFromPassphrase(keyDescription, passphrase, platform) { +export async function keyFromPassphrase(keyDescription: KeyDescription, passphrase: string, platform: Platform): Promise { const {passphraseParams} = keyDescription; if (!passphraseParams) { throw new Error("not a passphrase key");