diff --git a/libloki/test/crypto_test.js b/libloki/test/crypto_test.js index 0a6210368..9145f3af3 100644 --- a/libloki/test/crypto_test.js +++ b/libloki/test/crypto_test.js @@ -1,4 +1,4 @@ -/* global libsignal, libloki, textsecure, StringView */ +/* global libsignal, libloki, textsecure, StringView, dcodeIO */ 'use strict'; @@ -31,7 +31,11 @@ describe('Crypto', () => { it('should encrypt and then decrypt a message with the same result', async () => { const arr = new Uint8Array([1, 2, 3, 4, 5]); const { body } = await fallbackCipher.encrypt(arr.buffer); - const result = await fallbackCipher.decrypt(body); + const bufferBody = dcodeIO.ByteBuffer.wrap( + body, + 'binary' + ).toArrayBuffer(); + const result = await fallbackCipher.decrypt(bufferBody); assert.deepEqual(result, arr.buffer); }); });