mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-05-02 15:32:31 +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 {
|
protected dh(privateKey: bytes32, publicKey: bytes32): bytes32 {
|
||||||
try {
|
try {
|
||||||
return Buffer.from(box.before(publicKey, privateKey));
|
return Buffer.from(box.before(publicKey, privateKey), 0, 32);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger(e.message);
|
logger(e.message);
|
||||||
return Buffer.alloc(32);
|
return Buffer.alloc(32);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user