public class org.bouncycastle.jce.provider.JCEDHKeyAgreement extends javax.crypto.KeyAgreementSpi
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.bouncycastle.jce.provider.JCEDHKeyAgreement
super_class: javax.crypto.KeyAgreementSpi
{
private java.math.BigInteger x;
descriptor: Ljava/math/BigInteger;
flags: (0x0002) ACC_PRIVATE
private java.math.BigInteger p;
descriptor: Ljava/math/BigInteger;
flags: (0x0002) ACC_PRIVATE
private java.math.BigInteger g;
descriptor: Ljava/math/BigInteger;
flags: (0x0002) ACC_PRIVATE
private java.math.BigInteger result;
descriptor: Ljava/math/BigInteger;
flags: (0x0002) ACC_PRIVATE
private static final java.util.Hashtable algorithms;
descriptor: Ljava/util/Hashtable;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=4, args_size=0
0: new java.util.Hashtable
dup
invokespecial java.util.Hashtable.<init>:()V
putstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
1: new java.lang.Integer
dup
bipush 64
invokespecial java.lang.Integer.<init>:(I)V
astore 0
start local 0 2: new java.lang.Integer
dup
sipush 192
invokespecial java.lang.Integer.<init>:(I)V
astore 1
start local 1 3: new java.lang.Integer
dup
sipush 128
invokespecial java.lang.Integer.<init>:(I)V
astore 2
start local 2 4: new java.lang.Integer
dup
sipush 256
invokespecial java.lang.Integer.<init>:(I)V
astore 3
start local 3 5: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
ldc "DES"
aload 0
invokevirtual java.util.Hashtable.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
6: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
ldc "DESEDE"
aload 1
invokevirtual java.util.Hashtable.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
7: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
ldc "BLOWFISH"
aload 2
invokevirtual java.util.Hashtable.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
8: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
ldc "AES"
aload 3
invokevirtual java.util.Hashtable.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
end local 3 end local 2 end local 1 end local 0 9: return
LocalVariableTable:
Start End Slot Name Signature
2 9 0 i64 Ljava/lang/Integer;
3 9 1 i192 Ljava/lang/Integer;
4 9 2 i128 Ljava/lang/Integer;
5 9 3 i256 Ljava/lang/Integer;
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial javax.crypto.KeyAgreementSpi.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
private byte[] bigIntToBytes(java.math.BigInteger);
descriptor: (Ljava/math/BigInteger;)[B
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual java.math.BigInteger.toByteArray:()[B
astore 2
start local 2 1: aload 2
iconst_0
baload
ifne 5
2: aload 2
arraylength
iconst_1
isub
newarray 8
astore 3
start local 3 3: aload 2
iconst_1
aload 3
iconst_0
aload 3
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
4: aload 3
areturn
end local 3 5: StackMap locals: byte[]
StackMap stack:
aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 6 1 r Ljava/math/BigInteger;
1 6 2 tmp [B
3 5 3 ntmp [B
MethodParameters:
Name Flags
r
protected java.security.Key engineDoPhase(java.security.Key, boolean);
descriptor: (Ljava/security/Key;Z)Ljava/security/Key;
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Diffie-Hellman not initialised."
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
instanceof javax.crypto.interfaces.DHPublicKey
ifne 4
3: new java.security.InvalidKeyException
dup
ldc "DHKeyAgreement doPhase requires DHPublicKey"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 1
checkcast javax.crypto.interfaces.DHPublicKey
astore 3
start local 3 5: aload 3
invokeinterface javax.crypto.interfaces.DHPublicKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getG:()Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.g:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.equals:(Ljava/lang/Object;)Z
ifeq 6
aload 3
invokeinterface javax.crypto.interfaces.DHPublicKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.equals:(Ljava/lang/Object;)Z
ifne 7
6: StackMap locals: javax.crypto.interfaces.DHPublicKey
StackMap stack:
new java.security.InvalidKeyException
dup
ldc "DHPublicKey not for this KeyAgreement!"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
7: StackMap locals:
StackMap stack:
iload 2
ifeq 10
8: aload 0
aload 1
checkcast javax.crypto.interfaces.DHPublicKey
invokeinterface javax.crypto.interfaces.DHPublicKey.getY:()Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.modPow:(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
9: aconst_null
areturn
10: StackMap locals:
StackMap stack:
aload 0
aload 1
checkcast javax.crypto.interfaces.DHPublicKey
invokeinterface javax.crypto.interfaces.DHPublicKey.getY:()Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.modPow:(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
11: new org.bouncycastle.jce.provider.JCEDHPublicKey
dup
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
aload 3
invokeinterface javax.crypto.interfaces.DHPublicKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokespecial org.bouncycastle.jce.provider.JCEDHPublicKey.<init>:(Ljava/math/BigInteger;Ljavax/crypto/spec/DHParameterSpec;)V
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 12 1 key Ljava/security/Key;
0 12 2 lastPhase Z
5 12 3 pubKey Ljavax/crypto/interfaces/DHPublicKey;
Exceptions:
throws java.security.InvalidKeyException, java.lang.IllegalStateException
MethodParameters:
Name Flags
key
lastPhase
protected byte[] engineGenerateSecret();
descriptor: ()[B
flags: (0x0004) ACC_PROTECTED
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Diffie-Hellman not initialised."
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
invokevirtual org.bouncycastle.jce.provider.JCEDHKeyAgreement.bigIntToBytes:(Ljava/math/BigInteger;)[B
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
Exceptions:
throws java.lang.IllegalStateException
protected int engineGenerateSecret(byte[], int);
descriptor: ([BI)I
flags: (0x0004) ACC_PROTECTED
Code:
stack=5, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Diffie-Hellman not initialised."
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
invokevirtual org.bouncycastle.jce.provider.JCEDHKeyAgreement.bigIntToBytes:(Ljava/math/BigInteger;)[B
astore 3
start local 3 3: aload 1
arraylength
iload 2
isub
aload 3
arraylength
if_icmpge 5
4: new javax.crypto.ShortBufferException
dup
ldc "DHKeyAgreement - buffer too short"
invokespecial javax.crypto.ShortBufferException.<init>:(Ljava/lang/String;)V
athrow
5: StackMap locals: byte[]
StackMap stack:
aload 3
iconst_0
aload 1
iload 2
aload 3
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
6: aload 3
arraylength
ireturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 7 1 sharedSecret [B
0 7 2 offset I
3 7 3 secret [B
Exceptions:
throws java.lang.IllegalStateException, javax.crypto.ShortBufferException
MethodParameters:
Name Flags
sharedSecret
offset
protected javax.crypto.SecretKey engineGenerateSecret(java.lang.String);
descriptor: (Ljava/lang/String;)Ljavax/crypto/SecretKey;
flags: (0x0004) ACC_PROTECTED
Code:
stack=5, locals=6, args_size=2
start local 0 start local 1 0: aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Diffie-Hellman not initialised."
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
invokestatic org.bouncycastle.util.Strings.toUpperCase:(Ljava/lang/String;)Ljava/lang/String;
astore 2
start local 2 3: aload 0
aload 0
getfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
invokevirtual org.bouncycastle.jce.provider.JCEDHKeyAgreement.bigIntToBytes:(Ljava/math/BigInteger;)[B
astore 3
start local 3 4: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
aload 2
invokevirtual java.util.Hashtable.containsKey:(Ljava/lang/Object;)Z
ifeq 11
5: getstatic org.bouncycastle.jce.provider.JCEDHKeyAgreement.algorithms:Ljava/util/Hashtable;
aload 2
invokevirtual java.util.Hashtable.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.lang.Integer
astore 4
start local 4 6: aload 4
invokevirtual java.lang.Integer.intValue:()I
bipush 8
idiv
newarray 8
astore 5
start local 5 7: aload 3
iconst_0
aload 5
iconst_0
aload 5
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
8: aload 2
ldc "DES"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifeq 10
9: aload 5
invokestatic org.bouncycastle.crypto.params.DESParameters.setOddParity:([B)V
10: StackMap locals: org.bouncycastle.jce.provider.JCEDHKeyAgreement java.lang.String java.lang.String byte[] java.lang.Integer byte[]
StackMap stack:
new javax.crypto.spec.SecretKeySpec
dup
aload 5
aload 1
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BLjava/lang/String;)V
areturn
end local 5 end local 4 11: StackMap locals:
StackMap stack:
new javax.crypto.spec.SecretKeySpec
dup
aload 3
aload 1
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BLjava/lang/String;)V
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 12 1 algorithm Ljava/lang/String;
3 12 2 algKey Ljava/lang/String;
4 12 3 res [B
6 11 4 length Ljava/lang/Integer;
7 11 5 key [B
MethodParameters:
Name Flags
algorithm
protected void engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom);
descriptor: (Ljava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;Ljava/security/SecureRandom;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=6, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 1
instanceof javax.crypto.interfaces.DHPrivateKey
ifne 2
1: new java.security.InvalidKeyException
dup
ldc "DHKeyAgreement requires DHPrivateKey for initialisation"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
checkcast javax.crypto.interfaces.DHPrivateKey
astore 4
start local 4 3: aload 2
ifnull 10
4: aload 2
instanceof javax.crypto.spec.DHParameterSpec
ifne 6
5: new java.security.InvalidAlgorithmParameterException
dup
ldc "DHKeyAgreement only accepts DHParameterSpec"
invokespecial java.security.InvalidAlgorithmParameterException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals: javax.crypto.interfaces.DHPrivateKey
StackMap stack:
aload 2
checkcast javax.crypto.spec.DHParameterSpec
astore 5
start local 5 7: aload 0
aload 5
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
8: aload 0
aload 5
invokevirtual javax.crypto.spec.DHParameterSpec.getG:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.g:Ljava/math/BigInteger;
end local 5 9: goto 12
10: StackMap locals:
StackMap stack:
aload 0
aload 4
invokeinterface javax.crypto.interfaces.DHPrivateKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
11: aload 0
aload 4
invokeinterface javax.crypto.interfaces.DHPrivateKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getG:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.g:Ljava/math/BigInteger;
12: StackMap locals:
StackMap stack:
aload 0
aload 0
aload 4
invokeinterface javax.crypto.interfaces.DHPrivateKey.getX:()Ljava/math/BigInteger;
dup_x1
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
13: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 14 1 key Ljava/security/Key;
0 14 2 params Ljava/security/spec/AlgorithmParameterSpec;
0 14 3 random Ljava/security/SecureRandom;
3 14 4 privKey Ljavax/crypto/interfaces/DHPrivateKey;
7 9 5 p Ljavax/crypto/spec/DHParameterSpec;
Exceptions:
throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
MethodParameters:
Name Flags
key
params
random
protected void engineInit(java.security.Key, java.security.SecureRandom);
descriptor: (Ljava/security/Key;Ljava/security/SecureRandom;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 1
instanceof javax.crypto.interfaces.DHPrivateKey
ifne 2
1: new java.security.InvalidKeyException
dup
ldc "DHKeyAgreement requires DHPrivateKey"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
checkcast javax.crypto.interfaces.DHPrivateKey
astore 3
start local 3 3: aload 0
aload 3
invokeinterface javax.crypto.interfaces.DHPrivateKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getP:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.p:Ljava/math/BigInteger;
4: aload 0
aload 3
invokeinterface javax.crypto.interfaces.DHPrivateKey.getParams:()Ljavax/crypto/spec/DHParameterSpec;
invokevirtual javax.crypto.spec.DHParameterSpec.getG:()Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.g:Ljava/math/BigInteger;
5: aload 0
aload 0
aload 3
invokeinterface javax.crypto.interfaces.DHPrivateKey.getX:()Ljava/math/BigInteger;
dup_x1
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.result:Ljava/math/BigInteger;
putfield org.bouncycastle.jce.provider.JCEDHKeyAgreement.x:Ljava/math/BigInteger;
6: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/bouncycastle/jce/provider/JCEDHKeyAgreement;
0 7 1 key Ljava/security/Key;
0 7 2 random Ljava/security/SecureRandom;
3 7 3 privKey Ljavax/crypto/interfaces/DHPrivateKey;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
key
random
}
SourceFile: "JCEDHKeyAgreement.java"