@Test
public void testAes128CtrHmacSha2561MBTemplate() throws Exception {

  KeyTemplate template = AesCtrHmacStreamingKeyManager.aes128CtrHmacSha2561MBTemplate();
  assertThat(template.getTypeUrl()).isEqualTo(new AesCtrHmacStreamingKeyManager().getKeyType());
  assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.RAW);
  AesCtrHmacStreamingKeyFormat format =
      AesCtrHmacStreamingKeyFormat.parseFrom(
          template.getValue(), ExtensionRegistryLite.getEmptyRegistry());
  assertThat(format.getKeySize()).isEqualTo(16);
  assertThat(format.getParams().getDerivedKeySize()).isEqualTo(16);
  assertThat(format.getParams().getHkdfHashType()).isEqualTo(HashType.SHA256);
  assertThat(format.getParams().getHmacParams().getHash()).isEqualTo(HashType.SHA256);
  assertThat(format.getParams().getHmacParams().getTagSize()).isEqualTo(32);
  assertThat(format.getParams().getCiphertextSegmentSize()).isEqualTo(1 << 20);
}