byte[] hash = calcHandshakeHash(received, sent);
byte[] clientHash = new byte[hash.length];
new DataInputStream(in).readFully(clientHash);
if (!Arrays.equals(clientHash, hash)) {
throw new DiscoveryProtocolException(
"handshake hash mismatch");
}
Plaintext.writeUnicastResponse(out, response, context);
out.flush();