diff --git a/src/handshakes/abstract-handshake.ts b/src/handshakes/abstract-handshake.ts index a2753c4..45b650e 100644 --- a/src/handshakes/abstract-handshake.ts +++ b/src/handshakes/abstract-handshake.ts @@ -106,7 +106,7 @@ export abstract class AbstractHandshake { protected dh(privateKey: bytes32, publicKey: bytes32): bytes32 { try { - return Buffer.from(box.before(publicKey, privateKey)) + return Buffer.from(box.before(publicKey, privateKey)); } catch (e) { logger(e.message); return Buffer.alloc(32); @@ -120,7 +120,7 @@ export abstract class AbstractHandshake { protected getHash(a: bytes, b: bytes): bytes32 { return Buffer.from( hash.sha256().update(Buffer.from([...a, ...b])).digest('hex') - ) + ); } protected mixKey(ss: SymmetricState, ikm: bytes32): void { diff --git a/src/utils.ts b/src/utils.ts index 77832b0..3c25349 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -11,9 +11,9 @@ import {pb} from "./proto/payload"; const NoiseHandshakePayloadProto = pb.NoiseHandshakePayload; export function generateKeypair(): KeyPair { - const keyPair = box.keyPair() - const publicKey = Buffer.from(keyPair['publicKey']) - const privateKey = Buffer.from(keyPair['secretKey']) + const keyPair = box.keyPair(); + const publicKey = Buffer.from(keyPair['publicKey']); + const privateKey = Buffer.from(keyPair['secretKey']); return { publicKey, @@ -101,7 +101,7 @@ export async function verifySignedPayload( } export function getHkdf(ck: bytes32, ikm: bytes): Hkdf { - const okm = hkdf(ikm, 96, {salt: ck, hash: 'SHA-256'}) + const okm = hkdf(ikm, 96, {salt: ck, hash: 'SHA-256'}); const k1 = okm.slice(0, 32); const k2 = okm.slice(32, 64);