code: protected void calculateExchangeHash() throws SshException {
  
  		Digest hash = (Digest) ComponentManager.getInstance()
  				.supportedDigests().getInstance("SHA-1");
  
  		// The local software version comments
  		hash.putString(clientId);
  
  		// The remote software version comments
  		hash.putString(serverId);
  
  		// The local kex init payload
  		hash.putInt(clientKexInit.length);
  		hash.putBytes(clientKexInit);
  
  		// The remote kex init payload
  		hash.putInt(serverKexInit.length);
  		hash.putBytes(serverKexInit);
  
  		// The host key
  		hash.putInt(hostKey.length);
  		hash.putBytes(hostKey);
  
  		// The diffie hellman e value
  		hash.putBigInteger(e);
  
  		// The diffie hellman f value
  		hash.putBigInteger(f);
  
  		// The diffie hellman k value
  		hash.putBigInteger(secret);
  
  		// Do the final output
  		exchangeHash = hash.doFinal();
  	}
docs: <p>
  Calculates the exchange hash as an SHA1 hash of the following data.
  <blockquote>
  
  <pre>
  String         the client's version string (CR and NL excluded)
  String         the server's version string (CR and NL excluded)
  String         the payload of the client's SSH_MSG_KEXINIT
  String         the payload of the server's SSH_MSG_KEXINIT
  String         the host key
  BigInteger     e, exchange value sent by the client
  BigInteger     f, exchange value sent by the server
  BigInteger     K, the shared secret
  </pre>
  
  </blockquote>
  </p>
  
  @throws IOException