synchronized( macsha1 ) { // MAC is not thread-safe
macsha1.init(_salt);
byte[] hostBytes = Util.str2byte(host);
macsha1.update(hostBytes, 0, hostBytes.length);
byte[] hashValue = new byte[macsha1.getBlockSize()];
macsha1.doFinal(hashValue, 0);
return Arrays.equals(_hashedHost, hashValue);
}
} catch(Exception e) {
throw new IllegalStateException("Failed to check HashedHostKey isMatched(): "+e, e);
}