.class public abstract Lz5/ti1;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lz5/oc1;


# instance fields
.field public final a:Lcom/google/android/gms/internal/ads/r8;

.field public final b:Lcom/google/android/gms/internal/ads/r8;


# direct methods
.method public constructor <init>([B)V
    .registers 4

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

    const/4 v0, 0x1

    invoke-static {v0}, Lcom/google/android/gms/internal/ads/h8;->h(I)Z

    move-result v1

    if-eqz v1, :cond_18

    invoke-virtual {p0, p1, v0}, Lz5/ti1;->b([BI)Lcom/google/android/gms/internal/ads/r8;

    move-result-object v0

    iput-object v0, p0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lz5/ti1;->b([BI)Lcom/google/android/gms/internal/ads/r8;

    move-result-object p1

    iput-object p1, p0, Lz5/ti1;->b:Lcom/google/android/gms/internal/ads/r8;

    return-void

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

    const-string v0, "Can not use ChaCha20Poly1305 in FIPS-mode."

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

    throw p1
.end method


# virtual methods
.method public final a([B[B)[B
    .registers 62

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    array-length v2, v1

    iget-object v3, v0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/ads/r8;->c()I

    move-result v3

    const v4, 0x7fffffff

    sub-int/2addr v4, v3

    add-int/lit8 v4, v4, -0x10

    if-gt v2, v4, :cond_2d6

    iget-object v3, v0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/ads/r8;->c()I

    move-result v3

    add-int/2addr v3, v2

    const/16 v4, 0x10

    add-int/2addr v3, v4

    invoke-static {v3}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v5

    iget-object v6, v0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    invoke-virtual {v6}, Lcom/google/android/gms/internal/ads/r8;->c()I

    move-result v6

    add-int/2addr v6, v2

    add-int/2addr v6, v4

    if-lt v5, v6, :cond_2ce

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->position()I

    move-result v2

    iget-object v5, v0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    invoke-virtual {v5, v3, v1}, Lcom/google/android/gms/internal/ads/r8;->d(Ljava/nio/ByteBuffer;[B)V

    invoke-virtual {v3, v2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    iget-object v1, v0, Lz5/ti1;->a:Lcom/google/android/gms/internal/ads/r8;

    invoke-virtual {v1}, Lcom/google/android/gms/internal/ads/r8;->c()I

    move-result v1

    new-array v1, v1, [B

    invoke-virtual {v3, v1}, Ljava/nio/ByteBuffer;->get([B)Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->limit()I

    move-result v2

    add-int/lit8 v2, v2, -0x10

    invoke-virtual {v3, v2}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    iget-object v2, v0, Lz5/ti1;->b:Lcom/google/android/gms/internal/ads/r8;

    const/4 v5, 0x0

    invoke-virtual {v2, v1, v5}, Lcom/google/android/gms/internal/ads/r8;->e([BI)Ljava/nio/ByteBuffer;

    move-result-object v1

    const/16 v2, 0x20

    new-array v6, v2, [B

    invoke-virtual {v1, v6}, Ljava/nio/ByteBuffer;->get([B)Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v1

    rem-int/lit8 v7, v1, 0x10

    if-nez v7, :cond_67

    move v8, v1

    goto :goto_6a

    :cond_67
    add-int/lit8 v8, v1, 0x10

    sub-int/2addr v8, v7

    :goto_6a
    add-int/lit8 v7, v8, 0x10

    invoke-static {v7}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v7

    sget-object v9, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;

    invoke-virtual {v7, v9}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    move-result-object v7

    move-object/from16 v9, p2

    invoke-virtual {v7, v9}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    invoke-virtual {v7, v5}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    invoke-virtual {v7, v3}, Ljava/nio/ByteBuffer;->put(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;

    invoke-virtual {v7, v8}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    const-wide/16 v8, 0x0

    invoke-virtual {v7, v8, v9}, Ljava/nio/ByteBuffer;->putLong(J)Ljava/nio/ByteBuffer;

    int-to-long v10, v1

    invoke-virtual {v7, v10, v11}, Ljava/nio/ByteBuffer;->putLong(J)Ljava/nio/ByteBuffer;

    invoke-virtual {v7}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object v1

    .line 1
    invoke-static {v6, v5}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v10

    shr-long/2addr v10, v5

    const-wide/32 v12, 0x3ffffff

    and-long/2addr v10, v12

    const/4 v7, 0x3

    invoke-static {v6, v7}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v14

    const/16 v16, 0x2

    shr-long v14, v14, v16

    and-long/2addr v14, v12

    const-wide/32 v17, 0x3ffff03

    and-long v14, v14, v17

    const/4 v8, 0x6

    invoke-static {v6, v8}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v17

    const/4 v9, 0x4

    shr-long v17, v17, v9

    and-long v17, v17, v12

    const-wide/32 v19, 0x3ffc0ff

    and-long v17, v17, v19

    const/16 v2, 0x9

    invoke-static {v6, v2}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v20

    shr-long v20, v20, v8

    and-long v20, v20, v12

    const-wide/32 v22, 0x3f03fff

    and-long v20, v20, v22

    const/16 v2, 0xc

    invoke-static {v6, v2}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v23

    const/16 v2, 0x8

    shr-long v23, v23, v2

    and-long v23, v23, v12

    const-wide/32 v25, 0xfffff

    and-long v23, v23, v25

    const-wide/16 v25, 0x5

    mul-long v27, v14, v25

    mul-long v29, v17, v25

    mul-long v31, v20, v25

    mul-long v33, v23, v25

    const/16 v2, 0x11

    new-array v9, v2, [B

    move v8, v5

    const-wide/16 v36, 0x0

    const-wide/16 v38, 0x0

    const-wide/16 v40, 0x0

    const-wide/16 v42, 0x0

    const-wide/16 v44, 0x0

    .line 2
    :goto_f1
    array-length v7, v1

    const/16 v46, 0x1a

    const/16 v12, 0x18

    if-ge v8, v7, :cond_1e9

    sub-int/2addr v7, v8

    invoke-static {v4, v7}, Ljava/lang/Math;->min(II)I

    move-result v7

    invoke-static {v1, v8, v9, v5, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    const/4 v13, 0x1

    aput-byte v13, v9, v7

    if-eq v7, v4, :cond_10a

    add-int/lit8 v7, v7, 0x1

    invoke-static {v9, v7, v2, v5}, Ljava/util/Arrays;->fill([BIIB)V

    .line 3
    :cond_10a
    invoke-static {v9, v5}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v49

    shr-long v49, v49, v5

    const-wide/32 v47, 0x3ffffff

    and-long v49, v49, v47

    add-long v44, v44, v49

    const/4 v7, 0x3

    invoke-static {v9, v7}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v49

    shr-long v49, v49, v16

    and-long v49, v49, v47

    add-long v36, v36, v49

    const/4 v13, 0x6

    invoke-static {v9, v13}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v49

    const/16 v35, 0x4

    shr-long v49, v49, v35

    and-long v49, v49, v47

    add-long v38, v38, v49

    const/16 v2, 0x9

    invoke-static {v9, v2}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v49

    shr-long v49, v49, v13

    and-long v49, v49, v47

    add-long v40, v40, v49

    const/16 v13, 0xc

    invoke-static {v9, v13}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v49

    const/16 v13, 0x8

    shr-long v49, v49, v13

    and-long v49, v49, v47

    .line 4
    aget-byte v13, v9, v4

    shl-int/lit8 v12, v13, 0x18

    int-to-long v12, v12

    or-long v12, v49, v12

    add-long v42, v42, v12

    mul-long v12, v44, v10

    mul-long v49, v36, v33

    add-long v49, v49, v12

    mul-long v12, v38, v31

    add-long v12, v12, v49

    mul-long v49, v40, v29

    add-long v49, v49, v12

    mul-long v12, v42, v27

    add-long v12, v12, v49

    mul-long v49, v44, v14

    mul-long v51, v36, v10

    add-long v51, v51, v49

    mul-long v49, v38, v33

    add-long v49, v49, v51

    mul-long v51, v40, v31

    add-long v51, v51, v49

    mul-long v49, v42, v29

    add-long v49, v49, v51

    shr-long v51, v12, v46

    add-long v49, v49, v51

    mul-long v51, v44, v17

    mul-long v53, v36, v14

    add-long v53, v53, v51

    mul-long v51, v38, v10

    add-long v51, v51, v53

    mul-long v53, v40, v33

    add-long v53, v53, v51

    mul-long v51, v42, v31

    add-long v51, v51, v53

    shr-long v53, v49, v46

    add-long v51, v51, v53

    const-wide/32 v47, 0x3ffffff

    and-long v53, v51, v47

    mul-long v55, v44, v20

    mul-long v57, v36, v17

    add-long v57, v57, v55

    mul-long v55, v38, v14

    add-long v55, v55, v57

    mul-long v57, v40, v10

    add-long v57, v57, v55

    mul-long v55, v42, v33

    add-long v55, v55, v57

    shr-long v51, v51, v46

    add-long v55, v55, v51

    const-wide/32 v47, 0x3ffffff

    and-long v51, v55, v47

    mul-long v44, v44, v23

    mul-long v36, v36, v20

    add-long v36, v36, v44

    mul-long v38, v38, v17

    add-long v38, v38, v36

    mul-long v40, v40, v14

    add-long v40, v40, v38

    mul-long v42, v42, v10

    add-long v42, v42, v40

    shr-long v36, v55, v46

    add-long v42, v42, v36

    const-wide/32 v47, 0x3ffffff

    and-long v36, v42, v47

    and-long v12, v12, v47

    shr-long v38, v42, v46

    mul-long v38, v38, v25

    add-long v38, v38, v12

    and-long v44, v38, v47

    and-long v12, v49, v47

    shr-long v38, v38, v46

    add-long v12, v12, v38

    add-int/lit8 v8, v8, 0x10

    move-wide/from16 v42, v36

    move-wide/from16 v40, v51

    move-wide/from16 v38, v53

    const/16 v2, 0x11

    move-wide/from16 v36, v12

    move-wide/from16 v12, v47

    goto/16 :goto_f1

    :cond_1e9
    const-wide/32 v47, 0x3ffffff

    shr-long v1, v36, v46

    add-long v38, v38, v1

    and-long v1, v38, v47

    shr-long v7, v38, v46

    add-long v40, v40, v7

    and-long v7, v40, v47

    shr-long v9, v40, v46

    add-long v42, v42, v9

    and-long v9, v42, v47

    shr-long v13, v42, v46

    mul-long v13, v13, v25

    add-long v13, v13, v44

    and-long v15, v13, v47

    and-long v17, v36, v47

    shr-long v13, v13, v46

    add-long v17, v17, v13

    add-long v25, v15, v25

    shr-long v13, v25, v46

    add-long v13, v13, v17

    shr-long v20, v13, v46

    add-long v20, v1, v20

    shr-long v22, v20, v46

    add-long v22, v7, v22

    shr-long v27, v22, v46

    add-long v27, v9, v27

    const-wide/32 v29, -0x4000000

    add-long v27, v27, v29

    const/16 v11, 0x3f

    shr-long v4, v27, v11

    move-wide/from16 v30, v9

    not-long v9, v4

    and-long v17, v17, v4

    const-wide/32 v32, 0x3ffffff

    and-long v13, v13, v32

    and-long/2addr v13, v9

    or-long v13, v13, v17

    and-long/2addr v1, v4

    and-long v17, v20, v32

    and-long v17, v17, v9

    or-long v1, v1, v17

    and-long/2addr v7, v4

    and-long v17, v22, v32

    and-long v17, v17, v9

    or-long v7, v7, v17

    and-long/2addr v15, v4

    and-long v17, v25, v32

    and-long v17, v17, v9

    or-long v15, v15, v17

    shl-long v17, v13, v46

    or-long v15, v15, v17

    const-wide v17, 0xffffffffL

    and-long v15, v15, v17

    const/16 v11, 0x10

    invoke-static {v6, v11}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v20

    add-long v20, v20, v15

    const/4 v11, 0x6

    shr-long/2addr v13, v11

    const/16 v11, 0x14

    shl-long v15, v1, v11

    or-long/2addr v13, v15

    and-long v13, v13, v17

    invoke-static {v6, v11}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v15

    add-long/2addr v15, v13

    const/16 v11, 0x20

    shr-long v13, v20, v11

    add-long/2addr v15, v13

    const/16 v13, 0xc

    shr-long/2addr v1, v13

    const/16 v13, 0xe

    shl-long v13, v7, v13

    or-long/2addr v1, v13

    and-long v1, v1, v17

    invoke-static {v6, v12}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v12

    add-long/2addr v12, v1

    shr-long v1, v15, v11

    add-long/2addr v12, v1

    const/16 v1, 0x1c

    invoke-static {v6, v1}, Landroidx/appcompat/widget/p;->f([BI)J

    move-result-wide v1

    const/16 v6, 0x10

    new-array v11, v6, [B

    move-wide/from16 p1, v1

    and-long v0, v20, v17

    const/4 v2, 0x0

    invoke-static {v11, v0, v1, v2}, Landroidx/appcompat/widget/p;->h([BJI)V

    and-long v0, v15, v17

    const/4 v2, 0x4

    invoke-static {v11, v0, v1, v2}, Landroidx/appcompat/widget/p;->h([BJI)V

    and-long v0, v12, v17

    const/16 v2, 0x8

    invoke-static {v11, v0, v1, v2}, Landroidx/appcompat/widget/p;->h([BJI)V

    const/16 v0, 0x12

    shr-long v0, v7, v0

    and-long v4, v30, v4

    and-long v6, v27, v9

    or-long/2addr v4, v6

    shl-long/2addr v4, v2

    or-long/2addr v0, v4

    and-long v0, v0, v17

    move-wide/from16 v4, p1

    add-long/2addr v0, v4

    const/16 v2, 0x20

    shr-long v4, v12, v2

    add-long/2addr v0, v4

    and-long v0, v0, v17

    const/16 v2, 0xc

    invoke-static {v11, v0, v1, v2}, Landroidx/appcompat/widget/p;->h([BJI)V

    .line 5
    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->limit()I

    move-result v0

    const/16 v1, 0x10

    add-int/2addr v0, v1

    invoke-virtual {v3, v0}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    invoke-virtual {v3, v11}, Ljava/nio/ByteBuffer;->put([B)Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object v0

    return-object v0

    :cond_2ce
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Given ByteBuffer output is too small"

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

    throw v0

    :cond_2d6
    new-instance v0, Ljava/security/GeneralSecurityException;

    const-string v1, "plaintext too long"

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

    throw v0
.end method

.method public abstract b([BI)Lcom/google/android/gms/internal/ads/r8;
.end method
