code: func (h *encHandshake) secrets(auth, authResp []byte) (secrets, error) {
  	ecdheSecret, err := h.randomPrivKey.GenerateShared(h.remoteRandomPub, sskLen, sskLen)
  	if err != nil {
  		return secrets{}, err
  	}
  
  	// derive base secrets from ephemeral key agreement
  	sharedSecret := crypto.Keccak256(ecdheSecret, crypto.Keccak256(h.respNonce, h.initNonce))
  	aesSecret := crypto.Keccak256(ecdheSecret, sharedSecret)
  	s := secrets{
  		Remote: h.remote,
  		AES:    aesSecret,
  		MAC:    crypto.Keccak256(ecdheSecret, aesSecret),
  	}
  
  	// setup sha3 instances for the MACs
  	mac1 := sha3.NewLegacyKeccak256()
  	mac1.Write(xor(s.MAC, h.respNonce))
  	mac1.Write(auth)
  	mac2 := sha3.NewLegacyKeccak256()
  	mac2.Write(xor(s.MAC, h.initNonce))
  	mac2.Write(authResp)
  	if h.initiator {
  		s.EgressMAC, s.IngressMAC = mac1, mac2
  	} else {
  		s.EgressMAC, s.IngressMAC = mac2, mac1
  	}
  
  	return s, nil
  }
docs: // secrets is called after the handshake is completed.
  // It extracts the connection secrets from the handshake values.