in src/keyschedule.js [80:94]
async addECDHE(ecdhe) {
// Mix in the ECDHE output (if any) to calculate the "handshake secret".
if (ecdhe === null) {
ecdhe = zeros(HASH_LENGTH);
}
if (this.stage !== STAGE_EARLY_SECRET) {
throw new TLSError(ALERT_DESCRIPTION.INTERNAL_ERROR);
}
this.stage = STAGE_HANDSHAKE_SECRET;
this.extBinderKey = null;
this.secret = await hkdfExtract(this.secret, ecdhe);
this.clientHandshakeTrafficSecret = await this.deriveSecret('c hs traffic');
this.serverHandshakeTrafficSecret = await this.deriveSecret('s hs traffic');
this.secret = await this.deriveSecret('derived', EMPTY);
}