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