SecT113Field.smali

.class public Lorg/spongycastle/math/ec/custom/sec/SecT113Field;
.super Ljava/lang/Object;
.source "SecT113Field.java"


# static fields
.field private static final M49:J = 0x1ffffffffffffL

.field private static final M57:J = 0x1ffffffffffffffL


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

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

    return-void
.end method

.method public static add([J[J[J)V
    .registers 9

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 15
    aget-wide v0, p0, v4

    aget-wide v2, p1, v4

    xor-long/2addr v0, v2

    aput-wide v0, p2, v4

    .line 16
    aget-wide v0, p0, v5

    aget-wide v2, p1, v5

    xor-long/2addr v0, v2

    aput-wide v0, p2, v5

    .line 17
    return-void
.end method

.method public static addExt([J[J[J)V
    .registers 11

    .prologue
    const/4 v7, 0x3

    const/4 v6, 0x2

    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 21
    aget-wide v0, p0, v4

    aget-wide v2, p1, v4

    xor-long/2addr v0, v2

    aput-wide v0, p2, v4

    .line 22
    aget-wide v0, p0, v5

    aget-wide v2, p1, v5

    xor-long/2addr v0, v2

    aput-wide v0, p2, v5

    .line 23
    aget-wide v0, p0, v6

    aget-wide v2, p1, v6

    xor-long/2addr v0, v2

    aput-wide v0, p2, v6

    .line 24
    aget-wide v0, p0, v7

    aget-wide v2, p1, v7

    xor-long/2addr v0, v2

    aput-wide v0, p2, v7

    .line 25
    return-void
.end method

.method public static addOne([J[J)V
    .registers 8

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 29
    aget-wide v0, p0, v4

    const-wide/16 v2, 0x1

    xor-long/2addr v0, v2

    aput-wide v0, p1, v4

    .line 30
    aget-wide v0, p0, v5

    aput-wide v0, p1, v5

    .line 31
    return-void
.end method

.method public static fromBigInteger(Ljava/math/BigInteger;)[J
    .registers 3

    .prologue
    .line 35
    invoke-static {p0}, Lorg/spongycastle/math/raw/Nat128;->fromBigInteger64(Ljava/math/BigInteger;)[J

    move-result-object v0

    .line 36
    const/4 v1, 0x0

    invoke-static {v0, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->reduce15([JI)V

    .line 37
    return-object v0
.end method

.method protected static implMultiply([J[J[J)V
    .registers 15

    .prologue
    .line 158
    const/4 v0, 0x0

    aget-wide v0, p0, v0

    const/4 v2, 0x1

    aget-wide v2, p0, v2

    .line 159
    const/16 v4, 0x39

    ushr-long v4, v0, v4

    const/4 v6, 0x7

    shl-long/2addr v2, v6

    xor-long/2addr v2, v4

    const-wide v4, 0x1ffffffffffffffL    # 4.77830972673648E-299

    and-long v6, v2, v4

    .line 160
    const-wide v2, 0x1ffffffffffffffL    # 4.77830972673648E-299

    and-long/2addr v0, v2

    .line 162
    const/4 v2, 0x0

    aget-wide v2, p1, v2

    const/4 v4, 0x1

    aget-wide v4, p1, v4

    .line 163
    const/16 v8, 0x39

    ushr-long v8, v2, v8

    const/4 v10, 0x7

    shl-long/2addr v4, v10

    xor-long/2addr v4, v8

    const-wide v8, 0x1ffffffffffffffL    # 4.77830972673648E-299

    and-long/2addr v8, v4

    .line 164
    const-wide v4, 0x1ffffffffffffffL    # 4.77830972673648E-299

    and-long/2addr v2, v4

    .line 166
    const/4 v4, 0x6

    new-array v4, v4, [J

    .line 168
    const/4 v5, 0x0

    invoke-static/range {v0 .. v5}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implMulw(JJ[JI)V

    .line 169
    const/4 v11, 0x2

    move-object v10, v4

    invoke-static/range {v6 .. v11}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implMulw(JJ[JI)V

    .line 170
    xor-long/2addr v0, v6

    xor-long/2addr v2, v8

    const/4 v5, 0x4

    invoke-static/range {v0 .. v5}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implMulw(JJ[JI)V

    .line 172
    const/4 v0, 0x1

    aget-wide v0, v4, v0

    const/4 v2, 0x2

    aget-wide v2, v4, v2

    xor-long/2addr v0, v2

    .line 173
    const/4 v2, 0x0

    aget-wide v2, v4, v2

    .line 174
    const/4 v5, 0x3

    aget-wide v6, v4, v5

    .line 175
    const/4 v5, 0x4

    aget-wide v8, v4, v5

    xor-long/2addr v8, v2

    xor-long/2addr v8, v0

    .line 176
    const/4 v5, 0x5

    aget-wide v4, v4, v5

    xor-long/2addr v4, v6

    xor-long/2addr v0, v4

    .line 178
    const/4 v4, 0x0

    const/16 v5, 0x39

    shl-long v10, v8, v5

    xor-long/2addr v2, v10

    aput-wide v2, p2, v4

    .line 179
    const/4 v2, 0x1

    const/4 v3, 0x7

    ushr-long v4, v8, v3

    const/16 v3, 0x32

    shl-long v8, v0, v3

    xor-long/2addr v4, v8

    aput-wide v4, p2, v2

    .line 180
    const/4 v2, 0x2

    const/16 v3, 0xe

    ushr-long/2addr v0, v3

    const/16 v3, 0x2b

    shl-long v4, v6, v3

    xor-long/2addr v0, v4

    aput-wide v0, p2, v2

    .line 181
    const/4 v0, 0x3

    const/16 v1, 0x15

    ushr-long v2, v6, v1

    aput-wide v2, p2, v0

    .line 182
    return-void
.end method

.method protected static implMulw(JJ[JI)V
    .registers 18

    .prologue
    .line 189
    const/16 v0, 0x8

    new-array v1, v0, [J

    .line 191
    const/4 v0, 0x1

    aput-wide p2, v1, v0

    .line 192
    const/4 v0, 0x2

    const/4 v2, 0x1

    aget-wide v2, v1, v2

    const/4 v4, 0x1

    shl-long/2addr v2, v4

    aput-wide v2, v1, v0

    .line 193
    const/4 v0, 0x3

    const/4 v2, 0x2

    aget-wide v2, v1, v2

    xor-long/2addr v2, p2

    aput-wide v2, v1, v0

    .line 194
    const/4 v0, 0x4

    const/4 v2, 0x2

    aget-wide v2, v1, v2

    const/4 v4, 0x1

    shl-long/2addr v2, v4

    aput-wide v2, v1, v0

    .line 195
    const/4 v0, 0x5

    const/4 v2, 0x4

    aget-wide v2, v1, v2

    xor-long/2addr v2, p2

    aput-wide v2, v1, v0

    .line 196
    const/4 v0, 0x6

    const/4 v2, 0x3

    aget-wide v2, v1, v2

    const/4 v4, 0x1

    shl-long/2addr v2, v4

    aput-wide v2, v1, v0

    .line 197
    const/4 v0, 0x7

    const/4 v2, 0x6

    aget-wide v2, v1, v2

    xor-long/2addr v2, p2

    aput-wide v2, v1, v0

    .line 199
    long-to-int v0, p0

    .line 200
    const-wide/16 v4, 0x0

    and-int/lit8 v0, v0, 0x7

    aget-wide v2, v1, v0

    .line 201
    const/16 v0, 0x30

    .line 204
    :cond_3d
    ushr-long v6, p0, v0

    long-to-int v6, v6

    .line 205
    and-int/lit8 v7, v6, 0x7

    aget-wide v8, v1, v7

    ushr-int/lit8 v7, v6, 0x3

    and-int/lit8 v7, v7, 0x7

    aget-wide v10, v1, v7

    const/4 v7, 0x3

    shl-long/2addr v10, v7

    xor-long/2addr v8, v10

    ushr-int/lit8 v6, v6, 0x6

    and-int/lit8 v6, v6, 0x7

    aget-wide v6, v1, v6

    const/4 v10, 0x6

    shl-long/2addr v6, v10

    xor-long/2addr v6, v8

    .line 208
    shl-long v8, v6, v0

    xor-long/2addr v2, v8

    .line 209
    neg-int v8, v0

    ushr-long/2addr v6, v8

    xor-long/2addr v4, v6

    .line 211
    add-int/lit8 v0, v0, -0x9

    if-gtz v0, :cond_3d

    .line 213
    const-wide v0, 0x100804020100800L

    and-long/2addr v0, p0

    const/4 v6, 0x7

    shl-long v6, p2, v6

    const/16 v8, 0x3f

    shr-long/2addr v6, v8

    and-long/2addr v0, v6

    const/16 v6, 0x8

    ushr-long/2addr v0, v6

    xor-long/2addr v0, v4

    .line 217
    const-wide v4, 0x1ffffffffffffffL    # 4.77830972673648E-299

    and-long/2addr v4, v2

    aput-wide v4, p4, p5

    .line 218
    add-int/lit8 v4, p5, 0x1

    const/16 v5, 0x39

    ushr-long/2addr v2, v5

    const/4 v5, 0x7

    shl-long/2addr v0, v5

    xor-long/2addr v0, v2

    aput-wide v0, p4, v4

    .line 219
    return-void
.end method

.method protected static implSquare([J[J)V
    .registers 5

    .prologue
    const/4 v2, 0x0

    .line 223
    aget-wide v0, p0, v2

    invoke-static {v0, v1, p1, v2}, Lorg/spongycastle/math/raw/Interleave;->expand64To128(J[JI)V

    .line 224
    const/4 v0, 0x1

    aget-wide v0, p0, v0

    const/4 v2, 0x2

    invoke-static {v0, v1, p1, v2}, Lorg/spongycastle/math/raw/Interleave;->expand64To128(J[JI)V

    .line 225
    return-void
.end method

.method public static invert([J[J)V
    .registers 5

    .prologue
    .line 42
    invoke-static {p0}, Lorg/spongycastle/math/raw/Nat128;->isZero64([J)Z

    move-result v0

    if-eqz v0, :cond_c

    .line 44
    new-instance v0, Ljava/lang/IllegalStateException;

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

    throw v0

    .line 49
    :cond_c
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->create64()[J

    move-result-object v0

    .line 50
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->create64()[J

    move-result-object v1

    .line 52
    invoke-static {p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->square([J[J)V

    .line 53
    invoke-static {v0, p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 54
    invoke-static {v0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->square([J[J)V

    .line 55
    invoke-static {v0, p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 56
    const/4 v2, 0x3

    invoke-static {v0, v2, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->squareN([JI[J)V

    .line 57
    invoke-static {v1, v0, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 58
    invoke-static {v1, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->square([J[J)V

    .line 59
    invoke-static {v1, p0, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 60
    const/4 v2, 0x7

    invoke-static {v1, v2, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->squareN([JI[J)V

    .line 61
    invoke-static {v0, v1, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 62
    const/16 v2, 0xe

    invoke-static {v0, v2, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->squareN([JI[J)V

    .line 63
    invoke-static {v1, v0, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 64
    const/16 v2, 0x1c

    invoke-static {v1, v2, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->squareN([JI[J)V

    .line 65
    invoke-static {v0, v1, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 66
    const/16 v2, 0x38

    invoke-static {v0, v2, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->squareN([JI[J)V

    .line 67
    invoke-static {v1, v0, v1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->multiply([J[J[J)V

    .line 68
    invoke-static {v1, p1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->square([J[J)V

    .line 69
    return-void
.end method

.method public static multiply([J[J[J)V
    .registers 4

    .prologue
    .line 73
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->createExt64()[J

    move-result-object v0

    .line 74
    invoke-static {p0, p1, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implMultiply([J[J[J)V

    .line 75
    invoke-static {v0, p2}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->reduce([J[J)V

    .line 76
    return-void
.end method

.method public static multiplyAddToExt([J[J[J)V
    .registers 4

    .prologue
    .line 80
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->createExt64()[J

    move-result-object v0

    .line 81
    invoke-static {p0, p1, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implMultiply([J[J[J)V

    .line 82
    invoke-static {p2, v0, p2}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->addExt([J[J[J)V

    .line 83
    return-void
.end method

.method public static reduce([J[J)V
    .registers 14

    .prologue
    .line 87
    const/4 v0, 0x0

    aget-wide v0, p0, v0

    const/4 v2, 0x1

    aget-wide v2, p0, v2

    const/4 v4, 0x2

    aget-wide v4, p0, v4

    const/4 v6, 0x3

    aget-wide v6, p0, v6

    .line 89
    const/16 v8, 0xf

    shl-long v8, v6, v8

    const/16 v10, 0x18

    shl-long v10, v6, v10

    xor-long/2addr v8, v10

    xor-long/2addr v2, v8

    .line 90
    const/16 v8, 0x31

    ushr-long v8, v6, v8

    const/16 v10, 0x28

    ushr-long/2addr v6, v10

    xor-long/2addr v6, v8

    xor-long/2addr v4, v6

    .line 92
    const/16 v6, 0xf

    shl-long v6, v4, v6

    const/16 v8, 0x18

    shl-long v8, v4, v8

    xor-long/2addr v6, v8

    xor-long/2addr v0, v6

    .line 93
    const/16 v6, 0x31

    ushr-long v6, v4, v6

    const/16 v8, 0x28

    ushr-long/2addr v4, v8

    xor-long/2addr v4, v6

    xor-long/2addr v2, v4

    .line 95
    const/16 v4, 0x31

    ushr-long v4, v2, v4

    .line 96
    const/4 v6, 0x0

    xor-long/2addr v0, v4

    const/16 v7, 0x9

    shl-long/2addr v4, v7

    xor-long/2addr v0, v4

    aput-wide v0, p1, v6

    .line 97
    const/4 v0, 0x1

    const-wide v4, 0x1ffffffffffffL

    and-long/2addr v2, v4

    aput-wide v2, p1, v0

    .line 98
    return-void
.end method

.method public static reduce15([JI)V
    .registers 10

    .prologue
    .line 102
    add-int/lit8 v0, p1, 0x1

    aget-wide v0, p0, v0

    const/16 v2, 0x31

    ushr-long v2, v0, v2

    .line 103
    aget-wide v4, p0, p1

    const/16 v6, 0x9

    shl-long v6, v2, v6

    xor-long/2addr v2, v6

    xor-long/2addr v2, v4

    aput-wide v2, p0, p1

    .line 104
    add-int/lit8 v2, p1, 0x1

    const-wide v4, 0x1ffffffffffffL

    and-long/2addr v0, v4

    aput-wide v0, p0, v2

    .line 105
    return-void
.end method

.method public static sqrt([J[J)V
    .registers 13

    .prologue
    const/16 v10, 0x20

    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 109
    aget-wide v0, p0, v8

    invoke-static {v0, v1}, Lorg/spongycastle/math/raw/Interleave;->unshuffle(J)J

    move-result-wide v0

    aget-wide v2, p0, v9

    invoke-static {v2, v3}, Lorg/spongycastle/math/raw/Interleave;->unshuffle(J)J

    move-result-wide v2

    .line 110
    const-wide v4, 0xffffffffL

    and-long/2addr v4, v0

    shl-long v6, v2, v10

    or-long/2addr v4, v6

    .line 111
    ushr-long/2addr v0, v10

    const-wide v6, -0x100000000L

    and-long/2addr v2, v6

    or-long/2addr v0, v2

    .line 113
    const/16 v2, 0x39

    shl-long v2, v0, v2

    xor-long/2addr v2, v4

    const/4 v4, 0x5

    shl-long v4, v0, v4

    xor-long/2addr v2, v4

    aput-wide v2, p1, v8

    .line 114
    const/4 v2, 0x7

    ushr-long v2, v0, v2

    const/16 v4, 0x3b

    ushr-long/2addr v0, v4

    xor-long/2addr v0, v2

    aput-wide v0, p1, v9

    .line 115
    return-void
.end method

.method public static square([J[J)V
    .registers 3

    .prologue
    .line 119
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->createExt64()[J

    move-result-object v0

    .line 120
    invoke-static {p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implSquare([J[J)V

    .line 121
    invoke-static {v0, p1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->reduce([J[J)V

    .line 122
    return-void
.end method

.method public static squareAddToExt([J[J)V
    .registers 3

    .prologue
    .line 126
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->createExt64()[J

    move-result-object v0

    .line 127
    invoke-static {p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implSquare([J[J)V

    .line 128
    invoke-static {p1, v0, p1}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->addExt([J[J[J)V

    .line 129
    return-void
.end method

.method public static squareN([JI[J)V
    .registers 4

    .prologue
    .line 135
    invoke-static {}, Lorg/spongycastle/math/raw/Nat128;->createExt64()[J

    move-result-object v0

    .line 136
    invoke-static {p0, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implSquare([J[J)V

    .line 137
    invoke-static {v0, p2}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->reduce([J[J)V

    .line 139
    :goto_a
    add-int/lit8 p1, p1, -0x1

    if-lez p1, :cond_15

    .line 141
    invoke-static {p2, v0}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->implSquare([J[J)V

    .line 142
    invoke-static {v0, p2}, Lorg/spongycastle/math/ec/custom/sec/SecT113Field;->reduce([J[J)V

    goto :goto_a

    .line 144
    :cond_15
    return-void
.end method

.method public static trace([J)I
    .registers 3

    .prologue
    .line 149
    const/4 v0, 0x0

    aget-wide v0, p0, v0

    long-to-int v0, v0

    and-int/lit8 v0, v0, 0x1

    return v0
.end method