.class public final Lz5/db;
.super Ljava/lang/Object;
.source ""


# instance fields
.field public final a:I

.field public final b:Ljava/lang/Object;

.field public c:Ljava/lang/Object;

.field public d:I

.field public e:Ljava/lang/Object;

.field public f:Ljava/lang/Object;


# direct methods
.method public constructor <init>(Lz5/qh1;)V
    .registers 5

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    invoke-virtual {p1}, Lz5/qh1;->w()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lz5/db;->b:Ljava/lang/Object;

    sget-object v1, Lz5/nd1;->b:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_35

    :try_start_11
    invoke-virtual {p1}, Lz5/qh1;->x()Lz5/zj1;

    move-result-object v0

    invoke-static {}, Lz5/lk1;->a()Lz5/lk1;

    move-result-object v1

    invoke-static {v0, v1}, Lz5/fg1;->x(Lz5/zj1;Lz5/lk1;)Lz5/fg1;

    move-result-object v0

    invoke-static {p1}, Lz5/ld1;->f(Lz5/qh1;)Lz5/bm1;

    move-result-object p1

    check-cast p1, Lz5/dg1;

    iput-object p1, p0, Lz5/db;->e:Ljava/lang/Object;

    invoke-virtual {v0}, Lz5/fg1;->w()I

    move-result p1

    iput p1, p0, Lz5/db;->a:I
    :try_end_2b
    .catch Lz5/il1; {:try_start_11 .. :try_end_2b} :catch_2c

    goto :goto_94

    :catch_2c
    move-exception p1

    new-instance v0, Ljava/security/GeneralSecurityException;

    const-string v1, "invalid KeyFormat protobuf, expected AesGcmKeyFormat"

    invoke-direct {v0, v1, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0

    :cond_35
    sget-object v1, Lz5/nd1;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    const-string v2, "invalid KeyFormat protobuf, expected AesCtrHmacAeadKeyFormat"

    if-eqz v1, :cond_72

    :try_start_3f
    invoke-virtual {p1}, Lz5/qh1;->x()Lz5/zj1;

    move-result-object v0

    invoke-static {}, Lz5/lk1;->a()Lz5/lk1;

    move-result-object v1

    invoke-static {v0, v1}, Lz5/of1;->y(Lz5/zj1;Lz5/lk1;)Lz5/of1;

    move-result-object v0

    invoke-static {p1}, Lz5/ld1;->f(Lz5/qh1;)Lz5/bm1;

    move-result-object p1

    check-cast p1, Lz5/mf1;

    iput-object p1, p0, Lz5/db;->c:Ljava/lang/Object;

    invoke-virtual {v0}, Lz5/of1;->w()Lz5/sf1;

    move-result-object p1

    invoke-virtual {p1}, Lz5/sf1;->x()I

    move-result p1

    iput p1, p0, Lz5/db;->d:I

    invoke-virtual {v0}, Lz5/of1;->x()Lz5/kh1;

    move-result-object p1

    invoke-virtual {p1}, Lz5/kh1;->x()I

    move-result p1

    iget v0, p0, Lz5/db;->d:I

    add-int/2addr v0, p1

    iput v0, p0, Lz5/db;->a:I
    :try_end_6a
    .catch Lz5/il1; {:try_start_3f .. :try_end_6a} :catch_6b

    goto :goto_94

    :catch_6b
    move-exception p1

    new-instance v0, Ljava/security/GeneralSecurityException;

    invoke-direct {v0, v2, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0

    :cond_72
    sget-object v1, Lz5/oe1;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_9c

    :try_start_7a
    invoke-virtual {p1}, Lz5/qh1;->x()Lz5/zj1;

    move-result-object v0

    invoke-static {}, Lz5/lk1;->a()Lz5/lk1;

    move-result-object v1

    invoke-static {v0, v1}, Lz5/og1;->x(Lz5/zj1;Lz5/lk1;)Lz5/og1;

    move-result-object v0

    invoke-static {p1}, Lz5/ld1;->f(Lz5/qh1;)Lz5/bm1;

    move-result-object p1

    check-cast p1, Lz5/lg1;

    iput-object p1, p0, Lz5/db;->f:Ljava/lang/Object;

    invoke-virtual {v0}, Lz5/og1;->w()I

    move-result p1

    iput p1, p0, Lz5/db;->a:I
    :try_end_94
    .catch Lz5/il1; {:try_start_7a .. :try_end_94} :catch_95

    :goto_94
    return-void

    :catch_95
    move-exception p1

    new-instance v0, Ljava/security/GeneralSecurityException;

    invoke-direct {v0, v2, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0

    :cond_9c
    new-instance p1, Ljava/security/GeneralSecurityException;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "unsupported AEAD DEM key type: "

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v2

    if-eqz v2, :cond_af

    invoke-virtual {v1, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_b4

    :cond_af
    new-instance v0, Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    :goto_b4
    invoke-direct {p1, v0}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public constructor <init>([J[II[J[I)V
    .registers 11

    .line 2
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    array-length v0, p4

    array-length v1, p2

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-ne v1, v0, :cond_b

    move v1, v2

    goto :goto_c

    :cond_b
    move v1, v3

    :goto_c
    invoke-static {v1}, Lcom/google/android/gms/internal/ads/r;->e(Z)V

    array-length v1, p1

    if-ne v1, v0, :cond_14

    move v4, v2

    goto :goto_15

    :cond_14
    move v4, v3

    :goto_15
    invoke-static {v4}, Lcom/google/android/gms/internal/ads/r;->e(Z)V

    array-length v4, p5

    if-ne v4, v0, :cond_1c

    goto :goto_1d

    :cond_1c
    move v2, v3

    :goto_1d
    invoke-static {v2}, Lcom/google/android/gms/internal/ads/r;->e(Z)V

    iput-object p1, p0, Lz5/db;->b:Ljava/lang/Object;

    iput-object p2, p0, Lz5/db;->c:Ljava/lang/Object;

    iput p3, p0, Lz5/db;->d:I

    iput-object p4, p0, Lz5/db;->e:Ljava/lang/Object;

    iput-object p5, p0, Lz5/db;->f:Ljava/lang/Object;

    iput v1, p0, Lz5/db;->a:I

    return-void
.end method


# virtual methods
.method public a(J)I
    .registers 6

    iget-object v0, p0, Lz5/db;->e:Ljava/lang/Object;

    check-cast v0, [J

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-static {v0, p1, p2, v1, v2}, Lz5/be;->c([JJZZ)I

    move-result p1

    :goto_a
    if-ltz p1, :cond_19

    iget-object p2, p0, Lz5/db;->f:Ljava/lang/Object;

    check-cast p2, [I

    aget p2, p2, p1

    and-int/2addr p2, v1

    if-eqz p2, :cond_16

    return p1

    :cond_16
    add-int/lit8 p1, p1, -0x1

    goto :goto_a

    :cond_19
    const/4 p1, -0x1

    return p1
.end method

.method public b(J)I
    .registers 6

    iget-object v0, p0, Lz5/db;->e:Ljava/lang/Object;

    check-cast v0, [J

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-static {v0, p1, p2, v1, v2}, Lz5/be;->d([JJZZ)I

    move-result p1

    :goto_a
    iget-object p2, p0, Lz5/db;->e:Ljava/lang/Object;

    check-cast p2, [J

    array-length p2, p2

    if-ge p1, p2, :cond_1e

    iget-object p2, p0, Lz5/db;->f:Ljava/lang/Object;

    check-cast p2, [I

    aget p2, p2, p1

    and-int/2addr p2, v1

    if-eqz p2, :cond_1b

    return p1

    :cond_1b
    add-int/lit8 p1, p1, 0x1

    goto :goto_a

    :cond_1e
    const/4 p1, -0x1

    return p1
.end method
