diff options
Diffstat (limited to 'packages/anastasis-core/src')
-rw-r--r-- | packages/anastasis-core/src/crypto.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/anastasis-core/src/crypto.ts b/packages/anastasis-core/src/crypto.ts index 815f84c11..5e45f995f 100644 --- a/packages/anastasis-core/src/crypto.ts +++ b/packages/anastasis-core/src/crypto.ts @@ -227,11 +227,11 @@ async function anastasisDecrypt( const nonceBuf = ctBuf.slice(0, nonceSize); const enc = ctBuf.slice(nonceSize); const key = await deriveKey(keySeed, encodeCrock(nonceBuf), salt); - const cipherText = secretbox_open(enc, nonceBuf, key); - if (!cipherText) { + const clearText = secretbox_open(enc, nonceBuf, key); + if (!clearText) { throw Error("could not decrypt"); } - return encodeCrock(cipherText); + return encodeCrock(clearText); } export const asOpaque = (x: string): OpaqueData => x; |