public class org.h2.security.SHA256
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.h2.security.SHA256
super_class: java.lang.Object
{
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 // org.h2.security.SHA256 this
0: .line 23
aload 0 /* this */
invokespecial java.lang.Object.<init>:()V
1: .line 24
return
end local 0 // org.h2.security.SHA256 this
LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/h2/security/SHA256;
public static byte[] getHashWithSalt(byte[], byte[]);
descriptor: ([B[B)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=3, args_size=2
start local 0 // byte[] data
start local 1 // byte[] salt
0: .line 38
aload 0 /* data */
arraylength
aload 1 /* salt */
arraylength
iadd
newarray 8
astore 2 /* buff */
start local 2 // byte[] buff
1: .line 39
aload 0 /* data */
iconst_0
aload 2 /* buff */
iconst_0
aload 0 /* data */
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
2: .line 40
aload 1 /* salt */
iconst_0
aload 2 /* buff */
aload 0 /* data */
arraylength
aload 1 /* salt */
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
3: .line 41
aload 2 /* buff */
iconst_1
invokestatic org.h2.security.SHA256.getHash:([BZ)[B
areturn
end local 2 // byte[] buff
end local 1 // byte[] salt
end local 0 // byte[] data
LocalVariableTable:
Start End Slot Name Signature
0 4 0 data [B
0 4 1 salt [B
1 4 2 buff [B
MethodParameters:
Name Flags
data
salt
public static byte[] getKeyPasswordHash(java.lang.String, char[]);
descriptor: (Ljava/lang/String;[C)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=9, args_size=2
start local 0 // java.lang.String userName
start local 1 // char[] password
0: .line 57
new java.lang.StringBuilder
dup
aload 0 /* userName */
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "@"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2 /* user */
start local 2 // java.lang.String user
1: .line 58
iconst_2
aload 2 /* user */
invokevirtual java.lang.String.length:()I
aload 1 /* password */
arraylength
iadd
imul
newarray 8
astore 3 /* buff */
start local 3 // byte[] buff
2: .line 59
iconst_0
istore 4 /* n */
start local 4 // int n
3: .line 60
iconst_0
istore 5 /* i */
start local 5 // int i
4: aload 2 /* user */
invokevirtual java.lang.String.length:()I
istore 6 /* length */
start local 6 // int length
5: goto 10
6: .line 61
StackMap locals: java.lang.String char[] java.lang.String byte[] int int int
StackMap stack:
aload 2 /* user */
iload 5 /* i */
invokevirtual java.lang.String.charAt:(I)C
istore 7 /* c */
start local 7 // char c
7: .line 62
aload 3 /* buff */
iload 4 /* n */
iinc 4 /* n */ 1
iload 7 /* c */
bipush 8
ishr
i2b
bastore
8: .line 63
aload 3 /* buff */
iload 4 /* n */
iinc 4 /* n */ 1
iload 7 /* c */
i2b
bastore
end local 7 // char c
9: .line 60
iinc 5 /* i */ 1
StackMap locals:
StackMap stack:
10: iload 5 /* i */
iload 6 /* length */
if_icmplt 6
end local 6 // int length
end local 5 // int i
11: .line 65
aload 1 /* password */
dup
astore 8
arraylength
istore 7
iconst_0
istore 6
goto 16
StackMap locals: java.lang.String char[] java.lang.String byte[] int top int int char[]
StackMap stack:
12: aload 8
iload 6
caload
istore 5 /* c */
start local 5 // char c
13: .line 66
aload 3 /* buff */
iload 4 /* n */
iinc 4 /* n */ 1
iload 5 /* c */
bipush 8
ishr
i2b
bastore
14: .line 67
aload 3 /* buff */
iload 4 /* n */
iinc 4 /* n */ 1
iload 5 /* c */
i2b
bastore
end local 5 // char c
15: .line 65
iinc 6 1
StackMap locals:
StackMap stack:
16: iload 6
iload 7
if_icmplt 12
17: .line 69
aload 1 /* password */
iconst_0
invokestatic java.util.Arrays.fill:([CC)V
18: .line 70
aload 3 /* buff */
iconst_1
invokestatic org.h2.security.SHA256.getHash:([BZ)[B
areturn
end local 4 // int n
end local 3 // byte[] buff
end local 2 // java.lang.String user
end local 1 // char[] password
end local 0 // java.lang.String userName
LocalVariableTable:
Start End Slot Name Signature
0 19 0 userName Ljava/lang/String;
0 19 1 password [C
1 19 2 user Ljava/lang/String;
2 19 3 buff [B
3 19 4 n I
4 11 5 i I
5 11 6 length I
7 9 7 c C
13 15 5 c C
MethodParameters:
Name Flags
userName
password
public static byte[] getHMAC(byte[], byte[]);
descriptor: ([B[B)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
start local 0 // byte[] key
start local 1 // byte[] message
0: .line 81
aload 0 /* key */
invokestatic org.h2.security.SHA256.initMac:([B)Ljavax/crypto/Mac;
aload 1 /* message */
invokevirtual javax.crypto.Mac.doFinal:([B)[B
areturn
end local 1 // byte[] message
end local 0 // byte[] key
LocalVariableTable:
Start End Slot Name Signature
0 1 0 key [B
0 1 1 message [B
MethodParameters:
Name Flags
key
message
private static javax.crypto.Mac initMac(byte[]);
descriptor: ([B)Ljavax/crypto/Mac;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=5, locals=2, args_size=1
start local 0 // byte[] key
0: .line 86
aload 0 /* key */
arraylength
ifne 2
1: .line 87
iconst_1
newarray 8
astore 0 /* key */
2: .line 90
StackMap locals:
StackMap stack:
ldc "HmacSHA256"
invokestatic javax.crypto.Mac.getInstance:(Ljava/lang/String;)Ljavax/crypto/Mac;
astore 1 /* mac */
start local 1 // javax.crypto.Mac mac
3: .line 91
aload 1 /* mac */
new javax.crypto.spec.SecretKeySpec
dup
aload 0 /* key */
ldc "HmacSHA256"
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BLjava/lang/String;)V
invokevirtual javax.crypto.Mac.init:(Ljava/security/Key;)V
4: .line 92
aload 1 /* mac */
5: areturn
end local 1 // javax.crypto.Mac mac
6: .line 93
StackMap locals:
StackMap stack: java.security.GeneralSecurityException
astore 1 /* e */
start local 1 // java.security.GeneralSecurityException e
7: .line 94
new java.lang.RuntimeException
dup
aload 1 /* e */
invokespecial java.lang.RuntimeException.<init>:(Ljava/lang/Throwable;)V
athrow
end local 1 // java.security.GeneralSecurityException e
end local 0 // byte[] key
LocalVariableTable:
Start End Slot Name Signature
0 8 0 key [B
3 6 1 mac Ljavax/crypto/Mac;
7 8 1 e Ljava/security/GeneralSecurityException;
Exception table:
from to target type
2 5 6 Class java.security.GeneralSecurityException
MethodParameters:
Name Flags
key
public static byte[] getPBKDF2(byte[], byte[], int, int);
descriptor: ([B[BII)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=13, args_size=4
start local 0 // byte[] password
start local 1 // byte[] salt
start local 2 // int iterations
start local 3 // int resultLen
0: .line 109
iload 3 /* resultLen */
newarray 8
astore 4 /* result */
start local 4 // byte[] result
1: .line 110
aload 0 /* password */
invokestatic org.h2.security.SHA256.initMac:([B)Ljavax/crypto/Mac;
astore 5 /* mac */
start local 5 // javax.crypto.Mac mac
2: .line 111
bipush 64
bipush 32
aload 1 /* salt */
arraylength
iconst_4
iadd
invokestatic java.lang.Math.max:(II)I
iadd
istore 6 /* len */
start local 6 // int len
3: .line 112
iload 6 /* len */
newarray 8
astore 7 /* message */
start local 7 // byte[] message
4: .line 113
aconst_null
astore 8 /* macRes */
start local 8 // byte[] macRes
5: .line 114
iconst_1
istore 9 /* k */
start local 9 // int k
6: iconst_0
istore 10 /* offset */
start local 10 // int offset
7: goto 27
8: .line 115
StackMap locals: byte[] byte[] int int byte[] javax.crypto.Mac int byte[] byte[] int int
StackMap stack:
iconst_0
istore 11 /* i */
start local 11 // int i
9: goto 25
10: .line 116
StackMap locals: int
StackMap stack:
iload 11 /* i */
ifne 15
11: .line 117
aload 1 /* salt */
iconst_0
aload 7 /* message */
iconst_0
aload 1 /* salt */
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
12: .line 118
aload 7 /* message */
aload 1 /* salt */
arraylength
iload 9 /* k */
invokestatic org.h2.util.Bits.writeInt:([BII)V
13: .line 119
aload 1 /* salt */
arraylength
iconst_4
iadd
istore 6 /* len */
14: .line 120
goto 17
15: .line 121
StackMap locals:
StackMap stack:
aload 8 /* macRes */
iconst_0
aload 7 /* message */
iconst_0
bipush 32
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
16: .line 122
bipush 32
istore 6 /* len */
17: .line 124
StackMap locals:
StackMap stack:
aload 5 /* mac */
aload 7 /* message */
iconst_0
iload 6 /* len */
invokevirtual javax.crypto.Mac.update:([BII)V
18: .line 125
aload 5 /* mac */
invokevirtual javax.crypto.Mac.doFinal:()[B
astore 8 /* macRes */
19: .line 126
iconst_0
istore 12 /* j */
start local 12 // int j
20: goto 23
21: .line 127
StackMap locals: int
StackMap stack:
aload 4 /* result */
iload 12 /* j */
iload 10 /* offset */
iadd
dup2
baload
aload 8 /* macRes */
iload 12 /* j */
baload
ixor
i2b
bastore
22: .line 126
iinc 12 /* j */ 1
StackMap locals:
StackMap stack:
23: iload 12 /* j */
bipush 32
if_icmpge 24
iload 12 /* j */
iload 10 /* offset */
iadd
iload 3 /* resultLen */
if_icmplt 21
end local 12 // int j
24: .line 115
StackMap locals:
StackMap stack:
iinc 11 /* i */ 1
StackMap locals:
StackMap stack:
25: iload 11 /* i */
iload 2 /* iterations */
if_icmplt 10
end local 11 // int i
26: .line 114
iinc 9 /* k */ 1
iinc 10 /* offset */ 32
StackMap locals:
StackMap stack:
27: iload 10 /* offset */
iload 3 /* resultLen */
if_icmplt 8
end local 10 // int offset
end local 9 // int k
28: .line 131
aload 0 /* password */
iconst_0
invokestatic java.util.Arrays.fill:([BB)V
29: .line 132
aload 4 /* result */
areturn
end local 8 // byte[] macRes
end local 7 // byte[] message
end local 6 // int len
end local 5 // javax.crypto.Mac mac
end local 4 // byte[] result
end local 3 // int resultLen
end local 2 // int iterations
end local 1 // byte[] salt
end local 0 // byte[] password
LocalVariableTable:
Start End Slot Name Signature
0 30 0 password [B
0 30 1 salt [B
0 30 2 iterations I
0 30 3 resultLen I
1 30 4 result [B
2 30 5 mac Ljavax/crypto/Mac;
3 30 6 len I
4 30 7 message [B
5 30 8 macRes [B
6 28 9 k I
7 28 10 offset I
9 26 11 i I
20 24 12 j I
MethodParameters:
Name Flags
password
salt
iterations
resultLen
public static byte[] getHash(byte[], boolean);
descriptor: ([BZ)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=4, args_size=2
start local 0 // byte[] data
start local 1 // boolean nullData
0: .line 146
ldc "SHA-256"
invokestatic java.security.MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
aload 0 /* data */
invokevirtual java.security.MessageDigest.digest:([B)[B
astore 2 /* result */
start local 2 // byte[] result
1: .line 147
goto 4
end local 2 // byte[] result
StackMap locals:
StackMap stack: java.security.NoSuchAlgorithmException
2: astore 3 /* e */
start local 3 // java.security.NoSuchAlgorithmException e
3: .line 148
new java.lang.RuntimeException
dup
aload 3 /* e */
invokespecial java.lang.RuntimeException.<init>:(Ljava/lang/Throwable;)V
athrow
end local 3 // java.security.NoSuchAlgorithmException e
start local 2 // byte[] result
4: .line 150
StackMap locals: byte[]
StackMap stack:
iload 1 /* nullData */
ifeq 6
5: .line 151
aload 0 /* data */
iconst_0
invokestatic java.util.Arrays.fill:([BB)V
6: .line 153
StackMap locals:
StackMap stack:
aload 2 /* result */
areturn
end local 2 // byte[] result
end local 1 // boolean nullData
end local 0 // byte[] data
LocalVariableTable:
Start End Slot Name Signature
0 7 0 data [B
0 7 1 nullData Z
1 2 2 result [B
4 7 2 result [B
3 4 3 e Ljava/security/NoSuchAlgorithmException;
Exception table:
from to target type
0 1 2 Class java.security.NoSuchAlgorithmException
MethodParameters:
Name Flags
data
nullData
}
SourceFile: "SHA256.java"