code: func (t *rlpx) doEncHandshake(prv *ecdsa.PrivateKey, dial *ecdsa.PublicKey) (*ecdsa.PublicKey, error) {
  	var (
  		sec secrets
  		err error
  	)
  	if dial == nil {
  		sec, err = receiverEncHandshake(t.fd, prv)
  	} else {
  		sec, err = initiatorEncHandshake(t.fd, prv, dial)
  	}
  	if err != nil {
  		return nil, err
  	}
  	t.wmu.Lock()
  	t.rw = newRLPXFrameRW(t.fd, sec)
  	t.wmu.Unlock()
  	return sec.Remote.ExportECDSA(), nil
  }
docs: // doEncHandshake runs the protocol handshake using authenticated
  // messages. the protocol handshake is the first authenticated message
  // and also verifies whether the encryption handshake 'worked' and the
  // remote side actually provided the right public key.