CryptoManager: fix decrypt/encrypt bits type.

master
Tom Hacohen 7 years ago
parent 1f961fbad1
commit 3353b21162

@ -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);

Loading…
Cancel
Save