Initial update for the bitmessage-js package #1
10
test.js
10
test.js
|
@ -460,8 +460,10 @@ describe("Common structures", function() {
|
|||
describe("encrypted", function() {
|
||||
it("should encode and decode", function() {
|
||||
var iv = Buffer.alloc(16);
|
||||
var ephemPublicKey = Buffer.alloc(65);
|
||||
ephemPublicKey[0] = 0x04;
|
||||
var ephemPublicKey = Buffer.alloc(70);
|
||||
ephemPublicKey.writeUInt16BE(714, 0, true);
|
||||
ephemPublicKey.writeUInt16BE(32, 2, true);
|
||||
ephemPublicKey.writeUInt16BE(32, 36, true);
|
||||
var ciphertext = Buffer.from("test");
|
||||
var mac = Buffer.alloc(32);
|
||||
var inopts = {
|
||||
|
@ -475,9 +477,9 @@ describe("Common structures", function() {
|
|||
expect(encoded.length).to.equal(122);
|
||||
var outopts = encrypted.decode(encoded);
|
||||
expect(bufferEqual(iv, outopts.iv)).to.be.true;
|
||||
// expect(bufferEqual(ephemPublicKey, outopts.ephemPublicKey)).to.be.true;
|
||||
expect(bufferEqual(ephemPublicKey, outopts.ephemPublicKey)).to.be.true;
|
||||
expect(ciphertext.toString()).to.equal("test");
|
||||
// expect(bufferEqual(mac, outopts.mac)).to.be.true;
|
||||
expect(bufferEqual(mac, outopts.mac)).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user