Fix linting errors

This commit is contained in:
Matija Petrunic 2020-04-06 19:16:05 +02:00
parent c48ca75b26
commit 99d3c769c9
2 changed files with 6 additions and 6 deletions

View File

@ -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 {

View File

@ -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);