public class sun.security.ec.XDHKeyAgreement extends javax.crypto.KeyAgreementSpi
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: sun.security.ec.XDHKeyAgreement
super_class: javax.crypto.KeyAgreementSpi
{
private byte[] privateKey;
descriptor: [B
flags: (0x0002) ACC_PRIVATE
private byte[] secret;
descriptor: [B
flags: (0x0002) ACC_PRIVATE
private sun.security.ec.XECOperations ops;
descriptor: Lsun/security/ec/XECOperations;
flags: (0x0002) ACC_PRIVATE
private sun.security.ec.XECParameters lockedParams;
descriptor: Lsun/security/ec/XECParameters;
flags: (0x0002) ACC_PRIVATE
void <init>();
descriptor: ()V
flags: (0x0000)
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
invokespecial javax.crypto.KeyAgreementSpi.<init>:()V
1: aload 0
aconst_null
putfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lsun/security/ec/XDHKeyAgreement;
void <init>(java.security.spec.AlgorithmParameterSpec);
descriptor: (Ljava/security/spec/AlgorithmParameterSpec;)V
flags: (0x0000)
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial javax.crypto.KeyAgreementSpi.<init>:()V
1: aload 0
aconst_null
putfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
2: aload 0
invokedynamic apply()Ljava/util/function/Function;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
(Ljava/lang/Object;)Ljava/lang/Object;
java/security/ProviderException.<init>(Ljava/lang/String;)V (8)
(Ljava/lang/String;)Ljava/security/ProviderException;
aload 1
invokestatic sun.security.ec.XECParameters.get:(Ljava/util/function/Function;Ljava/security/spec/AlgorithmParameterSpec;)Lsun/security/ec/XECParameters;
putfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
3: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lsun/security/ec/XDHKeyAgreement;
0 4 1 paramSpec Ljava/security/spec/AlgorithmParameterSpec;
MethodParameters:
Name Flags
paramSpec
protected void engineInit(java.security.Key, java.security.SecureRandom);
descriptor: (Ljava/security/Key;Ljava/security/SecureRandom;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
invokevirtual sun.security.ec.XDHKeyAgreement.initImpl:(Ljava/security/Key;)V
1: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lsun/security/ec/XDHKeyAgreement;
0 2 1 key Ljava/security/Key;
0 2 2 random Ljava/security/SecureRandom;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
key
random
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=3, locals=5, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
aload 1
invokevirtual sun.security.ec.XDHKeyAgreement.initImpl:(Ljava/security/Key;)V
1: aload 2
ifnull 8
2: invokedynamic apply()Ljava/util/function/Function;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
(Ljava/lang/Object;)Ljava/lang/Object;
java/security/InvalidAlgorithmParameterException.<init>(Ljava/lang/String;)V (8)
(Ljava/lang/String;)Ljava/security/InvalidAlgorithmParameterException;
aload 2
3: invokestatic sun.security.ec.XECParameters.get:(Ljava/util/function/Function;Ljava/security/spec/AlgorithmParameterSpec;)Lsun/security/ec/XECParameters;
astore 4
start local 4 4: aload 4
aload 0
getfield sun.security.ec.XDHKeyAgreement.ops:Lsun/security/ec/XECOperations;
invokevirtual sun.security.ec.XECOperations.getParameters:()Lsun/security/ec/XECParameters;
invokevirtual sun.security.ec.XECParameters.oidEquals:(Lsun/security/ec/XECParameters;)Z
ifne 8
5: new java.security.InvalidKeyException
dup
6: ldc "Incorrect private key parameters"
7: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
end local 4 8: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lsun/security/ec/XDHKeyAgreement;
0 9 1 key Ljava/security/Key;
0 9 2 params Ljava/security/spec/AlgorithmParameterSpec;
0 9 3 random Ljava/security/SecureRandom;
4 8 4 xecParams Lsun/security/ec/XECParameters;
Exceptions:
throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
MethodParameters:
Name Flags
key
params final
random
private <T extends java.lang.Throwable> void checkLockedParams(java.util.function.Function<java.lang.String, T>, sun.security.ec.XECParameters) throws T;
descriptor: (Ljava/util/function/Function;Lsun/security/ec/XECParameters;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
ifnull 4
aload 0
getfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
aload 2
if_acmpeq 4
1: aload 1
new java.lang.StringBuilder
dup
ldc "Parameters must be "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
2: aload 0
getfield sun.security.ec.XDHKeyAgreement.lockedParams:Lsun/security/ec/XECParameters;
invokevirtual sun.security.ec.XECParameters.getName:()Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
3: invokeinterface java.util.function.Function.apply:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.lang.Throwable
athrow
4: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lsun/security/ec/XDHKeyAgreement;
0 5 1 exception Ljava/util/function/Function<Ljava/lang/String;TT;>;
0 5 2 params Lsun/security/ec/XECParameters;
Exceptions:
throws java.lang.Throwable
Signature: <T:Ljava/lang/Throwable;>(Ljava/util/function/Function<Ljava/lang/String;TT;>;Lsun/security/ec/XECParameters;)V^TT;
MethodParameters:
Name Flags
exception
params
private void initImpl(java.security.Key);
descriptor: (Ljava/security/Key;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=2
start local 0 start local 1 0: aload 1
instanceof java.security.interfaces.XECPrivateKey
ifne 4
1: new java.security.InvalidKeyException
dup
2: ldc "Unsupported key type"
3: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 1
checkcast java.security.interfaces.XECPrivateKey
astore 2
start local 2 5: invokedynamic apply()Ljava/util/function/Function;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
(Ljava/lang/Object;)Ljava/lang/Object;
java/security/InvalidKeyException.<init>(Ljava/lang/String;)V (8)
(Ljava/lang/String;)Ljava/security/InvalidKeyException;
aload 2
invokeinterface java.security.interfaces.XECPrivateKey.getParams:()Ljava/security/spec/AlgorithmParameterSpec;
6: invokestatic sun.security.ec.XECParameters.get:(Ljava/util/function/Function;Ljava/security/spec/AlgorithmParameterSpec;)Lsun/security/ec/XECParameters;
astore 3
start local 3 7: aload 0
invokedynamic apply()Ljava/util/function/Function;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
(Ljava/lang/Object;)Ljava/lang/Object;
java/security/InvalidKeyException.<init>(Ljava/lang/String;)V (8)
(Ljava/lang/String;)Ljava/security/InvalidKeyException;
aload 3
invokevirtual sun.security.ec.XDHKeyAgreement.checkLockedParams:(Ljava/util/function/Function;Lsun/security/ec/XECParameters;)V
8: aload 0
new sun.security.ec.XECOperations
dup
aload 3
invokespecial sun.security.ec.XECOperations.<init>:(Lsun/security/ec/XECParameters;)V
putfield sun.security.ec.XDHKeyAgreement.ops:Lsun/security/ec/XECOperations;
9: aload 0
aload 2
invokeinterface java.security.interfaces.XECPrivateKey.getScalar:()Ljava/util/Optional;
10: invokedynamic get()Ljava/util/function/Supplier;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
()Ljava/lang/Object;
sun/security/ec/XDHKeyAgreement.lambda$4()Ljava/security/InvalidKeyException; (6)
()Ljava/security/InvalidKeyException;
11: invokevirtual java.util.Optional.orElseThrow:(Ljava/util/function/Supplier;)Ljava/lang/Object;
checkcast byte[]
putfield sun.security.ec.XDHKeyAgreement.privateKey:[B
12: aload 0
aconst_null
putfield sun.security.ec.XDHKeyAgreement.secret:[B
13: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lsun/security/ec/XDHKeyAgreement;
0 14 1 key Ljava/security/Key;
5 14 2 privateKey Ljava/security/interfaces/XECPrivateKey;
7 14 3 xecParams Lsun/security/ec/XECParameters;
Exceptions:
throws java.security.InvalidKeyException
MethodParameters:
Name Flags
key
protected java.security.Key engineDoPhase(java.security.Key, boolean);
descriptor: (Ljava/security/Key;Z)Ljava/security/Key;
flags: (0x0004) ACC_PROTECTED
Code:
stack=3, locals=6, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield sun.security.ec.XDHKeyAgreement.privateKey:[B
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Not initialized"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.ec.XDHKeyAgreement.secret:[B
ifnull 4
3: new java.lang.IllegalStateException
dup
ldc "Phase already executed"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
iload 2
ifne 8
5: new java.lang.IllegalStateException
dup
6: ldc "Only two party agreement supported, lastPhase must be true"
7: invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals:
StackMap stack:
aload 1
instanceof java.security.interfaces.XECPublicKey
ifne 12
9: new java.security.InvalidKeyException
dup
10: ldc "Unsupported key type"
11: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
12: StackMap locals:
StackMap stack:
aload 1
checkcast java.security.interfaces.XECPublicKey
astore 3
start local 3 13: invokedynamic apply()Ljava/util/function/Function;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
(Ljava/lang/Object;)Ljava/lang/Object;
java/security/InvalidKeyException.<init>(Ljava/lang/String;)V (8)
(Ljava/lang/String;)Ljava/security/InvalidKeyException;
14: aload 3
invokeinterface java.security.interfaces.XECPublicKey.getParams:()Ljava/security/spec/AlgorithmParameterSpec;
15: invokestatic sun.security.ec.XECParameters.get:(Ljava/util/function/Function;Ljava/security/spec/AlgorithmParameterSpec;)Lsun/security/ec/XECParameters;
astore 4
start local 4 16: aload 0
getfield sun.security.ec.XDHKeyAgreement.ops:Lsun/security/ec/XECOperations;
invokevirtual sun.security.ec.XECOperations.getParameters:()Lsun/security/ec/XECParameters;
aload 4
invokevirtual sun.security.ec.XECParameters.oidEquals:(Lsun/security/ec/XECParameters;)Z
ifne 20
17: new java.security.InvalidKeyException
dup
18: ldc "Public key parameters are not compatible with private key."
19: invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
20: StackMap locals: java.security.interfaces.XECPublicKey sun.security.ec.XECParameters
StackMap stack:
aload 0
getfield sun.security.ec.XDHKeyAgreement.ops:Lsun/security/ec/XECOperations;
21: aload 0
getfield sun.security.ec.XDHKeyAgreement.privateKey:[B
22: aload 3
invokeinterface java.security.interfaces.XECPublicKey.getU:()Ljava/math/BigInteger;
23: invokevirtual sun.security.ec.XECOperations.encodedPointMultiply:([BLjava/math/BigInteger;)[B
astore 5
start local 5 24: aload 0
aload 5
invokevirtual sun.security.ec.XDHKeyAgreement.allZero:([B)Z
ifeq 26
25: new java.security.InvalidKeyException
dup
ldc "Point has small order"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
athrow
26: StackMap locals: byte[]
StackMap stack:
aload 0
aload 5
putfield sun.security.ec.XDHKeyAgreement.secret:[B
27: aconst_null
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 28 0 this Lsun/security/ec/XDHKeyAgreement;
0 28 1 key Ljava/security/Key;
0 28 2 lastPhase Z
13 28 3 publicKey Ljava/security/interfaces/XECPublicKey;
16 28 4 xecParams Lsun/security/ec/XECParameters;
24 28 5 computedSecret [B
Exceptions:
throws java.security.InvalidKeyException, java.lang.IllegalStateException
MethodParameters:
Name Flags
key
lastPhase
private boolean allZero(byte[]);
descriptor: ([B)Z
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: iconst_0
istore 2
start local 2 1: iconst_0
istore 3
start local 3 2: goto 5
3: StackMap locals: int int
StackMap stack:
iload 2
aload 1
iload 3
baload
ior
i2b
istore 2
4: iinc 3 1
StackMap locals:
StackMap stack:
5: iload 3
aload 1
arraylength
if_icmplt 3
end local 3 6: iload 2
ifne 7
iconst_1
ireturn
StackMap locals:
StackMap stack:
7: iconst_0
ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lsun/security/ec/XDHKeyAgreement;
0 8 1 arr [B
1 8 2 orValue B
2 6 3 i I
MethodParameters:
Name Flags
arr
protected byte[] engineGenerateSecret();
descriptor: ()[B
flags: (0x0004) ACC_PROTECTED
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
getfield sun.security.ec.XDHKeyAgreement.secret:[B
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Not initialized correctly"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.ec.XDHKeyAgreement.secret:[B
astore 1
start local 1 3: aload 0
aconst_null
putfield sun.security.ec.XDHKeyAgreement.secret:[B
4: aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lsun/security/ec/XDHKeyAgreement;
3 5 1 result [B
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 sun.security.ec.XDHKeyAgreement.secret:[B
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Not initialized correctly"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield sun.security.ec.XDHKeyAgreement.secret:[B
arraylength
istore 3
start local 3 3: iload 3
aload 1
arraylength
iload 2
isub
if_icmple 8
4: new javax.crypto.ShortBufferException
dup
new java.lang.StringBuilder
dup
ldc "Need "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 3
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
5: ldc " bytes, only "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 1
arraylength
iload 2
isub
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
6: ldc " available"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
7: invokespecial javax.crypto.ShortBufferException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals: int
StackMap stack:
aload 0
getfield sun.security.ec.XDHKeyAgreement.secret:[B
iconst_0
aload 1
iload 2
iload 3
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
9: aload 0
aconst_null
putfield sun.security.ec.XDHKeyAgreement.secret:[B
10: iload 3
ireturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lsun/security/ec/XDHKeyAgreement;
0 11 1 sharedSecret [B
0 11 2 offset I
3 11 3 secretLen I
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=4, locals=2, args_size=2
start local 0 start local 1 0: aload 1
ifnonnull 2
1: new java.security.NoSuchAlgorithmException
dup
ldc "Algorithm must not be null"
invokespecial java.security.NoSuchAlgorithmException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
ldc "TlsPremasterSecret"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 6
3: new java.security.NoSuchAlgorithmException
dup
4: ldc "Only supported for algorithm TlsPremasterSecret"
5: invokespecial java.security.NoSuchAlgorithmException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals:
StackMap stack:
new javax.crypto.spec.SecretKeySpec
dup
aload 0
invokevirtual sun.security.ec.XDHKeyAgreement.engineGenerateSecret:()[B
aload 1
invokespecial javax.crypto.spec.SecretKeySpec.<init>:([BLjava/lang/String;)V
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lsun/security/ec/XDHKeyAgreement;
0 7 1 algorithm Ljava/lang/String;
Exceptions:
throws java.lang.IllegalStateException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
MethodParameters:
Name Flags
algorithm
private static java.security.InvalidKeyException lambda$4();
descriptor: ()Ljava/security/InvalidKeyException;
flags: (0x100a) ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
Code:
stack=3, locals=0, args_size=0
0: new java.security.InvalidKeyException
dup
ldc "No private key value"
invokespecial java.security.InvalidKeyException.<init>:(Ljava/lang/String;)V
areturn
LocalVariableTable:
Start End Slot Name Signature
}
SourceFile: "XDHKeyAgreement.java"
NestMembers:
sun.security.ec.XDHKeyAgreement$X25519 sun.security.ec.XDHKeyAgreement$X448
InnerClasses:
public final Lookup = java.lang.invoke.MethodHandles$Lookup of java.lang.invoke.MethodHandles
X25519 = sun.security.ec.XDHKeyAgreement$X25519 of sun.security.ec.XDHKeyAgreement
X448 = sun.security.ec.XDHKeyAgreement$X448 of sun.security.ec.XDHKeyAgreement