public class org.apache.cassandra.security.EncryptionUtils
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.apache.cassandra.security.EncryptionUtils
super_class: java.lang.Object
{
public static final int COMPRESSED_BLOCK_HEADER_SIZE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 4
public static final int ENCRYPTED_BLOCK_HEADER_SIZE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 8
private static final io.netty.util.concurrent.FastThreadLocal<java.nio.ByteBuffer> reusableBuffers;
descriptor: Lio/netty/util/concurrent/FastThreadLocal;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Signature: Lio/netty/util/concurrent/FastThreadLocal<Ljava/nio/ByteBuffer;>;
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: new org.apache.cassandra.security.EncryptionUtils$1
dup
invokespecial org.apache.cassandra.security.EncryptionUtils$1.<init>:()V
putstatic org.apache.cassandra.security.EncryptionUtils.reusableBuffers:Lio/netty/util/concurrent/FastThreadLocal;
1: 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/apache/cassandra/security/EncryptionUtils;
public static java.nio.ByteBuffer compress(java.nio.ByteBuffer, java.nio.ByteBuffer, boolean, org.apache.cassandra.io.compress.ICompressor);
descriptor: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;ZLorg/apache/cassandra/io/compress/ICompressor;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=6, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokevirtual java.nio.ByteBuffer.remaining:()I
istore 4
start local 4 1: aload 3
iload 4
invokeinterface org.apache.cassandra.io.compress.ICompressor.initialCompressedBufferLength:(I)I
istore 5
start local 5 2: aload 1
iload 5
iconst_4
iadd
iload 2
invokestatic org.apache.cassandra.utils.ByteBufferUtil.ensureCapacity:(Ljava/nio/ByteBuffer;IZ)Ljava/nio/ByteBuffer;
astore 1
3: aload 1
iload 4
invokevirtual java.nio.ByteBuffer.putInt:(I)Ljava/nio/ByteBuffer;
pop
4: aload 3
aload 0
aload 1
invokeinterface org.apache.cassandra.io.compress.ICompressor.compress:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V
5: aload 1
invokevirtual java.nio.ByteBuffer.flip:()Ljava/nio/Buffer;
pop
6: aload 1
areturn
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 7 0 inputBuffer Ljava/nio/ByteBuffer;
0 7 1 outputBuffer Ljava/nio/ByteBuffer;
0 7 2 allowBufferResize Z
0 7 3 compressor Lorg/apache/cassandra/io/compress/ICompressor;
1 7 4 inputLength I
2 7 5 compressedLength I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
inputBuffer
outputBuffer
allowBufferResize
compressor
public static java.nio.ByteBuffer encryptAndWrite(java.nio.ByteBuffer, java.nio.channels.WritableByteChannel, boolean, javax.crypto.Cipher);
descriptor: (Ljava/nio/ByteBuffer;Ljava/nio/channels/WritableByteChannel;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=9, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokevirtual java.nio.ByteBuffer.remaining:()I
istore 4
start local 4 1: aload 3
iload 4
invokevirtual javax.crypto.Cipher.getOutputSize:(I)I
istore 5
start local 5 2: aload 0
invokevirtual java.nio.ByteBuffer.duplicate:()Ljava/nio/ByteBuffer;
astore 6
start local 6 3: aload 6
iload 5
iload 2
invokestatic org.apache.cassandra.utils.ByteBufferUtil.ensureCapacity:(Ljava/nio/ByteBuffer;IZ)Ljava/nio/ByteBuffer;
astore 6
4: bipush 8
invokestatic java.nio.ByteBuffer.allocate:(I)Ljava/nio/ByteBuffer;
astore 7
start local 7 5: aload 7
iconst_0
iload 5
invokevirtual java.nio.ByteBuffer.putInt:(II)Ljava/nio/ByteBuffer;
pop
6: aload 7
iconst_4
iload 4
invokevirtual java.nio.ByteBuffer.putInt:(II)Ljava/nio/ByteBuffer;
pop
7: aload 1
aload 7
invokeinterface java.nio.channels.WritableByteChannel.write:(Ljava/nio/ByteBuffer;)I
pop
8: aload 3
aload 0
aload 6
invokevirtual javax.crypto.Cipher.doFinal:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
pop
9: goto 12
10: StackMap locals: java.nio.ByteBuffer java.nio.channels.WritableByteChannel int javax.crypto.Cipher int int java.nio.ByteBuffer java.nio.ByteBuffer
StackMap stack: java.security.GeneralSecurityException
astore 8
start local 8 11: new java.io.IOException
dup
ldc "failed to encrypt commit log block"
aload 8
invokespecial java.io.IOException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 8 12: StackMap locals:
StackMap stack:
aload 6
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
iload 5
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
13: aload 1
aload 6
invokeinterface java.nio.channels.WritableByteChannel.write:(Ljava/nio/ByteBuffer;)I
pop
14: aload 6
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
iload 5
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
15: aload 6
areturn
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 16 0 inputBuffer Ljava/nio/ByteBuffer;
0 16 1 channel Ljava/nio/channels/WritableByteChannel;
0 16 2 allowBufferResize Z
0 16 3 cipher Ljavax/crypto/Cipher;
1 16 4 plainTextLength I
2 16 5 encryptLength I
3 16 6 outputBuffer Ljava/nio/ByteBuffer;
5 16 7 intBuf Ljava/nio/ByteBuffer;
11 12 8 e Ljava/security/GeneralSecurityException;
Exception table:
from to target type
8 9 10 Class javax.crypto.ShortBufferException
8 9 10 Class javax.crypto.IllegalBlockSizeException
8 9 10 Class javax.crypto.BadPaddingException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
inputBuffer
channel
allowBufferResize
cipher
public static java.nio.ByteBuffer encrypt(java.nio.ByteBuffer, java.nio.ByteBuffer, boolean, javax.crypto.Cipher);
descriptor: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 1
ldc "output buffer may not be null"
invokestatic com.google.common.base.Preconditions.checkNotNull:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
new org.apache.cassandra.security.EncryptionUtils$ChannelAdapter
dup
aload 1
invokespecial org.apache.cassandra.security.EncryptionUtils$ChannelAdapter.<init>:(Ljava/nio/ByteBuffer;)V
iload 2
aload 3
invokestatic org.apache.cassandra.security.EncryptionUtils.encryptAndWrite:(Ljava/nio/ByteBuffer;Ljava/nio/channels/WritableByteChannel;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 inputBuffer Ljava/nio/ByteBuffer;
0 2 1 outputBuffer Ljava/nio/ByteBuffer;
0 2 2 allowBufferResize Z
0 2 3 cipher Ljavax/crypto/Cipher;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
inputBuffer
outputBuffer
allowBufferResize
cipher
public static java.nio.ByteBuffer decrypt(java.nio.channels.ReadableByteChannel, java.nio.ByteBuffer, boolean, javax.crypto.Cipher);
descriptor: (Ljava/nio/channels/ReadableByteChannel;Ljava/nio/ByteBuffer;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=9, args_size=4
start local 0 start local 1 start local 2 start local 3 0: getstatic org.apache.cassandra.security.EncryptionUtils.reusableBuffers:Lio/netty/util/concurrent/FastThreadLocal;
invokevirtual io.netty.util.concurrent.FastThreadLocal.get:()Ljava/lang/Object;
checkcast java.nio.ByteBuffer
astore 4
start local 4 1: aload 4
invokevirtual java.nio.ByteBuffer.capacity:()I
bipush 8
if_icmpge 4
2: aload 4
bipush 8
iconst_1
invokestatic org.apache.cassandra.utils.ByteBufferUtil.ensureCapacity:(Ljava/nio/ByteBuffer;IZ)Ljava/nio/ByteBuffer;
astore 4
3: getstatic org.apache.cassandra.security.EncryptionUtils.reusableBuffers:Lio/netty/util/concurrent/FastThreadLocal;
aload 4
invokevirtual io.netty.util.concurrent.FastThreadLocal.set:(Ljava/lang/Object;)V
4: StackMap locals: java.nio.ByteBuffer
StackMap stack:
aload 4
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
bipush 8
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
5: aload 0
aload 4
invokeinterface java.nio.channels.ReadableByteChannel.read:(Ljava/nio/ByteBuffer;)I
pop
6: aload 4
invokevirtual java.nio.ByteBuffer.remaining:()I
bipush 8
if_icmpge 8
7: new java.lang.IllegalStateException
dup
ldc "could not read encrypted blocked metadata header"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals:
StackMap stack:
aload 4
invokevirtual java.nio.ByteBuffer.getInt:()I
istore 5
start local 5 9: aload 4
invokevirtual java.nio.ByteBuffer.getInt:()I
istore 6
start local 6 10: aload 1
iload 6
iload 5
invokestatic java.lang.Math.max:(II)I
iload 2
invokestatic org.apache.cassandra.utils.ByteBufferUtil.ensureCapacity:(Ljava/nio/ByteBuffer;IZ)Ljava/nio/ByteBuffer;
astore 1
11: aload 1
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
iload 5
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
12: aload 0
aload 1
invokeinterface java.nio.channels.ReadableByteChannel.read:(Ljava/nio/ByteBuffer;)I
pop
13: aload 1
invokevirtual java.nio.ByteBuffer.duplicate:()Ljava/nio/ByteBuffer;
astore 7
start local 7 14: aload 7
invokevirtual java.nio.ByteBuffer.clear:()Ljava/nio/Buffer;
pop
15: aload 3
aload 1
aload 7
invokevirtual javax.crypto.Cipher.doFinal:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
pop
16: goto 19
17: StackMap locals: java.nio.channels.ReadableByteChannel java.nio.ByteBuffer int javax.crypto.Cipher java.nio.ByteBuffer int int java.nio.ByteBuffer
StackMap stack: java.security.GeneralSecurityException
astore 8
start local 8 18: new java.io.IOException
dup
ldc "failed to decrypt commit log block"
aload 8
invokespecial java.io.IOException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 8 19: StackMap locals:
StackMap stack:
aload 7
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
iload 6
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
20: aload 7
areturn
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 21 0 channel Ljava/nio/channels/ReadableByteChannel;
0 21 1 outputBuffer Ljava/nio/ByteBuffer;
0 21 2 allowBufferResize Z
0 21 3 cipher Ljavax/crypto/Cipher;
1 21 4 metadataBuffer Ljava/nio/ByteBuffer;
9 21 5 encryptedLength I
10 21 6 plainTextLength I
14 21 7 dupe Ljava/nio/ByteBuffer;
18 19 8 e Ljava/security/GeneralSecurityException;
Exception table:
from to target type
15 16 17 Class javax.crypto.ShortBufferException
15 16 17 Class javax.crypto.IllegalBlockSizeException
15 16 17 Class javax.crypto.BadPaddingException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
channel
outputBuffer
allowBufferResize
cipher
public static java.nio.ByteBuffer decrypt(org.apache.cassandra.io.util.FileDataInput, java.nio.ByteBuffer, boolean, javax.crypto.Cipher);
descriptor: (Lorg/apache/cassandra/io/util/FileDataInput;Ljava/nio/ByteBuffer;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: new org.apache.cassandra.security.EncryptionUtils$DataInputReadChannel
dup
aload 0
invokespecial org.apache.cassandra.security.EncryptionUtils$DataInputReadChannel.<init>:(Lorg/apache/cassandra/io/util/FileDataInput;)V
aload 1
iload 2
aload 3
invokestatic org.apache.cassandra.security.EncryptionUtils.decrypt:(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/ByteBuffer;ZLjavax/crypto/Cipher;)Ljava/nio/ByteBuffer;
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 fileDataInput Lorg/apache/cassandra/io/util/FileDataInput;
0 1 1 outputBuffer Ljava/nio/ByteBuffer;
0 1 2 allowBufferResize Z
0 1 3 cipher Ljavax/crypto/Cipher;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
fileDataInput
outputBuffer
allowBufferResize
cipher
public static java.nio.ByteBuffer uncompress(java.nio.ByteBuffer, java.nio.ByteBuffer, boolean, org.apache.cassandra.io.compress.ICompressor);
descriptor: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;ZLorg/apache/cassandra/io/compress/ICompressor;)Ljava/nio/ByteBuffer;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=5, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokevirtual java.nio.ByteBuffer.getInt:()I
istore 4
start local 4 1: aload 1
iload 4
iload 2
invokestatic org.apache.cassandra.utils.ByteBufferUtil.ensureCapacity:(Ljava/nio/ByteBuffer;IZ)Ljava/nio/ByteBuffer;
astore 1
2: aload 3
aload 0
aload 1
invokeinterface org.apache.cassandra.io.compress.ICompressor.uncompress:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V
3: aload 1
iconst_0
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
iload 4
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
4: aload 1
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 inputBuffer Ljava/nio/ByteBuffer;
0 5 1 outputBuffer Ljava/nio/ByteBuffer;
0 5 2 allowBufferResize Z
0 5 3 compressor Lorg/apache/cassandra/io/compress/ICompressor;
1 5 4 outputLength I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
inputBuffer
outputBuffer
allowBufferResize
compressor
public static int uncompress(byte[], int, int, byte[], int, org.apache.cassandra.io.compress.ICompressor);
descriptor: ([BII[BILorg/apache/cassandra/io/compress/ICompressor;)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=6, locals=8, args_size=6
start local 0 start local 1 start local 2 start local 3 start local 4 start local 5 0: aload 0
iload 1
invokestatic org.apache.cassandra.security.EncryptionUtils.readInt:([BI)I
istore 6
start local 6 1: iinc 1 4
2: iinc 2 -4
3: aload 3
arraylength
iload 4
isub
iload 6
if_icmpge 8
4: ldc "buffer to uncompress into is not large enough; buf size = %d, buf offset = %d, target size = %s"
iconst_3
anewarray java.lang.Object
dup
iconst_0
5: aload 3
arraylength
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_1
iload 4
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
iload 6
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
6: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
astore 7
start local 7 7: new java.lang.IllegalStateException
dup
aload 7
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
end local 7 8: StackMap locals: int
StackMap stack:
aload 5
aload 0
iload 1
iload 2
aload 3
iload 4
invokeinterface org.apache.cassandra.io.compress.ICompressor.uncompress:([BII[BI)I
ireturn
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 9 0 input [B
0 9 1 inputOffset I
0 9 2 inputLength I
0 9 3 output [B
0 9 4 outputOffset I
0 9 5 compressor Lorg/apache/cassandra/io/compress/ICompressor;
1 9 6 outputLength I
7 8 7 msg Ljava/lang/String;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
input
inputOffset
inputLength
output
outputOffset
compressor
private static int readInt(byte[], int);
descriptor: ([BI)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 0
iload 1
iconst_3
iadd
baload
sipush 255
iand
1: aload 0
iload 1
iconst_2
iadd
baload
sipush 255
iand
bipush 8
ishl
2: ior
3: aload 0
iload 1
iconst_1
iadd
baload
sipush 255
iand
bipush 16
ishl
4: ior
5: aload 0
iload 1
baload
sipush 255
iand
bipush 24
ishl
6: ior
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 input [B
0 7 1 inputOffset I
MethodParameters:
Name Flags
input
inputOffset
}
SourceFile: "EncryptionUtils.java"
NestMembers:
org.apache.cassandra.security.EncryptionUtils$1 org.apache.cassandra.security.EncryptionUtils$ChannelAdapter org.apache.cassandra.security.EncryptionUtils$ChannelProxyReadChannel org.apache.cassandra.security.EncryptionUtils$DataInputReadChannel
InnerClasses:
org.apache.cassandra.security.EncryptionUtils$1
private final ChannelAdapter = org.apache.cassandra.security.EncryptionUtils$ChannelAdapter of org.apache.cassandra.security.EncryptionUtils
public ChannelProxyReadChannel = org.apache.cassandra.security.EncryptionUtils$ChannelProxyReadChannel of org.apache.cassandra.security.EncryptionUtils
private DataInputReadChannel = org.apache.cassandra.security.EncryptionUtils$DataInputReadChannel of org.apache.cassandra.security.EncryptionUtils