diff options
author | Florian Dold <florian@dold.me> | 2022-07-12 17:41:14 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-07-12 17:41:14 +0200 |
commit | f11483b511ff1f839b9913c4832eee9109f67aeb (patch) | |
tree | 6f4e1c5891a24bbb7500cea3964d3826d2ef87e1 /packages/anastasis-core/src/crypto.ts | |
parent | b214934b75418d0d01c9556577d9594f1db5a319 (diff) | |
download | wallet-core-f11483b511ff1f839b9913c4832eee9109f67aeb.tar.xz |
wallet-core: implement accepting p2p push payments
Diffstat (limited to 'packages/anastasis-core/src/crypto.ts')
-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; |