Merge remote-tracking branch 'remotes/origin/master' into morrigan/encrypt-stream

# Conflicts:
#	src/@types/it-pb-rpc/index.d.ts
#	src/@types/libp2p.ts
#	src/crypto.ts
#	src/handshake.ts
#	src/noise.ts
#	src/utils.ts
#	src/xx.ts
This commit is contained in:
morrigan 2019-11-28 17:52:42 +01:00
commit 91af449231
2 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,6 @@
export type Duplex = [Stream, Stream]; export type Duplex = [Stream, Stream];
type Stream = { type Stream = {
sink(source: Iterable<any>), sink(source: Iterable<any>);
source: Object, source: Record<string, any>;
} }

View File

@ -6,7 +6,6 @@ import { bytes32, uint32, uint64, bytes } from './@types/basic'
import { KeyPair } from './@types/libp2p' import { KeyPair } from './@types/libp2p'
import { generateKeypair } from './utils'; import { generateKeypair } from './utils';
export interface MessageBuffer { export interface MessageBuffer {
ne: bytes32; ne: bytes32;
ns: bytes; ns: bytes;
@ -156,7 +155,7 @@ export class XXHandshake {
return { cs, ck, h }; return { cs, ck, h };
} }
private mixKey(ss: SymmetricState, ikm: bytes32) { private mixKey(ss: SymmetricState, ikm: bytes32): void {
const [ ck, tempK ] = this.getHkdf(ss.ck, ikm); const [ ck, tempK ] = this.getHkdf(ss.ck, ikm);
ss.cs = this.initializeKey(tempK) as CipherState; ss.cs = this.initializeKey(tempK) as CipherState;
ss.ck = ck; ss.ck = ck;