public class org.bouncycastle.crypto.engines.RFC3211WrapEngine implements org.bouncycastle.crypto.Wrapper
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.bouncycastle.crypto.engines.RFC3211WrapEngine
super_class: java.lang.Object
{
private org.bouncycastle.crypto.modes.CBCBlockCipher engine;
descriptor: Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
flags: (0x0002) ACC_PRIVATE
private org.bouncycastle.crypto.params.ParametersWithIV param;
descriptor: Lorg/bouncycastle/crypto/params/ParametersWithIV;
flags: (0x0002) ACC_PRIVATE
private boolean forWrapping;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private java.security.SecureRandom rand;
descriptor: Ljava/security/SecureRandom;
flags: (0x0002) ACC_PRIVATE
public void <init>(org.bouncycastle.crypto.BlockCipher);
descriptor: (Lorg/bouncycastle/crypto/BlockCipher;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new org.bouncycastle.crypto.modes.CBCBlockCipher
dup
aload 1
invokespecial org.bouncycastle.crypto.modes.CBCBlockCipher.<init>:(Lorg/bouncycastle/crypto/BlockCipher;)V
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/bouncycastle/crypto/engines/RFC3211WrapEngine;
0 3 1 engine Lorg/bouncycastle/crypto/BlockCipher;
MethodParameters:
Name Flags
engine
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 0
iload 1
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.forWrapping:Z
1: aload 2
instanceof org.bouncycastle.crypto.params.ParametersWithRandom
ifeq 8
2: aload 2
checkcast org.bouncycastle.crypto.params.ParametersWithRandom
astore 3
start local 3 3: aload 0
aload 3
invokevirtual org.bouncycastle.crypto.params.ParametersWithRandom.getRandom:()Ljava/security/SecureRandom;
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.rand:Ljava/security/SecureRandom;
4: aload 3
invokevirtual org.bouncycastle.crypto.params.ParametersWithRandom.getParameters:()Lorg/bouncycastle/crypto/CipherParameters;
instanceof org.bouncycastle.crypto.params.ParametersWithIV
ifne 6
5: new java.lang.IllegalArgumentException
dup
ldc "RFC3211Wrap requires an IV"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals: org.bouncycastle.crypto.params.ParametersWithRandom
StackMap stack:
aload 0
aload 3
invokevirtual org.bouncycastle.crypto.params.ParametersWithRandom.getParameters:()Lorg/bouncycastle/crypto/CipherParameters;
checkcast org.bouncycastle.crypto.params.ParametersWithIV
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
end local 3 7: goto 13
8: StackMap locals:
StackMap stack:
iload 1
ifeq 10
9: aload 0
invokestatic org.bouncycastle.crypto.CryptoServicesRegistrar.getSecureRandom:()Ljava/security/SecureRandom;
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.rand:Ljava/security/SecureRandom;
10: StackMap locals:
StackMap stack:
aload 2
instanceof org.bouncycastle.crypto.params.ParametersWithIV
ifne 12
11: new java.lang.IllegalArgumentException
dup
ldc "RFC3211Wrap requires an IV"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
12: StackMap locals:
StackMap stack:
aload 0
aload 2
checkcast org.bouncycastle.crypto.params.ParametersWithIV
putfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
13: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lorg/bouncycastle/crypto/engines/RFC3211WrapEngine;
0 14 1 forWrapping Z
0 14 2 param Lorg/bouncycastle/crypto/CipherParameters;
3 7 3 p Lorg/bouncycastle/crypto/params/ParametersWithRandom;
MethodParameters:
Name Flags
forWrapping
param
public java.lang.String getAlgorithmName();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.getUnderlyingCipher:()Lorg/bouncycastle/crypto/BlockCipher;
invokeinterface org.bouncycastle.crypto.BlockCipher.getAlgorithmName:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "/RFC3211Wrap"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/bouncycastle/crypto/engines/RFC3211WrapEngine;
public byte[] wrap(byte[], int, int);
descriptor: ([BII)[B
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=8, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.forWrapping:Z
ifne 2
1: new java.lang.IllegalStateException
dup
ldc "not set for wrapping"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
iload 3
sipush 255
if_icmpgt 3
iload 3
ifge 4
3: StackMap locals:
StackMap stack:
new java.lang.IllegalArgumentException
dup
ldc "input must be from 0 to 255 bytes"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
iconst_1
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.init:(ZLorg/bouncycastle/crypto/CipherParameters;)V
5: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.getBlockSize:()I
istore 4
start local 4 6: iload 3
iconst_4
iadd
iload 4
iconst_2
imul
if_icmpge 9
7: iload 4
iconst_2
imul
newarray 8
astore 5
start local 5 8: goto 12
end local 5 9: StackMap locals: int
StackMap stack:
iload 3
iconst_4
iadd
iload 4
irem
ifne 10
iload 3
iconst_4
iadd
goto 11
StackMap locals:
StackMap stack:
10: iload 3
iconst_4
iadd
iload 4
idiv
iconst_1
iadd
iload 4
imul
StackMap locals:
StackMap stack: int
11: newarray 8
astore 5
start local 5 12: StackMap locals: byte[]
StackMap stack:
aload 5
iconst_0
iload 3
i2b
bastore
13: aload 1
iload 2
aload 5
iconst_4
iload 3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
14: aload 5
arraylength
iload 3
iconst_4
iadd
isub
newarray 8
astore 6
start local 6 15: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.rand:Ljava/security/SecureRandom;
aload 6
invokevirtual java.security.SecureRandom.nextBytes:([B)V
16: aload 6
iconst_0
aload 5
iload 3
iconst_4
iadd
aload 6
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
17: aload 5
iconst_1
aload 5
iconst_4
baload
iconst_m1
ixor
i2b
bastore
18: aload 5
iconst_2
aload 5
iconst_5
baload
iconst_m1
ixor
i2b
bastore
19: aload 5
iconst_3
aload 5
bipush 6
baload
iconst_m1
ixor
i2b
bastore
20: iconst_0
istore 7
start local 7 21: goto 24
22: StackMap locals: byte[] int
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
aload 5
iload 7
aload 5
iload 7
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.processBlock:([BI[BI)I
pop
23: iload 7
iload 4
iadd
istore 7
StackMap locals:
StackMap stack:
24: iload 7
aload 5
arraylength
if_icmplt 22
end local 7 25: iconst_0
istore 7
start local 7 26: goto 29
27: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
aload 5
iload 7
aload 5
iload 7
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.processBlock:([BI[BI)I
pop
28: iload 7
iload 4
iadd
istore 7
StackMap locals:
StackMap stack:
29: iload 7
aload 5
arraylength
if_icmplt 27
end local 7 30: aload 5
areturn
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 31 0 this Lorg/bouncycastle/crypto/engines/RFC3211WrapEngine;
0 31 1 in [B
0 31 2 inOff I
0 31 3 inLen I
6 31 4 blockSize I
8 9 5 cekBlock [B
12 31 5 cekBlock [B
15 31 6 pad [B
21 25 7 i I
26 30 7 i I
MethodParameters:
Name Flags
in
inOff
inLen
public byte[] unwrap(byte[], int, int);
descriptor: ([BII)[B
flags: (0x0001) ACC_PUBLIC
Code:
stack=6, locals=12, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.forWrapping:Z
ifeq 2
1: new java.lang.IllegalStateException
dup
ldc "not set for unwrapping"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.getBlockSize:()I
istore 4
start local 4 3: iload 3
iconst_2
iload 4
imul
if_icmpge 5
4: new org.bouncycastle.crypto.InvalidCipherTextException
dup
ldc "input too short"
invokespecial org.bouncycastle.crypto.InvalidCipherTextException.<init>:(Ljava/lang/String;)V
athrow
5: StackMap locals: int
StackMap stack:
iload 3
newarray 8
astore 5
start local 5 6: iload 4
newarray 8
astore 6
start local 6 7: aload 1
iload 2
aload 5
iconst_0
iload 3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
8: aload 1
iload 2
aload 6
iconst_0
aload 6
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
9: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
iconst_0
new org.bouncycastle.crypto.params.ParametersWithIV
dup
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
invokevirtual org.bouncycastle.crypto.params.ParametersWithIV.getParameters:()Lorg/bouncycastle/crypto/CipherParameters;
aload 6
invokespecial org.bouncycastle.crypto.params.ParametersWithIV.<init>:(Lorg/bouncycastle/crypto/CipherParameters;[B)V
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.init:(ZLorg/bouncycastle/crypto/CipherParameters;)V
10: iload 4
istore 7
start local 7 11: goto 14
12: StackMap locals: byte[] byte[] int
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
aload 5
iload 7
aload 5
iload 7
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.processBlock:([BI[BI)I
pop
13: iload 7
iload 4
iadd
istore 7
StackMap locals:
StackMap stack:
14: iload 7
aload 5
arraylength
if_icmplt 12
end local 7 15: aload 5
aload 5
arraylength
aload 6
arraylength
isub
aload 6
iconst_0
aload 6
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
16: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
iconst_0
new org.bouncycastle.crypto.params.ParametersWithIV
dup
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
invokevirtual org.bouncycastle.crypto.params.ParametersWithIV.getParameters:()Lorg/bouncycastle/crypto/CipherParameters;
aload 6
invokespecial org.bouncycastle.crypto.params.ParametersWithIV.<init>:(Lorg/bouncycastle/crypto/CipherParameters;[B)V
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.init:(ZLorg/bouncycastle/crypto/CipherParameters;)V
17: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
aload 5
iconst_0
aload 5
iconst_0
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.processBlock:([BI[BI)I
pop
18: aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
iconst_0
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.param:Lorg/bouncycastle/crypto/params/ParametersWithIV;
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.init:(ZLorg/bouncycastle/crypto/CipherParameters;)V
19: iconst_0
istore 7
start local 7 20: goto 23
21: StackMap locals:
StackMap stack:
aload 0
getfield org.bouncycastle.crypto.engines.RFC3211WrapEngine.engine:Lorg/bouncycastle/crypto/modes/CBCBlockCipher;
aload 5
iload 7
aload 5
iload 7
invokevirtual org.bouncycastle.crypto.modes.CBCBlockCipher.processBlock:([BI[BI)I
pop
22: iload 7
iload 4
iadd
istore 7
StackMap locals:
StackMap stack:
23: iload 7
aload 5
arraylength
if_icmplt 21
end local 7 24: aload 5
iconst_0
baload
sipush 255
iand
aload 5
arraylength
iconst_4
isub
if_icmple 25
iconst_1
goto 26
StackMap locals:
StackMap stack:
25: iconst_0
StackMap locals:
StackMap stack: int
26: istore 7
start local 7 27: iload 7
ifeq 30
28: aload 5
arraylength
iconst_4
isub
newarray 8
astore 8
start local 8 29: goto 31
end local 8 30: StackMap locals: int
StackMap stack:
aload 5
iconst_0
baload
sipush 255
iand
newarray 8
astore 8
start local 8 31: StackMap locals: byte[]
StackMap stack:
aload 5
iconst_4
aload 8
iconst_0
aload 8
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
32: iconst_0
istore 9
start local 9 33: iconst_0
istore 10
start local 10 34: goto 38
35: StackMap locals: int int
StackMap stack:
aload 5
iconst_1
iload 10
iadd
baload
iconst_m1
ixor
i2b
istore 11
start local 11 36: iload 9
iload 11
aload 5
iconst_4
iload 10
iadd
baload
ixor
ior
istore 9
end local 11 37: iinc 10 1
StackMap locals:
StackMap stack:
38: iload 10
iconst_3
if_icmpne 35
end local 10 39: aload 5
invokestatic org.bouncycastle.util.Arrays.clear:([B)V
40: iload 9
ifeq 41
iconst_1
goto 42
StackMap locals:
StackMap stack:
41: iconst_0
StackMap locals:
StackMap stack: int
42: iload 7
ior
ifeq 44
43: new org.bouncycastle.crypto.InvalidCipherTextException
dup
ldc "wrapped key corrupted"
invokespecial org.bouncycastle.crypto.InvalidCipherTextException.<init>:(Ljava/lang/String;)V
athrow
44: StackMap locals:
StackMap stack:
aload 8
areturn
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 45 0 this Lorg/bouncycastle/crypto/engines/RFC3211WrapEngine;
0 45 1 in [B
0 45 2 inOff I
0 45 3 inLen I
3 45 4 blockSize I
6 45 5 cekBlock [B
7 45 6 iv [B
11 15 7 i I
20 24 7 i I
27 45 7 invalidLength Z
29 30 8 key [B
31 45 8 key [B
33 45 9 nonEqual I
34 39 10 i I
36 37 11 check B
Exceptions:
throws org.bouncycastle.crypto.InvalidCipherTextException
MethodParameters:
Name Flags
in
inOff
inLen
}
SourceFile: "RFC3211WrapEngine.java"