@Test
public void testPrfPrefixOfMac() throws Exception {

  for (MacTestVector t : HMAC_TEST_VECTORS) {
    Prf prf = new PrfHmacJce(t.algName, new SecretKeySpec(t.key, "HMAC"));
    Mac mac = new PrfMac(prf, t.tag.length);
    byte[] prBytes = prf.compute(t.message, t.tag.length - 1);
    byte[] tag = mac.computeMac(t.message);
    assertEquals(prBytes.length, t.tag.length - 1);
    assertArrayEquals(prBytes, Arrays.copyOf(tag, prBytes.length));
  }
}