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

import java.security.GeneralSecurityException;

/* JADX INFO: loaded from: classes2.dex */
public final class gy1 extends jw1 {

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

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

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

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

    public gy1(ky1 ky1Var, jc1 jc1Var, i92 i92Var, Integer num) {
        this.f11918b = ky1Var;
        this.f11919c = jc1Var;
        this.f11920d = i92Var;
        this.f11921e = num;
    }

    public static gy1 A(ky1 ky1Var, jc1 jc1Var, Integer num) throws GeneralSecurityException {
        i92 i92VarB;
        jy1 jy1Var = ky1Var.f13433a;
        jy1 jy1Var2 = jy1.f13038c;
        if (jy1Var != jy1Var2 && num == null) {
            String str = jy1Var.f13039a;
            throw new GeneralSecurityException(defpackage.e.p(new StringBuilder(str.length() + 62), "For given Variant ", str, " the value of idRequirement must be non-null"));
        }
        if (jy1Var == jy1Var2 && num != null) {
            throw new GeneralSecurityException("For given Variant NO_PREFIX the value of idRequirement must be null");
        }
        if (jc1Var.i() != 32) {
            int i10 = jc1Var.i();
            throw new GeneralSecurityException(defpackage.e.n(new StringBuilder(String.valueOf(i10).length() + 68), "XAesGcmKey key must be constructed with key of length 32 bytes, not ", i10));
        }
        if (jy1Var == jy1Var2) {
            i92VarB = u02.f17053a;
        } else {
            if (jy1Var != jy1.f13037b) {
                throw new IllegalStateException("Unknown Variant: ".concat(jy1Var.f13039a));
            }
            i92VarB = u02.b(num.intValue());
        }
        return new gy1(ky1Var, jc1Var, i92VarB, num);
    }

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

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

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