@Test
  public void testMacTestVectors() throws Exception {
    assumeFalse(TinkFips.useOnlyFips());
    for (AesCmacTestVector t : CMAC_TEST_VECTORS_FROM_RFC) {
      ChunkedMac mac = new ChunkedAesCmacImpl(t.key);

      try {
        ChunkedMacComputation macComputation = mac.createComputation();
        macComputation.update(ByteBuffer.wrap(t.message));
        assertThat(t.tag).isEqualTo(macComputation.computeMac());
      } catch (GeneralSecurityException e) {
        throw new AssertionError("Valid computation, should not throw exception", e);
      }

      try {
        ChunkedMacVerification macVerification = mac.createVerification(t.tag);
        macVerification.update(ByteBuffer.wrap(t.message));
        macVerification.verifyMac();
      } catch (GeneralSecurityException e) {
        throw new AssertionError("Valid tag, verification should not throw exception", e);
      }
    }
  }
A cute little table to help verify that the tests below indeed cover the major (when not all)
code paths in our streaming AesCmac implementation:

<p>-------------------------------------
| Inner state | Amount of new data |  # |
----------------------------------------
| empty       | empty              |  0 |
| empty       | not overflowing    |  1 |
| empty       | overflowing        |  2 |
| empty       | a lot              |  3 |
----------------------------------------
| some data   | empty              |  4 |
| some data   | not overflowing    |  5 |
| some data   | overflowing        |  6 |
| some data   | a lot              |  7 |
----------------------------------------
| full        | empty              |  8 |
| full        | not overfl. (^)    |  9 |
| full        | overflowing        | 10 |
| full        | a lot              | 11 |
----------------------------------------
java_src/src/test/java/com/google/crypto/tink/mac/internal/ChunkedAesCmacTest.java