private static AesSivParameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to AesSivParameters.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    com.google.crypto.tink.proto.AesSivKeyFormat format;
    try {
      format =
          com.google.crypto.tink.proto.AesSivKeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
      if (format.getVersion() != 0) {
        throw new GeneralSecurityException("Only version 0 keys are accepted");
      }
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing AesSivParameters failed: ", e);
    }
    return AesSivParameters.builder()
        .setKeySizeBytes(format.getKeySize())
        .setVariant(toVariant(serialization.getKeyTemplate().getOutputPrefixType()))
        .build();
  }
Parse LEGACY prefix to CRUNCHY, since they act the same for this type of key
java_src/src/main/java/com/google/crypto/tink/daead/internal/AesSivProtoSerialization.java