mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-27 04:41:32 +00:00
validate aead decryption
This commit is contained in:
@ -46,7 +46,7 @@ describe("IK Handshake", () => {
|
||||
|
||||
// Test encryption and decryption
|
||||
const encrypted = handshakeInit.encrypt(Buffer.from("encryptthis"), handshakeInit.session);
|
||||
const decrypted = handshakeResp.decrypt(encrypted, handshakeResp.session);
|
||||
const {plaintext: decrypted} = handshakeResp.decrypt(encrypted, handshakeResp.session);
|
||||
assert(decrypted.equals(Buffer.from("encryptthis")));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
Reference in New Issue
Block a user