RainbowUtil.smali

.class public Lorg/spongycastle/pqc/crypto/rainbow/util/RainbowUtil;
.super Ljava/lang/Object;
.source "RainbowUtil.java"


# direct methods
.method public constructor <init>()V
    .registers 1

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

    return-void
.end method

.method public static convertArray([S)[B
    .registers 4

    .prologue
    .line 116
    array-length v0, p0

    new-array v1, v0, [B

    .line 117
    const/4 v0, 0x0

    :goto_4
    array-length v2, p0

    if-ge v0, v2, :cond_f

    .line 119
    aget-short v2, p0, v0

    int-to-byte v2, v2

    aput-byte v2, v1, v0

    .line 117
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    .line 121
    :cond_f
    return-object v1
.end method

.method public static convertArray([B)[S
    .registers 4

    .prologue
    .line 38
    array-length v0, p0

    new-array v1, v0, [S

    .line 39
    const/4 v0, 0x0

    :goto_4
    array-length v2, p0

    if-ge v0, v2, :cond_11

    .line 41
    aget-byte v2, p0, v0

    and-int/lit16 v2, v2, 0xff

    int-to-short v2, v2

    aput-short v2, v1, v0

    .line 39
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    .line 43
    :cond_11
    return-object v1
.end method

.method public static convertArray([[S)[[B
    .registers 7

    .prologue
    const/4 v2, 0x0

    .line 133
    array-length v0, p0

    aget-object v1, p0, v2

    array-length v1, v1

    filled-new-array {v0, v1}, [I

    move-result-object v0

    sget-object v1, Ljava/lang/Byte;->TYPE:Ljava/lang/Class;

    invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [[B

    move v1, v2

    .line 134
    :goto_12
    array-length v3, p0

    if-ge v1, v3, :cond_2a

    move v3, v2

    .line 136
    :goto_16
    aget-object v4, p0, v2

    array-length v4, v4

    if-ge v3, v4, :cond_27

    .line 138
    aget-object v4, v0, v1

    aget-object v5, p0, v1

    aget-short v5, v5, v3

    int-to-byte v5, v5

    aput-byte v5, v4, v3

    .line 136
    add-int/lit8 v3, v3, 0x1

    goto :goto_16

    .line 134
    :cond_27
    add-int/lit8 v1, v1, 0x1

    goto :goto_12

    .line 141
    :cond_2a
    return-object v0
.end method

.method public static convertArray([[B)[[S
    .registers 7

    .prologue
    const/4 v2, 0x0

    .line 55
    array-length v0, p0

    aget-object v1, p0, v2

    array-length v1, v1

    filled-new-array {v0, v1}, [I

    move-result-object v0

    sget-object v1, Ljava/lang/Short;->TYPE:Ljava/lang/Class;

    invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [[S

    move v1, v2

    .line 56
    :goto_12
    array-length v3, p0

    if-ge v1, v3, :cond_2c

    move v3, v2

    .line 58
    :goto_16
    aget-object v4, p0, v2

    array-length v4, v4

    if-ge v3, v4, :cond_29

    .line 60
    aget-object v4, v0, v1

    aget-object v5, p0, v1

    aget-byte v5, v5, v3

    and-int/lit16 v5, v5, 0xff

    int-to-short v5, v5

    aput-short v5, v4, v3

    .line 58
    add-int/lit8 v3, v3, 0x1

    goto :goto_16

    .line 56
    :cond_29
    add-int/lit8 v1, v1, 0x1

    goto :goto_12

    .line 63
    :cond_2c
    return-object v0
.end method

.method public static convertArray([[[S)[[[B
    .registers 8

    .prologue
    const/4 v2, 0x0

    .line 153
    array-length v0, p0

    aget-object v1, p0, v2

    array-length v1, v1

    aget-object v3, p0, v2

    aget-object v3, v3, v2

    array-length v3, v3

    filled-new-array {v0, v1, v3}, [I

    move-result-object v0

    sget-object v1, Ljava/lang/Byte;->TYPE:Ljava/lang/Class;

    invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [[[B

    move v1, v2

    .line 154
    :goto_17
    array-length v3, p0

    if-ge v1, v3, :cond_3e

    move v3, v2

    .line 156
    :goto_1b
    aget-object v4, p0, v2

    array-length v4, v4

    if-ge v3, v4, :cond_3b

    move v4, v2

    .line 158
    :goto_21
    aget-object v5, p0, v2

    aget-object v5, v5, v2

    array-length v5, v5

    if-ge v4, v5, :cond_38

    .line 160
    aget-object v5, v0, v1

    aget-object v5, v5, v3

    aget-object v6, p0, v1

    aget-object v6, v6, v3

    aget-short v6, v6, v4

    int-to-byte v6, v6

    aput-byte v6, v5, v4

    .line 158
    add-int/lit8 v4, v4, 0x1

    goto :goto_21

    .line 156
    :cond_38
    add-int/lit8 v3, v3, 0x1

    goto :goto_1b

    .line 154
    :cond_3b
    add-int/lit8 v1, v1, 0x1

    goto :goto_17

    .line 164
    :cond_3e
    return-object v0
.end method

.method public static convertArray([[[B)[[[S
    .registers 8

    .prologue
    const/4 v2, 0x0

    .line 75
    array-length v0, p0

    aget-object v1, p0, v2

    array-length v1, v1

    aget-object v3, p0, v2

    aget-object v3, v3, v2

    array-length v3, v3

    filled-new-array {v0, v1, v3}, [I

    move-result-object v0

    sget-object v1, Ljava/lang/Short;->TYPE:Ljava/lang/Class;

    invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [[[S

    move v1, v2

    .line 76
    :goto_17
    array-length v3, p0

    if-ge v1, v3, :cond_40

    move v3, v2

    .line 78
    :goto_1b
    aget-object v4, p0, v2

    array-length v4, v4

    if-ge v3, v4, :cond_3d

    move v4, v2

    .line 80
    :goto_21
    aget-object v5, p0, v2

    aget-object v5, v5, v2

    array-length v5, v5

    if-ge v4, v5, :cond_3a

    .line 82
    aget-object v5, v0, v1

    aget-object v5, v5, v3

    aget-object v6, p0, v1

    aget-object v6, v6, v3

    aget-byte v6, v6, v4

    and-int/lit16 v6, v6, 0xff

    int-to-short v6, v6

    aput-short v6, v5, v4

    .line 80
    add-int/lit8 v4, v4, 0x1

    goto :goto_21

    .line 78
    :cond_3a
    add-int/lit8 v3, v3, 0x1

    goto :goto_1b

    .line 76
    :cond_3d
    add-int/lit8 v1, v1, 0x1

    goto :goto_17

    .line 86
    :cond_40
    return-object v0
.end method

.method public static convertArraytoInt([B)[I
    .registers 4

    .prologue
    .line 20
    array-length v0, p0

    new-array v1, v0, [I

    .line 21
    const/4 v0, 0x0

    :goto_4
    array-length v2, p0

    if-ge v0, v2, :cond_10

    .line 23
    aget-byte v2, p0, v0

    and-int/lit16 v2, v2, 0xff

    aput v2, v1, v0

    .line 21
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    .line 25
    :cond_10
    return-object v1
.end method

.method public static convertIntArray([I)[B
    .registers 4

    .prologue
    .line 98
    array-length v0, p0

    new-array v1, v0, [B

    .line 99
    const/4 v0, 0x0

    :goto_4
    array-length v2, p0

    if-ge v0, v2, :cond_f

    .line 101
    aget v2, p0, v0

    int-to-byte v2, v2

    aput-byte v2, v1, v0

    .line 99
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    .line 103
    :cond_f
    return-object v1
.end method

.method public static equals([S[S)Z
    .registers 8

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 176
    array-length v0, p0

    array-length v3, p1

    if-eq v0, v3, :cond_7

    .line 185
    :goto_6
    return v2

    .line 181
    :cond_7
    array-length v0, p0

    add-int/lit8 v0, v0, -0x1

    move v4, v0

    move v3, v1

    :goto_c
    if-ltz v4, :cond_1c

    .line 183
    aget-short v0, p0, v4

    aget-short v5, p1, v4

    if-ne v0, v5, :cond_1a

    move v0, v1

    :goto_15
    and-int/2addr v3, v0

    .line 181
    add-int/lit8 v0, v4, -0x1

    move v4, v0

    goto :goto_c

    :cond_1a
    move v0, v2

    .line 183
    goto :goto_15

    :cond_1c
    move v2, v3

    .line 185
    goto :goto_6
.end method

.method public static equals([[S[[S)Z
    .registers 7

    .prologue
    .line 197
    array-length v0, p0

    array-length v1, p1

    if-eq v0, v1, :cond_6

    .line 199
    const/4 v0, 0x0

    .line 206
    :cond_5
    return v0

    .line 201
    :cond_6
    const/4 v1, 0x1

    .line 202
    array-length v0, p0

    add-int/lit8 v0, v0, -0x1

    move v4, v0

    move v0, v1

    move v1, v4

    :goto_d
    if-ltz v1, :cond_5

    .line 204
    aget-object v2, p0, v1

    aget-object v3, p1, v1

    invoke-static {v2, v3}, Lorg/spongycastle/pqc/crypto/rainbow/util/RainbowUtil;->equals([S[S)Z

    move-result v2

    and-int/2addr v2, v0

    .line 202
    add-int/lit8 v0, v1, -0x1

    move v1, v0

    move v0, v2

    goto :goto_d
.end method

.method public static equals([[[S[[[S)Z
    .registers 7

    .prologue
    .line 218
    array-length v0, p0

    array-length v1, p1

    if-eq v0, v1, :cond_6

    .line 220
    const/4 v0, 0x0

    .line 227
    :cond_5
    return v0

    .line 222
    :cond_6
    const/4 v1, 0x1

    .line 223
    array-length v0, p0

    add-int/lit8 v0, v0, -0x1

    move v4, v0

    move v0, v1

    move v1, v4

    :goto_d
    if-ltz v1, :cond_5

    .line 225
    aget-object v2, p0, v1

    aget-object v3, p1, v1

    invoke-static {v2, v3}, Lorg/spongycastle/pqc/crypto/rainbow/util/RainbowUtil;->equals([[S[[S)Z

    move-result v2

    and-int/2addr v2, v0

    .line 223
    add-int/lit8 v0, v1, -0x1

    move v1, v0

    move v0, v2

    goto :goto_d
.end method