byte[] resBuf = new byte[digest.getDigestSize()];
for (int i = 0; i < messages.length; i++)
{
byte[] m = messages[i].getBytes();
digest.update(m, 0, m.length);
digest.doFinal(resBuf, 0);
if (!arraysEqual(resBuf, Hex.decode(digests[i])))
{
return new SimpleTestResult(false, getName() + ": Vector " + i + " failed");