import registerPromiseWorker from 'promise-worker/register';
import * as sjcl from 'sjcl'
import { MessageCipherDTO } from '../../common/dto/MessageCipherDTO';


registerPromiseWorker((payload: { passphrase: string, cipher: MessageCipherDTO }) => {
    // console.log(payload)
    // console.log('decrypted = ' + sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher)));
    return sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher))
});