@Test public void testPoly1305VerifyMacThrowsIllegalArgExpWhenKeyLenIsLessThan32() throws GeneralSecurityException { try { Poly1305.verifyMac(new byte[MAC_KEY_SIZE_IN_BYTES - 1], new byte[0], new byte[0]); fail("Expected IllegalArgumentException."); } catch (IllegalArgumentException e) { Truth.assertThat(e).hasMessageThat().containsMatch("The key length in bytes must be 32."); } }
static void verifyMac(final byte[] key, byte[] data, byte[] mac) throws GeneralSecurityException { if (!Bytes.equal(computeMac(key, data), mac)) { throw new GeneralSecurityException("invalid MAC"); } }
Poly1305 { static void verifyMac(final byte[] key, byte[] data, byte[] mac) throws GeneralSecurityException { if (!Bytes.equal(computeMac(key, data), mac)) { throw new GeneralSecurityException("invalid MAC"); } } }
Poly1305 { static void verifyMac(final byte[] key, byte[] data, byte[] mac) throws GeneralSecurityException { if (!Bytes.equal(computeMac(key, data), mac)) { throw new GeneralSecurityException("invalid MAC"); } } private  Poly1305(); }
Poly1305 { static void verifyMac(final byte[] key, byte[] data, byte[] mac) throws GeneralSecurityException { if (!Bytes.equal(computeMac(key, data), mac)) { throw new GeneralSecurityException("invalid MAC"); } } private  Poly1305();  }
Poly1305 { static void verifyMac(final byte[] key, byte[] data, byte[] mac) throws GeneralSecurityException { if (!Bytes.equal(computeMac(key, data), mac)) { throw new GeneralSecurityException("invalid MAC"); } } private  Poly1305();  static final int MAC_TAG_SIZE_IN_BYTES; static final int MAC_KEY_SIZE_IN_BYTES; }