mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 18:32:22 +00:00
Address PR comment, rename constant
This commit is contained in:
parent
7bad317d0e
commit
4dc1a2ab95
@ -5,7 +5,7 @@ import {bytes, bytes32, uint32} from "../@types/basic";
|
|||||||
import {CipherState, MessageBuffer, SymmetricState} from "../@types/handshake";
|
import {CipherState, MessageBuffer, SymmetricState} from "../@types/handshake";
|
||||||
import {getHkdf} from "../utils";
|
import {getHkdf} from "../utils";
|
||||||
|
|
||||||
const minNonce = 0;
|
export const MIN_NONCE = 0;
|
||||||
|
|
||||||
export abstract class AbstractHandshake {
|
export abstract class AbstractHandshake {
|
||||||
public encryptWithAd(cs: CipherState, ad: bytes, plaintext: bytes): bytes {
|
public encryptWithAd(cs: CipherState, ad: bytes, plaintext: bytes): bytes {
|
||||||
@ -122,7 +122,7 @@ export abstract class AbstractHandshake {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected initializeKey(k: bytes32): CipherState {
|
protected initializeKey(k: bytes32): CipherState {
|
||||||
const n = minNonce;
|
const n = MIN_NONCE;
|
||||||
return { k, n };
|
return { k, n };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user