From 3353b21162d5b69596f631744fb8e58127ee1a63 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 30 Dec 2017 13:06:49 +0000 Subject: [PATCH] CryptoManager: fix decrypt/encrypt bits type. --- src/api/Crypto.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/Crypto.ts b/src/api/Crypto.ts index 685f25c..96e5f4e 100644 --- a/src/api/Crypto.ts +++ b/src/api/Crypto.ts @@ -58,7 +58,7 @@ export class CryptoManager { this.hmacKey = hmac256(sjcl.codec.utf8String.toBits('hmac'), this.key); } - encryptBits(content: number[]): byte[] { + encryptBits(content: sjcl.BitArray): byte[] { const iv = sjcl.random.randomWords(this.cipherWords); let prp = new sjcl.cipher.aes(this.cipherKey); @@ -66,7 +66,7 @@ export class CryptoManager { return sjcl.codec.bytes.fromBits(iv.concat(cipherText)); } - decryptBits(content: byte[]): number[] { + decryptBits(content: byte[]): sjcl.BitArray { let cipherText = sjcl.codec.bytes.toBits(content); const iv = cipherText.splice(0, this.cipherWords);