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