code: func generateKeys(d direction, algs directionAlgorithms, kex *kexResult) (iv, key, macKey []byte) {
  	cipherMode := cipherModes[algs.Cipher]
  	macMode := macModes[algs.MAC]
  
  	iv = make([]byte, cipherMode.ivSize)
  	key = make([]byte, cipherMode.keySize)
  	macKey = make([]byte, macMode.keySize)
  
  	generateKeyMaterial(iv, d.ivTag, kex)
  	generateKeyMaterial(key, d.keyTag, kex)
  	generateKeyMaterial(macKey, d.macKeyTag, kex)
  	return
  }
docs: // generateKeys generates key material for IV, MAC and encryption.