package com.google.android.gms.internal.p002firebaseauthapi; import java.nio.ByteBuffer; import java.security.GeneralSecurityException; /* loaded from: classes.dex */ public final class zzdx { private zzeh zza = null; private zzwj zzb = null; private Integer zzc = null; /* synthetic */ zzdx(zzdw zzdwVar) { } public final zzdx zza(Integer num) { this.zzc = num; return this; } public final zzdx zzb(zzwj zzwjVar) { this.zzb = zzwjVar; return this; } public final zzdx zzc(zzeh zzehVar) { this.zza = zzehVar; return this; } public final zzdz zzd() { zzwj zzwjVar; zzwi zzb; zzeh zzehVar = this.zza; if (zzehVar == null || (zzwjVar = this.zzb) == null) { throw new GeneralSecurityException("Cannot build without parameters and/or key material"); } if (zzehVar.zzb() != zzwjVar.zza()) { throw new GeneralSecurityException("Key size mismatch"); } if (zzehVar.zzd() && this.zzc == null) { throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement"); } if (!this.zza.zzd() && this.zzc != null) { throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement"); } if (this.zza.zzc() == zzef.zzc) { zzb = zzwi.zzb(new byte[0]); } else if (this.zza.zzc() == zzef.zzb) { zzb = zzwi.zzb(ByteBuffer.allocate(5).put((byte) 0).putInt(this.zzc.intValue()).array()); } else { if (this.zza.zzc() != zzef.zza) { throw new IllegalStateException("Unknown AesEaxParameters.Variant: ".concat(String.valueOf(this.zza.zzc()))); } zzb = zzwi.zzb(ByteBuffer.allocate(5).put((byte) 1).putInt(this.zzc.intValue()).array()); } return new zzdz(this.zza, this.zzb, zzb, this.zzc, null); } private zzdx() { } }