public class org.bouncycastle.crypto.engines.ElGamalEngine implements org.bouncycastle.crypto.AsymmetricBlockCipher
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.bouncycastle.crypto.engines.ElGamalEngine
super_class: java.lang.Object
{
private org.bouncycastle.crypto.params.ElGamalKeyParameters key;
descriptor: Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
flags: (0x0002) ACC_PRIVATE
private java.security.SecureRandom random;
descriptor: Ljava/security/SecureRandom;
flags: (0x0002) ACC_PRIVATE
private boolean forEncryption;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private int bitSize;
descriptor: I
flags: (0x0002) ACC_PRIVATE
private static final java.math.BigInteger ZERO;
descriptor: Ljava/math/BigInteger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.math.BigInteger ONE;
descriptor: Ljava/math/BigInteger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.math.BigInteger TWO;
descriptor: Ljava/math/BigInteger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: lconst_0
invokestatic java.math.BigInteger.valueOf:(J)Ljava/math/BigInteger;
putstatic org.bouncycastle.crypto.engines.ElGamalEngine.ZERO:Ljava/math/BigInteger;
1: lconst_1
invokestatic java.math.BigInteger.valueOf:(J)Ljava/math/BigInteger;
putstatic org.bouncycastle.crypto.engines.ElGamalEngine.ONE:Ljava/math/BigInteger;
2: ldc 2
invokestatic java.math.BigInteger.valueOf:(J)Ljava/math/BigInteger;
putstatic org.bouncycastle.crypto.engines.ElGamalEngine.TWO:Ljava/math/BigInteger;
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/bouncycastle/crypto/engines/ElGamalEngine;
public void init(boolean, org.bouncycastle.crypto.CipherParameters);
descriptor: (ZLorg/bouncycastle/crypto/CipherParameters;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 2
instanceof org.bouncycastle.crypto.params.ParametersWithRandom
ifeq 5
1: aload 2
checkcast org.bouncycastle.crypto.params.ParametersWithRandom
astore 3
start local 3 2: aload 0
aload 3
invokevirtual org.bouncycastle.crypto.params.ParametersWithRandom.getParameters:()Lorg/bouncycastle/crypto/CipherParameters;
checkcast org.bouncycastle.crypto.params.ElGamalKeyParameters
putfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
3: aload 0
aload 3
invokevirtual org.bouncycastle.crypto.params.ParametersWithRandom.getRandom:()Ljava/security/SecureRandom;
putfield org.bouncycastle.crypto.engines.ElGamalEngine.random:Ljava/security/SecureRandom;
end local 3 4: goto 7
5: StackMap locals:
StackMap stack:
aload 0
aload 2
checkcast org.bouncycastle.crypto.params.ElGamalKeyParameters
putfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
6: aload 0
new java.security.SecureRandom
dup
invokespecial java.security.SecureRandom.<init>:()V
putfield org.bouncycastle.crypto.engines.ElGamalEngine.random:Ljava/security/SecureRandom;
7: StackMap locals:
StackMap stack:
aload 0
iload 1
putfield org.bouncycastle.crypto.engines.ElGamalEngine.forEncryption:Z
8: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalKeyParameters.getParameters:()Lorg/bouncycastle/crypto/params/ElGamalParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalParameters.getP:()Ljava/math/BigInteger;
astore 3
start local 3 9: aload 0
aload 3
invokevirtual java.math.BigInteger.bitLength:()I
putfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
10: iload 1
ifeq 13
11: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
instanceof org.bouncycastle.crypto.params.ElGamalPublicKeyParameters
ifne 15
12: new java.lang.IllegalArgumentException
dup
ldc "ElGamalPublicKeyParameters are required for encryption."
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
13: StackMap locals: java.math.BigInteger
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
instanceof org.bouncycastle.crypto.params.ElGamalPrivateKeyParameters
ifne 15
14: new java.lang.IllegalArgumentException
dup
ldc "ElGamalPrivateKeyParameters are required for decryption."
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
15: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 16 0 this Lorg/bouncycastle/crypto/engines/ElGamalEngine;
0 16 1 forEncryption Z
0 16 2 param Lorg/bouncycastle/crypto/CipherParameters;
2 4 3 p Lorg/bouncycastle/crypto/params/ParametersWithRandom;
9 16 3 p Ljava/math/BigInteger;
MethodParameters:
Name Flags
forEncryption
param
public int getInputBlockSize();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.forEncryption:Z
ifeq 2
1: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
iconst_1
isub
bipush 8
idiv
ireturn
2: StackMap locals:
StackMap stack:
iconst_2
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
bipush 7
iadd
bipush 8
idiv
imul
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/bouncycastle/crypto/engines/ElGamalEngine;
public int getOutputBlockSize();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.forEncryption:Z
ifeq 2
1: iconst_2
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
bipush 7
iadd
bipush 8
idiv
imul
ireturn
2: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
iconst_1
isub
bipush 8
idiv
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/bouncycastle/crypto/engines/ElGamalEngine;
public byte[] processBlock(byte[], int, int);
descriptor: ([BII)[B
flags: (0x0001) ACC_PUBLIC
Code:
stack=6, locals=17, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "ElGamal engine not initialised"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.forEncryption:Z
ifeq 4
3: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.bitSize:I
iconst_1
isub
bipush 7
iadd
bipush 8
idiv
goto 5
4: StackMap locals:
StackMap stack:
aload 0
invokevirtual org.bouncycastle.crypto.engines.ElGamalEngine.getInputBlockSize:()I
5: StackMap locals:
StackMap stack: int
istore 4
start local 4 6: iload 3
iload 4
if_icmple 8
7: new org.bouncycastle.crypto.DataLengthException
dup
ldc "input too large for ElGamal cipher.\n"
invokespecial org.bouncycastle.crypto.DataLengthException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals: int
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalKeyParameters.getParameters:()Lorg/bouncycastle/crypto/params/ElGamalParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalParameters.getP:()Ljava/math/BigInteger;
astore 5
start local 5 9: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
instanceof org.bouncycastle.crypto.params.ElGamalPrivateKeyParameters
ifeq 19
10: iload 3
iconst_2
idiv
newarray 8
astore 6
start local 6 11: iload 3
iconst_2
idiv
newarray 8
astore 7
start local 7 12: aload 1
iload 2
aload 6
iconst_0
aload 6
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
13: aload 1
iload 2
aload 6
arraylength
iadd
aload 7
iconst_0
aload 7
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
14: new java.math.BigInteger
dup
iconst_1
aload 6
invokespecial java.math.BigInteger.<init>:(I[B)V
astore 8
start local 8 15: new java.math.BigInteger
dup
iconst_1
aload 7
invokespecial java.math.BigInteger.<init>:(I[B)V
astore 9
start local 9 16: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
checkcast org.bouncycastle.crypto.params.ElGamalPrivateKeyParameters
astore 10
start local 10 17: aload 8
aload 5
getstatic org.bouncycastle.crypto.engines.ElGamalEngine.ONE:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.subtract:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
aload 10
invokevirtual org.bouncycastle.crypto.params.ElGamalPrivateKeyParameters.getX:()Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.subtract:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
aload 5
invokevirtual java.math.BigInteger.modPow:(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
aload 9
invokevirtual java.math.BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
aload 5
invokevirtual java.math.BigInteger.mod:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
astore 11
start local 11 18: aload 11
invokestatic org.bouncycastle.util.BigIntegers.asUnsignedByteArray:(Ljava/math/BigInteger;)[B
areturn
end local 11 end local 10 end local 9 end local 8 end local 7 end local 6 19: StackMap locals: java.math.BigInteger
StackMap stack:
iload 2
ifne 20
iload 3
aload 1
arraylength
if_icmpeq 23
20: StackMap locals:
StackMap stack:
iload 3
newarray 8
astore 6
start local 6 21: aload 1
iload 2
aload 6
iconst_0
iload 3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
22: goto 24
end local 6 23: StackMap locals:
StackMap stack:
aload 1
astore 6
start local 6 24: StackMap locals: byte[]
StackMap stack:
new java.math.BigInteger
dup
iconst_1
aload 6
invokespecial java.math.BigInteger.<init>:(I[B)V
astore 7
start local 7 25: aload 7
invokevirtual java.math.BigInteger.bitLength:()I
aload 5
invokevirtual java.math.BigInteger.bitLength:()I
if_icmplt 27
26: new org.bouncycastle.crypto.DataLengthException
dup
ldc "input too large for ElGamal cipher.\n"
invokespecial org.bouncycastle.crypto.DataLengthException.<init>:(Ljava/lang/String;)V
athrow
27: StackMap locals: java.math.BigInteger
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
checkcast org.bouncycastle.crypto.params.ElGamalPublicKeyParameters
astore 8
start local 8 28: aload 5
invokevirtual java.math.BigInteger.bitLength:()I
istore 9
start local 9 29: new java.math.BigInteger
dup
iload 9
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.random:Ljava/security/SecureRandom;
invokespecial java.math.BigInteger.<init>:(ILjava/util/Random;)V
astore 10
start local 10 30: goto 32
31: StackMap locals: org.bouncycastle.crypto.params.ElGamalPublicKeyParameters int java.math.BigInteger
StackMap stack:
new java.math.BigInteger
dup
iload 9
aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.random:Ljava/security/SecureRandom;
invokespecial java.math.BigInteger.<init>:(ILjava/util/Random;)V
astore 10
32: StackMap locals:
StackMap stack:
aload 10
getstatic org.bouncycastle.crypto.engines.ElGamalEngine.ZERO:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.equals:(Ljava/lang/Object;)Z
ifne 31
aload 10
aload 5
getstatic org.bouncycastle.crypto.engines.ElGamalEngine.TWO:Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.subtract:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.compareTo:(Ljava/math/BigInteger;)I
ifgt 31
33: aload 0
getfield org.bouncycastle.crypto.engines.ElGamalEngine.key:Lorg/bouncycastle/crypto/params/ElGamalKeyParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalKeyParameters.getParameters:()Lorg/bouncycastle/crypto/params/ElGamalParameters;
invokevirtual org.bouncycastle.crypto.params.ElGamalParameters.getG:()Ljava/math/BigInteger;
astore 11
start local 11 34: aload 11
aload 10
aload 5
invokevirtual java.math.BigInteger.modPow:(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
astore 12
start local 12 35: aload 7
aload 8
invokevirtual org.bouncycastle.crypto.params.ElGamalPublicKeyParameters.getY:()Ljava/math/BigInteger;
aload 10
aload 5
invokevirtual java.math.BigInteger.modPow:(Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljava/math/BigInteger;
invokevirtual java.math.BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
aload 5
invokevirtual java.math.BigInteger.mod:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
astore 13
start local 13 36: aload 12
invokevirtual java.math.BigInteger.toByteArray:()[B
astore 14
start local 14 37: aload 13
invokevirtual java.math.BigInteger.toByteArray:()[B
astore 15
start local 15 38: aload 0
invokevirtual org.bouncycastle.crypto.engines.ElGamalEngine.getOutputBlockSize:()I
newarray 8
astore 16
start local 16 39: aload 14
arraylength
aload 16
arraylength
iconst_2
idiv
if_icmple 42
40: aload 14
iconst_1
aload 16
aload 16
arraylength
iconst_2
idiv
aload 14
arraylength
iconst_1
isub
isub
aload 14
arraylength
iconst_1
isub
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
41: goto 43
42: StackMap locals: org.bouncycastle.crypto.engines.ElGamalEngine byte[] int int int java.math.BigInteger byte[] java.math.BigInteger org.bouncycastle.crypto.params.ElGamalPublicKeyParameters int java.math.BigInteger java.math.BigInteger java.math.BigInteger java.math.BigInteger byte[] byte[] byte[]
StackMap stack:
aload 14
iconst_0
aload 16
aload 16
arraylength
iconst_2
idiv
aload 14
arraylength
isub
aload 14
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
43: StackMap locals:
StackMap stack:
aload 15
arraylength
aload 16
arraylength
iconst_2
idiv
if_icmple 46
44: aload 15
iconst_1
aload 16
aload 16
arraylength
aload 15
arraylength
iconst_1
isub
isub
aload 15
arraylength
iconst_1
isub
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
45: goto 47
46: StackMap locals:
StackMap stack:
aload 15
iconst_0
aload 16
aload 16
arraylength
aload 15
arraylength
isub
aload 15
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
47: StackMap locals:
StackMap stack:
aload 16
areturn
end local 16 end local 15 end local 14 end local 13 end local 12 end local 11 end local 10 end local 9 end local 8 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 48 0 this Lorg/bouncycastle/crypto/engines/ElGamalEngine;
0 48 1 in [B
0 48 2 inOff I
0 48 3 inLen I
6 48 4 maxLength I
9 48 5 p Ljava/math/BigInteger;
11 19 6 in1 [B
12 19 7 in2 [B
15 19 8 gamma Ljava/math/BigInteger;
16 19 9 phi Ljava/math/BigInteger;
17 19 10 priv Lorg/bouncycastle/crypto/params/ElGamalPrivateKeyParameters;
18 19 11 m Ljava/math/BigInteger;
21 23 6 block [B
24 48 6 block [B
25 48 7 input Ljava/math/BigInteger;
28 48 8 pub Lorg/bouncycastle/crypto/params/ElGamalPublicKeyParameters;
29 48 9 pBitLength I
30 48 10 k Ljava/math/BigInteger;
34 48 11 g Ljava/math/BigInteger;
35 48 12 gamma Ljava/math/BigInteger;
36 48 13 phi Ljava/math/BigInteger;
37 48 14 out1 [B
38 48 15 out2 [B
39 48 16 output [B
MethodParameters:
Name Flags
in
inOff
inLen
}
SourceFile: "ElGamalEngine.java"