zzehe.smali
.class public final Lcom/google/android/gms/internal/ads/zzehe;
.super Ljava/lang/Object;
.source "SourceFile"
# direct methods
.method public static zza(Ljava/security/spec/EllipticCurve;)Ljava/math/BigInteger;
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/GeneralSecurityException;
}
.end annotation
.line 15
invoke-virtual {p0}, Ljava/security/spec/EllipticCurve;->getField()Ljava/security/spec/ECField;
move-result-object p0
.line 16
instance-of v0, p0, Ljava/security/spec/ECFieldFp;
if-eqz v0, :cond_f
.line 17
check-cast p0, Ljava/security/spec/ECFieldFp;
invoke-virtual {p0}, Ljava/security/spec/ECFieldFp;->getP()Ljava/math/BigInteger;
move-result-object p0
return-object p0
.line 18
:cond_f
new-instance p0, Ljava/security/GeneralSecurityException;
const-string v0, "Only curves over prime order fields are supported"
invoke-direct {p0, v0}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static zza(Ljava/security/spec/ECParameterSpec;)Ljava/security/KeyPair;
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/GeneralSecurityException;
}
.end annotation
.line 47
sget-object v0, Lcom/google/android/gms/internal/ads/zzehh;->zzihi:Lcom/google/android/gms/internal/ads/zzehh;
const-string v1, "EC"
invoke-virtual {v0, v1}, Lcom/google/android/gms/internal/ads/zzehh;->zzhq(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/security/KeyPairGenerator;
.line 48
invoke-virtual {v0, p0}, Ljava/security/KeyPairGenerator;->initialize(Ljava/security/spec/AlgorithmParameterSpec;)V
.line 49
invoke-virtual {v0}, Ljava/security/KeyPairGenerator;->generateKeyPair()Ljava/security/KeyPair;
move-result-object p0
return-object p0
.end method
.method public static zza(Lcom/google/android/gms/internal/ads/zzehg;[B[B)Ljava/security/interfaces/ECPublicKey;
.registers 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/GeneralSecurityException;
}
.end annotation
.line 39
invoke-static {p0}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Lcom/google/android/gms/internal/ads/zzehg;)Ljava/security/spec/ECParameterSpec;
move-result-object p0
.line 40
new-instance v0, Ljava/math/BigInteger;
const/4 v1, 0x1
invoke-direct {v0, v1, p1}, Ljava/math/BigInteger;-><init>(I[B)V
.line 41
new-instance p1, Ljava/math/BigInteger;
invoke-direct {p1, v1, p2}, Ljava/math/BigInteger;-><init>(I[B)V
.line 42
new-instance p2, Ljava/security/spec/ECPoint;
invoke-direct {p2, v0, p1}, Ljava/security/spec/ECPoint;-><init>(Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 43
invoke-virtual {p0}, Ljava/security/spec/ECParameterSpec;->getCurve()Ljava/security/spec/EllipticCurve;
move-result-object p1
invoke-static {p2, p1}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/security/spec/ECPoint;Ljava/security/spec/EllipticCurve;)V
.line 44
new-instance p1, Ljava/security/spec/ECPublicKeySpec;
invoke-direct {p1, p2, p0}, Ljava/security/spec/ECPublicKeySpec;-><init>(Ljava/security/spec/ECPoint;Ljava/security/spec/ECParameterSpec;)V
.line 45
sget-object p0, Lcom/google/android/gms/internal/ads/zzehh;->zzihj:Lcom/google/android/gms/internal/ads/zzehh;
const-string p2, "EC"
invoke-virtual {p0, p2}, Lcom/google/android/gms/internal/ads/zzehh;->zzhq(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Ljava/security/KeyFactory;
.line 46
invoke-virtual {p0, p1}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
move-result-object p0
check-cast p0, Ljava/security/interfaces/ECPublicKey;
return-object p0
.end method
.method public static zza(Lcom/google/android/gms/internal/ads/zzehg;)Ljava/security/spec/ECParameterSpec;
.registers 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/NoSuchAlgorithmException;
}
.end annotation
.line 31
sget-object v0, Lcom/google/android/gms/internal/ads/zzehd;->zzigt:[I
invoke-virtual {p0}, Lcom/google/android/gms/internal/ads/zzehg;->ordinal()I
move-result v1
aget v0, v0, v1
const/4 v1, 0x1
if-eq v0, v1, :cond_54
const/4 v1, 0x2
if-eq v0, v1, :cond_45
const/4 v1, 0x3
if-ne v0, v1, :cond_20
const-string p0, "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151"
const-string v0, "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449"
const-string v1, "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"
const-string v2, "c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"
const-string v3, "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"
.line 36
invoke-static {p0, v0, v1, v2, v3}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/spec/ECParameterSpec;
move-result-object p0
return-object p0
.line 38
:cond_20
new-instance v0, Ljava/security/NoSuchAlgorithmException;
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/String;->length()I
move-result v1
add-int/lit8 v1, v1, 0x16
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2, v1}, Ljava/lang/StringBuilder;-><init>(I)V
const-string v1, "curve not implemented:"
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/security/NoSuchAlgorithmException;-><init>(Ljava/lang/String;)V
throw v0
:cond_45
const-string p0, "39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319"
const-string v0, "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643"
const-string v1, "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"
const-string v2, "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"
const-string v3, "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"
.line 34
invoke-static {p0, v0, v1, v2, v3}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/spec/ECParameterSpec;
move-result-object p0
return-object p0
:cond_54
const-string p0, "115792089210356248762697446949407573530086143415290314195533631308867097853951"
const-string v0, "115792089210356248762697446949407573529996955224135760342422259061068512044369"
const-string v1, "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"
const-string v2, "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"
const-string v3, "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
.line 32
invoke-static {p0, v0, v1, v2, v3}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/spec/ECParameterSpec;
move-result-object p0
return-object p0
.end method
.method private static zza(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/spec/ECParameterSpec;
.registers 8
.line 19
new-instance v0, Ljava/math/BigInteger;
invoke-direct {v0, p0}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;)V
.line 20
new-instance p0, Ljava/math/BigInteger;
invoke-direct {p0, p1}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;)V
.line 21
new-instance p1, Ljava/math/BigInteger;
const-string v1, "3"
invoke-direct {p1, v1}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;)V
.line 22
invoke-virtual {v0, p1}, Ljava/math/BigInteger;->subtract(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p1
.line 23
new-instance v1, Ljava/math/BigInteger;
const/16 v2, 0x10
invoke-direct {v1, p2, v2}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
.line 24
new-instance p2, Ljava/math/BigInteger;
invoke-direct {p2, p3, v2}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
.line 25
new-instance p3, Ljava/math/BigInteger;
invoke-direct {p3, p4, v2}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
.line 26
new-instance p4, Ljava/security/spec/ECFieldFp;
invoke-direct {p4, v0}, Ljava/security/spec/ECFieldFp;-><init>(Ljava/math/BigInteger;)V
.line 27
new-instance v0, Ljava/security/spec/EllipticCurve;
invoke-direct {v0, p4, p1, v1}, Ljava/security/spec/EllipticCurve;-><init>(Ljava/security/spec/ECField;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 28
new-instance p1, Ljava/security/spec/ECPoint;
invoke-direct {p1, p2, p3}, Ljava/security/spec/ECPoint;-><init>(Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 29
new-instance p2, Ljava/security/spec/ECParameterSpec;
const/4 p3, 0x1
invoke-direct {p2, v0, p1, p0, p3}, Ljava/security/spec/ECParameterSpec;-><init>(Ljava/security/spec/EllipticCurve;Ljava/security/spec/ECPoint;Ljava/math/BigInteger;I)V
return-object p2
.end method
.method static zza(Ljava/security/spec/ECPoint;Ljava/security/spec/EllipticCurve;)V
.registers 6
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/GeneralSecurityException;
}
.end annotation
.line 1
invoke-static {p1}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/security/spec/EllipticCurve;)Ljava/math/BigInteger;
move-result-object v0
.line 2
invoke-virtual {p0}, Ljava/security/spec/ECPoint;->getAffineX()Ljava/math/BigInteger;
move-result-object v1
.line 3
invoke-virtual {p0}, Ljava/security/spec/ECPoint;->getAffineY()Ljava/math/BigInteger;
move-result-object p0
if-eqz v1, :cond_6c
if-eqz p0, :cond_6c
.line 6
invoke-virtual {v1}, Ljava/math/BigInteger;->signum()I
move-result v2
const/4 v3, -0x1
if-eq v2, v3, :cond_64
invoke-virtual {v1, v0}, Ljava/math/BigInteger;->compareTo(Ljava/math/BigInteger;)I
move-result v2
if-gez v2, :cond_64
.line 8
invoke-virtual {p0}, Ljava/math/BigInteger;->signum()I
move-result v2
if-eq v2, v3, :cond_5c
invoke-virtual {p0, v0}, Ljava/math/BigInteger;->compareTo(Ljava/math/BigInteger;)I
move-result v2
if-gez v2, :cond_5c
.line 10
invoke-virtual {p0, p0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
invoke-virtual {p0, v0}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
.line 11
invoke-virtual {v1, v1}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v2
invoke-virtual {p1}, Ljava/security/spec/EllipticCurve;->getA()Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v1
invoke-virtual {p1}, Ljava/security/spec/EllipticCurve;->getB()Ljava/math/BigInteger;
move-result-object p1
invoke-virtual {v1, p1}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p1
invoke-virtual {p1, v0}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p1
.line 12
invoke-virtual {p0, p1}, Ljava/math/BigInteger;->equals(Ljava/lang/Object;)Z
move-result p0
if-eqz p0, :cond_54
return-void
.line 13
:cond_54
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "Point is not on curve"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
.line 9
:cond_5c
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "y is out of range"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
.line 7
:cond_64
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "x is out of range"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
.line 5
:cond_6c
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "point is at infinity"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static zza(Ljava/security/interfaces/ECPrivateKey;Ljava/security/spec/ECPoint;)[B
.registers 13
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/security/GeneralSecurityException;
}
.end annotation
.line 50
invoke-interface {p0}, Ljava/security/interfaces/ECPrivateKey;->getParams()Ljava/security/spec/ECParameterSpec;
move-result-object v0
invoke-virtual {v0}, Ljava/security/spec/ECParameterSpec;->getCurve()Ljava/security/spec/EllipticCurve;
move-result-object v0
invoke-static {p1, v0}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/security/spec/ECPoint;Ljava/security/spec/EllipticCurve;)V
.line 51
invoke-interface {p0}, Ljava/security/interfaces/ECPrivateKey;->getParams()Ljava/security/spec/ECParameterSpec;
move-result-object v0
.line 52
new-instance v1, Ljava/security/spec/ECPublicKeySpec;
invoke-direct {v1, p1, v0}, Ljava/security/spec/ECPublicKeySpec;-><init>(Ljava/security/spec/ECPoint;Ljava/security/spec/ECParameterSpec;)V
.line 53
sget-object p1, Lcom/google/android/gms/internal/ads/zzehh;->zzihj:Lcom/google/android/gms/internal/ads/zzehh;
const-string v0, "EC"
invoke-virtual {p1, v0}, Lcom/google/android/gms/internal/ads/zzehh;->zzhq(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Ljava/security/KeyFactory;
.line 54
invoke-virtual {p1, v1}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
move-result-object p1
.line 55
sget-object v0, Lcom/google/android/gms/internal/ads/zzehh;->zzihh:Lcom/google/android/gms/internal/ads/zzehh;
const-string v1, "ECDH"
invoke-virtual {v0, v1}, Lcom/google/android/gms/internal/ads/zzehh;->zzhq(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljavax/crypto/KeyAgreement;
.line 56
invoke-virtual {v0, p0}, Ljavax/crypto/KeyAgreement;->init(Ljava/security/Key;)V
const/4 v1, 0x1
.line 57
:try_start_30
invoke-virtual {v0, p1, v1}, Ljavax/crypto/KeyAgreement;->doPhase(Ljava/security/Key;Z)Ljava/security/Key;
.line 58
invoke-virtual {v0}, Ljavax/crypto/KeyAgreement;->generateSecret()[B
move-result-object p1
.line 60
invoke-interface {p0}, Ljava/security/interfaces/ECPrivateKey;->getParams()Ljava/security/spec/ECParameterSpec;
move-result-object p0
invoke-virtual {p0}, Ljava/security/spec/ECParameterSpec;->getCurve()Ljava/security/spec/EllipticCurve;
move-result-object p0
.line 61
new-instance v0, Ljava/math/BigInteger;
invoke-direct {v0, v1, p1}, Ljava/math/BigInteger;-><init>(I[B)V
.line 62
invoke-virtual {v0}, Ljava/math/BigInteger;->signum()I
move-result v2
const/4 v3, -0x1
if-eq v2, v3, :cond_1a1
invoke-static {p0}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/security/spec/EllipticCurve;)Ljava/math/BigInteger;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/math/BigInteger;->compareTo(Ljava/math/BigInteger;)I
move-result v2
if-gez v2, :cond_1a1
.line 65
invoke-static {p0}, Lcom/google/android/gms/internal/ads/zzehe;->zza(Ljava/security/spec/EllipticCurve;)Ljava/math/BigInteger;
move-result-object v2
.line 66
invoke-virtual {p0}, Ljava/security/spec/EllipticCurve;->getA()Ljava/math/BigInteger;
move-result-object v3
.line 67
invoke-virtual {p0}, Ljava/security/spec/EllipticCurve;->getB()Ljava/math/BigInteger;
move-result-object p0
.line 68
invoke-virtual {v0, v0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v4
invoke-virtual {v4, v3}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v0
invoke-virtual {v0, p0}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
invoke-virtual {p0, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
.line 70
invoke-virtual {v2}, Ljava/math/BigInteger;->signum()I
move-result v0
if-ne v0, v1, :cond_199
.line 72
invoke-virtual {p0, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
const/4 v0, 0x0
.line 74
sget-object v3, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
invoke-virtual {p0, v3}, Ljava/math/BigInteger;->equals(Ljava/lang/Object;)Z
move-result v3
const/4 v4, 0x0
if-eqz v3, :cond_8d
.line 75
sget-object p0, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
goto/16 :goto_18b
.line 76
:cond_8d
invoke-virtual {v2, v4}, Ljava/math/BigInteger;->testBit(I)Z
move-result v3
const/4 v5, 0x2
if-eqz v3, :cond_aa
invoke-virtual {v2, v1}, Ljava/math/BigInteger;->testBit(I)Z
move-result v3
if-eqz v3, :cond_aa
.line 77
sget-object v0, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v2, v0}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v0
invoke-virtual {v0, v5}, Ljava/math/BigInteger;->shiftRight(I)Ljava/math/BigInteger;
move-result-object v0
.line 78
invoke-virtual {p0, v0, v2}, Ljava/math/BigInteger;->modPow(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v0
goto/16 :goto_171
.line 79
:cond_aa
invoke-virtual {v2, v4}, Ljava/math/BigInteger;->testBit(I)Z
move-result v3
if-eqz v3, :cond_171
invoke-virtual {v2, v1}, Ljava/math/BigInteger;->testBit(I)Z
move-result v3
if-nez v3, :cond_171
.line 80
sget-object v0, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
.line 81
sget-object v3, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v2, v3}, Ljava/math/BigInteger;->subtract(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v3, v1}, Ljava/math/BigInteger;->shiftRight(I)Ljava/math/BigInteger;
move-result-object v3
const/4 v6, 0x0
.line 83
:cond_c3
:goto_c3
invoke-virtual {v0, v0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v7
invoke-virtual {v7, p0}, Ljava/math/BigInteger;->subtract(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v7
invoke-virtual {v7, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v7
.line 84
sget-object v8, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
invoke-virtual {v7, v8}, Ljava/math/BigInteger;->equals(Ljava/lang/Object;)Z
move-result v8
if-nez v8, :cond_18a
.line 86
invoke-virtual {v7, v3, v2}, Ljava/math/BigInteger;->modPow(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v8
.line 87
sget-object v9, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v8, v9}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v9
invoke-virtual {v9, v2}, Ljava/math/BigInteger;->equals(Ljava/lang/Object;)Z
move-result v9
if-nez v9, :cond_111
.line 88
sget-object v7, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v8, v7}, Ljava/math/BigInteger;->equals(Ljava/lang/Object;)Z
move-result v7
:try_end_ed
.catch Ljava/lang/IllegalStateException; {:try_start_30 .. :try_end_ed} :catch_1a9
const-string v8, "p is not prime"
if-eqz v7, :cond_10b
.line 90
:try_start_f1
sget-object v7, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v0, v7}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v0
add-int/2addr v6, v1
const/16 v7, 0x80
if-ne v6, v7, :cond_c3
const/16 v7, 0x50
.line 93
invoke-virtual {v2, v7}, Ljava/math/BigInteger;->isProbablePrime(I)Z
move-result v7
if-eqz v7, :cond_105
goto :goto_c3
.line 94
:cond_105
new-instance p0, Ljava/security/InvalidAlgorithmParameterException;
invoke-direct {p0, v8}, Ljava/security/InvalidAlgorithmParameterException;-><init>(Ljava/lang/String;)V
throw p0
.line 89
:cond_10b
new-instance p0, Ljava/security/InvalidAlgorithmParameterException;
invoke-direct {p0, v8}, Ljava/security/InvalidAlgorithmParameterException;-><init>(Ljava/lang/String;)V
throw p0
.line 96
:cond_111
sget-object v3, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
invoke-virtual {v2, v3}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v3, v1}, Ljava/math/BigInteger;->shiftRight(I)Ljava/math/BigInteger;
move-result-object v3
.line 98
sget-object v6, Ljava/math/BigInteger;->ONE:Ljava/math/BigInteger;
.line 99
invoke-virtual {v3}, Ljava/math/BigInteger;->bitLength()I
move-result v8
sub-int/2addr v8, v5
move-object v5, v0
:goto_123
if-ltz v8, :cond_170
.line 100
invoke-virtual {v5, v6}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v9
.line 101
invoke-virtual {v5, v5}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v5
invoke-virtual {v6, v6}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
invoke-virtual {v6, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
invoke-virtual {v6, v7}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v5
invoke-virtual {v5, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v5
.line 102
invoke-virtual {v9, v9}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
invoke-virtual {v6, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
.line 103
invoke-virtual {v3, v8}, Ljava/math/BigInteger;->testBit(I)Z
move-result v9
if-eqz v9, :cond_16d
.line 104
invoke-virtual {v5, v0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v9
invoke-virtual {v6, v7}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v10
invoke-virtual {v9, v10}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v9
invoke-virtual {v9, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v9
.line 105
invoke-virtual {v0, v6}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v6
invoke-virtual {v6, v5}, Ljava/math/BigInteger;->add(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v5
invoke-virtual {v5, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v5
move-object v6, v5
move-object v5, v9
:cond_16d
add-int/lit8 v8, v8, -0x1
goto :goto_123
:cond_170
move-object v0, v5
:cond_171
:goto_171
if-eqz v0, :cond_18a
.line 109
invoke-virtual {v0, v0}, Ljava/math/BigInteger;->multiply(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v3, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object v3
invoke-virtual {v3, p0}, Ljava/math/BigInteger;->compareTo(Ljava/math/BigInteger;)I
move-result p0
if-nez p0, :cond_182
goto :goto_18a
.line 110
:cond_182
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "Could not find a modular square root"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
:cond_18a
:goto_18a
move-object p0, v0
.line 113
:goto_18b
invoke-virtual {p0, v4}, Ljava/math/BigInteger;->testBit(I)Z
move-result v0
if-eq v1, v0, :cond_198
.line 114
invoke-virtual {v2, p0}, Ljava/math/BigInteger;->subtract(Ljava/math/BigInteger;)Ljava/math/BigInteger;
move-result-object p0
invoke-virtual {p0, v2}, Ljava/math/BigInteger;->mod(Ljava/math/BigInteger;)Ljava/math/BigInteger;
:cond_198
return-object p1
.line 71
:cond_199
new-instance p0, Ljava/security/InvalidAlgorithmParameterException;
const-string p1, "p must be positive"
invoke-direct {p0, p1}, Ljava/security/InvalidAlgorithmParameterException;-><init>(Ljava/lang/String;)V
throw p0
.line 63
:cond_1a1
new-instance p0, Ljava/security/GeneralSecurityException;
const-string p1, "shared secret is out of range"
invoke-direct {p0, p1}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
throw p0
:try_end_1a9
.catch Ljava/lang/IllegalStateException; {:try_start_f1 .. :try_end_1a9} :catch_1a9
:catch_1a9
move-exception p0
.line 117
new-instance p1, Ljava/security/GeneralSecurityException;
invoke-virtual {p0}, Ljava/lang/IllegalStateException;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/security/GeneralSecurityException;-><init>(Ljava/lang/String;)V
goto :goto_1b5
:goto_1b4
throw p1
:goto_1b5
goto :goto_1b4
.end method