what-the-bank/sources/com/google/android/gms/internal/p002firebaseauthapi/zzij.java

94 lines
3.5 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.p002firebaseauthapi;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
/* loaded from: classes2.dex */
public final class zzij {
private Integer zza;
private Integer zzb;
private zzik zzc;
private zzil zzd;
private zzij() {
this.zza = null;
this.zzb = null;
this.zzc = null;
throw null;
}
public final zzij zzb(int i) throws GeneralSecurityException {
this.zza = Integer.valueOf(i);
return this;
}
public final zzij zzc(int i) throws GeneralSecurityException {
this.zzb = Integer.valueOf(i);
return this;
}
public final zzin zze() throws GeneralSecurityException {
Integer num = this.zza;
if (num == null) {
throw new GeneralSecurityException("key size is not set");
}
if (this.zzb == null) {
throw new GeneralSecurityException("tag size is not set");
}
if (this.zzc == null) {
throw new GeneralSecurityException("hash type is not set");
}
if (num.intValue() < 16) {
throw new InvalidAlgorithmParameterException(String.format("Invalid key size in bytes %d; must be at least 16 bytes", this.zza));
}
int intValue = this.zzb.intValue();
zzik zzikVar = this.zzc;
if (intValue >= 10) {
if (zzikVar == zzik.zza) {
if (intValue > 20) {
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 20 bytes for SHA1", Integer.valueOf(intValue)));
}
} else if (zzikVar == zzik.zzb) {
if (intValue > 28) {
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 28 bytes for SHA224", Integer.valueOf(intValue)));
}
} else if (zzikVar == zzik.zzc) {
if (intValue > 32) {
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 32 bytes for SHA256", Integer.valueOf(intValue)));
}
} else if (zzikVar == zzik.zzd) {
if (intValue > 48) {
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 48 bytes for SHA384", Integer.valueOf(intValue)));
}
} else {
if (zzikVar != zzik.zze) {
throw new GeneralSecurityException("unknown hash type; must be SHA256, SHA384 or SHA512");
}
if (intValue > 64) {
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 64 bytes for SHA512", Integer.valueOf(intValue)));
}
}
return new zzin(this.zza.intValue(), this.zzb.intValue(), this.zzd, this.zzc, null);
}
throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; must be at least 10 bytes", Integer.valueOf(intValue)));
}
public final zzij zzd(zzil zzilVar) {
this.zzd = zzilVar;
return this;
}
public final zzij zza(zzik zzikVar) {
this.zzc = zzikVar;
return this;
}
/* JADX INFO: Access modifiers changed from: package-private */
public /* synthetic */ zzij(zzii zziiVar) {
this.zza = null;
this.zzb = null;
this.zzc = null;
this.zzd = zzil.zzd;
}
}