@Test
public void testDigest()
    throws NoSuchAlgorithmException {

    byte[] msg = "message".getBytes();
    byte[] hash = Digest.digest(msg);
    if(hash.length != Digest.HASH_SIZE_BYTES) {
        fail("Computation of hash failed - wrong length.");
    }
    assertNotNull("Computation of hash failed - null", hash);
    assertFalse("Computation of hash failed - hash is all zeros",
                Arrays.equals(hash, new byte[Digest.HASH_SIZE_BYTES]));
}