package com.google.android.gms.internal.ads;

import java.security.GeneralSecurityException;

/* JADX INFO: loaded from: classes2.dex */
public final class c72 extends b82 {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final y62 f9797b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final i92 f9798c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final i92 f9799d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Integer f9800e;

    public c72(y62 y62Var, i92 i92Var, i92 i92Var2, Integer num) {
        this.f9797b = y62Var;
        this.f9798c = i92Var;
        this.f9799d = i92Var2;
        this.f9800e = num;
    }

    public static c72 A(x62 x62Var, i92 i92Var, Integer num) throws GeneralSecurityException {
        i92 i92VarA;
        y62 y62Var = new y62(x62Var);
        x62 x62Var2 = x62.f18330e;
        boolean zEquals = x62Var.equals(x62Var2);
        String str = x62Var.f18331a;
        if (!zEquals && num == null) {
            throw new GeneralSecurityException(defpackage.e.p(new StringBuilder(str.length() + 62), "For given Variant ", str, " the value of idRequirement must be non-null"));
        }
        if (x62Var.equals(x62Var2) && num != null) {
            throw new GeneralSecurityException("For given Variant NO_PREFIX the value of idRequirement must be null");
        }
        byte[] bArr = i92Var.f12427a;
        if (bArr.length != 32) {
            int length = bArr.length;
            throw new GeneralSecurityException(defpackage.e.n(new StringBuilder(String.valueOf(length).length() + 65), "Ed25519 key must be constructed with key of length 32 bytes, not ", length));
        }
        if (x62Var == x62Var2) {
            i92VarA = u02.f17053a;
        } else if (x62Var == x62.f18328c || x62Var == x62.f18329d) {
            i92VarA = u02.a(num.intValue());
        } else {
            if (x62Var != x62.f18327b) {
                throw new IllegalStateException("Unknown Variant: ".concat(str));
            }
            i92VarA = u02.b(num.intValue());
        }
        return new c72(y62Var, i92Var, i92VarA, num);
    }

    @Override // com.google.android.gms.internal.ads.rb
    public final /* synthetic */ dw1 i() {
        return this.f9797b;
    }

    @Override // com.google.android.gms.internal.ads.rb
    public final Integer r() {
        return this.f9800e;
    }

    @Override // com.google.android.gms.internal.ads.b82
    public final i92 z() {
        return this.f9799d;
    }
}
