mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 05:52:29 +00:00
Fix linting errors
This commit is contained in:
parent
c48ca75b26
commit
99d3c769c9
@ -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 {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user