Made calculateAgreement async

pull/1090/head
Mikunj 5 years ago
parent d8ed1258e1
commit 96d42e24d2

@ -101,7 +101,7 @@ const sendToProxy = async (
const ephemeralKey = await libsignal.Curve.async.generateKeyPair();
// mix server pub key with our priv key
const symKey = libsignal.Curve.calculateAgreement(
const symKey = await libsignal.Curve.async.calculateAgreement(
srvPubKey, // server's pubkey
ephemeralKey.privKey // our privkey
);

@ -22,7 +22,7 @@ const encryptForNode = async (node, payload) => {
const snPubkey = StringView.hexToArrayBuffer(node.pubkey_x25519);
const ephemeralSecret = libsignal.Curve.calculateAgreement(
const ephemeralSecret = await libsignal.Curve.async.calculateAgreement(
snPubkey,
ephemeral.privKey
);
@ -237,7 +237,7 @@ const sendToProxy = async (options = {}, targetNode, retryNumber = 0) => {
const myKeys = await window.libloki.crypto.generateEphemeralKeyPair();
const symmetricKey = libsignal.Curve.calculateAgreement(
const symmetricKey = await libsignal.Curve.async.calculateAgreement(
snPubkeyHex,
myKeys.privKey
);

@ -99,7 +99,7 @@
throw new Error('Failed to get keypair for encryption');
}
const myPrivateKey = myKeyPair.privKey;
const symmetricKey = libsignal.Curve.calculateAgreement(
const symmetricKey = await libsignal.Curve.async.calculateAgreement(
this.pubKey,
myPrivateKey
);
@ -117,7 +117,7 @@
throw new Error('Failed to get keypair for decryption');
}
const myPrivateKey = myKeyPair.privKey;
const symmetricKey = libsignal.Curve.calculateAgreement(
const symmetricKey = await libsignal.Curve.async.calculateAgreement(
this.pubKey,
myPrivateKey
);
@ -290,7 +290,7 @@
throw new Error('Failed to get keypair for token decryption');
}
const { privKey } = keyPair;
const symmetricKey = libsignal.Curve.calculateAgreement(
const symmetricKey = await libsignal.Curve.async.calculateAgreement(
serverPubKey,
privKey
);

Loading…
Cancel
Save