mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 17:32:25 +00:00
Convert shared key to Buffer with 32 length
This commit is contained in:
parent
2745783db3
commit
3866d8a077
@ -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), 0, 32);
|
||||
} catch (e) {
|
||||
logger(e.message);
|
||||
return Buffer.alloc(32);
|
||||
|
Loading…
x
Reference in New Issue
Block a user