@Test
public void validateKeyFormat_checkAllLengths() throws Exception {

  AesSivKeyManager manager = new AesSivKeyManager();
  for (int i = 0; i < 100; i++) {
    if (i == 64) {
      manager.keyFactory().validateKeyFormat(createAesSivKeyFormat(i));
    } else {
      try {
        manager.keyFactory().validateKeyFormat(createAesSivKeyFormat(i));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
    }
  }
}