package com.google.android.gms.internal.ads; import java.security.GeneralSecurityException; /* loaded from: classes3.dex */ public final class zzggg { private zzggq zza = null; private zzgvp zzb = null; private Integer zzc = null; private zzggg() { } public /* synthetic */ zzggg(zzggh zzgghVar) { } public final zzggg zza(Integer num) { this.zzc = num; return this; } public final zzggg zzb(zzgvp zzgvpVar) { this.zzb = zzgvpVar; return this; } public final zzggg zzc(zzggq zzggqVar) { this.zza = zzggqVar; return this; } public final zzggi zzd() throws GeneralSecurityException { zzgvp zzgvpVar; zzgvo zzb; zzggq zzggqVar = this.zza; if (zzggqVar == null || (zzgvpVar = this.zzb) == null) { throw new GeneralSecurityException("Cannot build without parameters and/or key material"); } if (zzggqVar.zzb() != zzgvpVar.zza()) { throw new GeneralSecurityException("Key size mismatch"); } if (zzggqVar.zza() && this.zzc == null) { throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement"); } if (!this.zza.zza() && this.zzc != null) { throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement"); } if (this.zza.zzd() == zzggo.zzc) { zzb = zzgml.zza; } else if (this.zza.zzd() == zzggo.zzb) { zzb = zzgml.zza(this.zzc.intValue()); } else { if (this.zza.zzd() != zzggo.zza) { throw new IllegalStateException("Unknown AesGcmSivParameters.Variant: ".concat(String.valueOf(this.zza.zzd()))); } zzb = zzgml.zzb(this.zzc.intValue()); } return new zzggi(this.zza, this.zzb, zzb, this.zzc, null); } }