using System; using System.Collections; using System.IO; using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls { // Token: 0x02001B77 RID: 7031 [Token(Token = "0x2001B77")] public abstract class TlsEccUtilities { // Token: 0x0600AEB8 RID: 44728 RVA: 0x00260338 File Offset: 0x0025E538 [Token(Token = "0x600AEB8")] [Address(RVA = "0x1985ED0", Offset = "0x1984CD0", VA = "0x181985ED0")] public static void AddSupportedEllipticCurvesExtension(IDictionary extensions, int[] namedCurves) { while (namedCurves == 0) { } byte[] array = TlsUtilities.EncodeUint16ArrayWithUint16Length(namedCurves); } // Token: 0x0600AEB9 RID: 44729 RVA: 0x00260350 File Offset: 0x0025E550 [Token(Token = "0x600AEB9")] [Address(RVA = "0x1985FF0", Offset = "0x1984DF0", VA = "0x181985FF0")] public static void AddSupportedPointFormatsExtension(IDictionary extensions, byte[] ecPointFormats) { while (ecPointFormats != 0) { int num = 0; if (!Arrays.Contains(ecPointFormats, (byte)num)) { break; } } int num2 = 0; byte[] array = TlsUtilities.EncodeUint8ArrayWithUint8Length(Arrays.Append(ecPointFormats, (byte)num2)); } // Token: 0x0600AEBA RID: 44730 RVA: 0x00260384 File Offset: 0x0025E584 [Token(Token = "0x600AEBA")] [Address(RVA = "0x1987110", Offset = "0x1985F10", VA = "0x181987110")] public static int[] GetSupportedEllipticCurvesExtension(IDictionary extensions) { /* An exception occurred when decompiling this method (0600AEBA) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsEccUtilities::GetSupportedEllipticCurvesExtension(System.Collections.IDictionary) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_3F: stloc:TlsFatalAlert(var_6_46, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_7))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660 */; } // Token: 0x0600AEBB RID: 44731 RVA: 0x002603D8 File Offset: 0x0025E5D8 [Token(Token = "0x600AEBB")] [Address(RVA = "0x1987280", Offset = "0x1986080", VA = "0x181987280")] public static byte[] GetSupportedPointFormatsExtension(IDictionary extensions) { byte[] extensionData; for (;;) { extensionData = TlsUtilities.GetExtensionData(extensions, 11); if (extensionData == 0) { break; } byte[] array = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData); int num = 0; if (Arrays.Contains(array, (byte)num)) { return array; } } return extensionData; } // Token: 0x0600AEBC RID: 44732 RVA: 0x00260408 File Offset: 0x0025E608 [Token(Token = "0x600AEBC")] [Address(RVA = "0x1986380", Offset = "0x1985180", VA = "0x181986380")] public static byte[] CreateSupportedEllipticCurvesExtension(int[] namedCurves) { while (namedCurves == 0) { } return TlsUtilities.EncodeUint16ArrayWithUint16Length(namedCurves); } // Token: 0x0600AEBD RID: 44733 RVA: 0x00260420 File Offset: 0x0025E620 [Token(Token = "0x600AEBD")] [Address(RVA = "0x1986410", Offset = "0x1985210", VA = "0x181986410")] public static byte[] CreateSupportedPointFormatsExtension(byte[] ecPointFormats) { while (ecPointFormats != 0) { int num = 0; if (!Arrays.Contains(ecPointFormats, (byte)num)) { break; } } int num2 = 0; return TlsUtilities.EncodeUint8ArrayWithUint8Length(Arrays.Append(ecPointFormats, (byte)num2)); } // Token: 0x0600AEBE RID: 44734 RVA: 0x0026044C File Offset: 0x0025E64C [Token(Token = "0x600AEBE")] [Address(RVA = "0x1987D80", Offset = "0x1986B80", VA = "0x181987D80")] public static int[] ReadSupportedEllipticCurvesExtension(byte[] extensionData) { /* An exception occurred when decompiling this method (0600AEBE) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsEccUtilities::ReadSupportedEllipticCurvesExtension(System.Byte[]) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_3D: stloc:TlsFatalAlert(var_6_44, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_7))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660 */; } // Token: 0x0600AEBF RID: 44735 RVA: 0x002604A0 File Offset: 0x0025E6A0 [Token(Token = "0x600AEBF")] [Address(RVA = "0x1987EC0", Offset = "0x1986CC0", VA = "0x181987EC0")] public static byte[] ReadSupportedPointFormatsExtension(byte[] extensionData) { byte[] array; int num; do { array = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData); num = 0; } while (!Arrays.Contains(array, (byte)num)); return array; } // Token: 0x0600AEC0 RID: 44736 RVA: 0x002604C4 File Offset: 0x0025E6C4 [Token(Token = "0x600AEC0")] [Address(RVA = "0x1986E70", Offset = "0x1985C70", VA = "0x181986E70")] public static string GetNameOfNamedCurve(int namedCurve) { if (TlsEccUtilities.IsSupportedNamedCurve(namedCurve)) { int num = namedCurve - 1; } throw new IndexOutOfRangeException(); } // Token: 0x0600AEC1 RID: 44737 RVA: 0x002604E8 File Offset: 0x0025E6E8 [Token(Token = "0x600AEC1")] [Address(RVA = "0x1986F30", Offset = "0x1985D30", VA = "0x181986F30")] public static ECDomainParameters GetParametersForNamedCurve(int namedCurve) { if (TlsEccUtilities.IsSupportedNamedCurve(namedCurve)) { int num = namedCurve - 1; X9ECParameters x9ECParameters; X9ECParameters x9ECParameters2; if (x9ECParameters != 0 || x9ECParameters2 != 0) { ECCurve curve = x9ECParameters.curve; ECPoint g = x9ECParameters.G; BigInteger n = x9ECParameters.n; BigInteger h = x9ECParameters.h; byte[] seed = x9ECParameters.seed; return new ECDomainParameters(curve, g, n, h, seed); } } throw new IndexOutOfRangeException(); } // Token: 0x0600AEC2 RID: 44738 RVA: 0x00260548 File Offset: 0x0025E748 [Token(Token = "0x600AEC2")] [Address(RVA = "0x19873B0", Offset = "0x19861B0", VA = "0x1819873B0")] public static bool HasAnySupportedNamedCurves() { throw new NullReferenceException(); } // Token: 0x0600AEC3 RID: 44739 RVA: 0x0026055C File Offset: 0x0025E75C [Token(Token = "0x600AEC3")] [Address(RVA = "0x19862C0", Offset = "0x19850C0", VA = "0x1819862C0")] public static bool ContainsEccCipherSuites(int[] cipherSuites) { int num = 0; int length = cipherSuites.Length; if (num < length) { if (!TlsEccUtilities.IsEccCipherSuite(cipherSuites[num])) { num++; } return true; } throw new NullReferenceException(); } // Token: 0x0600AEC4 RID: 44740 RVA: 0x00260590 File Offset: 0x0025E790 [Token(Token = "0x600AEC4")] [Address(RVA = "0x1987480", Offset = "0x1986280", VA = "0x181987480")] public static bool IsEccCipherSuite(int cipherSuite) { if (cipherSuite > 49307 && cipherSuite > 52393) { if (cipherSuite != 52396) { } return true; } if (cipherSuite > 49211) { goto IL_22; } goto IL_22; IL_22:; } // Token: 0x0600AEC5 RID: 44741 RVA: 0x002605C0 File Offset: 0x0025E7C0 [Token(Token = "0x600AEC5")] [Address(RVA = "0x1986140", Offset = "0x1984F40", VA = "0x181986140")] public static bool AreOnSameCurve(ECDomainParameters a, ECDomainParameters b) { while (a != 0) { } } // Token: 0x0600AEC6 RID: 44742 RVA: 0x002605D4 File Offset: 0x0025E7D4 [Token(Token = "0x600AEC6")] [Address(RVA = "0x1987510", Offset = "0x1986310", VA = "0x181987510")] public static bool IsSupportedNamedCurve(int namedCurve) { return namedCurve <= "{il2cpp field on {'TlsEccUtilities' (constant value of type Mono.Cecil.TypeReference)}, offset 0x18}"; } // Token: 0x0600AEC7 RID: 44743 RVA: 0x002605F4 File Offset: 0x0025E7F4 [Token(Token = "0x600AEC7")] [Address(RVA = "0x1987420", Offset = "0x1986220", VA = "0x181987420")] public static bool IsCompressionPreferred(byte[] ecPointFormats, byte compressionFormat) { if (ecPointFormats != 0) { int length = ecPointFormats.Length; int num = 0; if (num < length) { byte b; if (b != compressionFormat) { num++; } return true; } } throw new IndexOutOfRangeException(); } // Token: 0x0600AEC8 RID: 44744 RVA: 0x00260624 File Offset: 0x0025E824 [Token(Token = "0x600AEC8")] [Address(RVA = "0x1987F80", Offset = "0x1986D80", VA = "0x181987F80")] public static byte[] SerializeECFieldElement(int fieldSize, BigInteger x) { return BigIntegers.AsUnsignedByteArray(fieldSize, x); } // Token: 0x0600AEC9 RID: 44745 RVA: 0x00260638 File Offset: 0x0025E838 [Token(Token = "0x600AEC9")] [Address(RVA = "0x1987FA0", Offset = "0x1986DA0", VA = "0x181987FA0")] public static byte[] SerializeECPoint(byte[] ecPointFormats, ECPoint point) { bool flag = point.SatisfiesOrder(); bool flag2; if (!flag2) { bool flag3; if (!flag3 || ecPointFormats == 0) { goto IL_43; } int length = ecPointFormats.Length; int num = 0; if (num >= length) { goto IL_43; } num++; } if (ecPointFormats != 0) { int length2 = ecPointFormats.Length; int num2 = 0; if (num2 < length2) { num2++; } } IL_43: bool flag4 = point.SatisfiesCurveEquation(); throw new NullReferenceException(); } // Token: 0x0600AECA RID: 44746 RVA: 0x00260698 File Offset: 0x0025E898 [Token(Token = "0x600AECA")] [Address(RVA = "0x1988110", Offset = "0x1986F10", VA = "0x181988110")] public static byte[] SerializeECPublicKey(byte[] ecPointFormats, ECPublicKeyParameters keyParameters) { ECPoint q = keyParameters.q; return TlsEccUtilities.SerializeECPoint(ecPointFormats, q); } // Token: 0x0600AECB RID: 44747 RVA: 0x002606BC File Offset: 0x0025E8BC [Token(Token = "0x600AECB")] [Address(RVA = "0x19864D0", Offset = "0x19852D0", VA = "0x1819864D0")] public static BigInteger DeserializeECFieldElement(int fieldSize, byte[] encoding) { return new BigInteger(1, encoding); } // Token: 0x0600AECC RID: 44748 RVA: 0x002606E0 File Offset: 0x0025E8E0 [Token(Token = "0x600AECC")] [Address(RVA = "0x1986580", Offset = "0x1985380", VA = "0x181986580")] public static ECPoint DeserializeECPoint(byte[] ecPointFormats, ECCurve curve, byte[] encoding) { /* An exception occurred when decompiling this method (0600AECC) ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECPoint BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsEccUtilities::DeserializeECPoint(System.Byte[],BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECCurve,System.Byte[]) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_4C: stloc:TlsFatalAlert(var_8_53, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_9))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660 */; } // Token: 0x0600AECD RID: 44749 RVA: 0x00260744 File Offset: 0x0025E944 [Token(Token = "0x600AECD")] [Address(RVA = "0x1986780", Offset = "0x1985580", VA = "0x181986780")] public static ECPublicKeyParameters DeserializeECPublicKey(byte[] ecPointFormats, ECDomainParameters curve_params, byte[] encoding) { ECCurve curve = curve_params.curve; return new ECPublicKeyParameters(TlsEccUtilities.DeserializeECPoint(ecPointFormats, curve, encoding), curve_params); } // Token: 0x0600AECE RID: 44750 RVA: 0x0026076C File Offset: 0x0025E96C [Token(Token = "0x600AECE")] [Address(RVA = "0x1986160", Offset = "0x1984F60", VA = "0x181986160")] public static byte[] CalculateECDHBasicAgreement(ECPublicKeyParameters publicKey, ECPrivateKeyParameters privateKey) { ECDHBasicAgreement ecdhbasicAgreement = new ECDHBasicAgreement(); BigInteger bigInteger = ecdhbasicAgreement.CalculateAgreement(privateKey); int fieldSize = ecdhbasicAgreement.GetFieldSize(); byte[] array; return array; } // Token: 0x0600AECF RID: 44751 RVA: 0x00260798 File Offset: 0x0025E998 [Token(Token = "0x600AECF")] [Address(RVA = "0x1986880", Offset = "0x1985680", VA = "0x181986880")] public static AsymmetricCipherKeyPair GenerateECKeyPair(SecureRandom random, ECDomainParameters ecParams) { ECKeyPairGenerator eckeyPairGenerator = new ECKeyPairGenerator(); ECKeyGenerationParameters eckeyGenerationParameters = new ECKeyGenerationParameters(ecParams, random); eckeyPairGenerator.Init(eckeyGenerationParameters); return eckeyPairGenerator.GenerateKeyPair(); } // Token: 0x0600AED0 RID: 44752 RVA: 0x002607C8 File Offset: 0x0025E9C8 [Token(Token = "0x600AED0")] [Address(RVA = "0x1986930", Offset = "0x1985730", VA = "0x181986930")] public static ECPrivateKeyParameters GenerateEphemeralClientKeyExchange(SecureRandom random, byte[] ecPointFormats, ECDomainParameters ecParams, Stream output) { for (;;) { ECKeyPairGenerator eckeyPairGenerator = new ECKeyPairGenerator(); ECKeyGenerationParameters eckeyGenerationParameters = new ECKeyGenerationParameters(ecParams, random); eckeyPairGenerator.Init(eckeyGenerationParameters); AsymmetricCipherKeyPair asymmetricCipherKeyPair = eckeyPairGenerator.GenerateKeyPair(); AsymmetricKeyParameter publicParameter = asymmetricCipherKeyPair.publicParameter; if (publicParameter != 0) { byte[] array; TlsUtilities.WriteOpaque8(array, output); AsymmetricKeyParameter privateParameter = asymmetricCipherKeyPair.privateParameter; if (privateParameter == 0 || privateParameter != 0) { break; } } } throw new NullReferenceException(); } // Token: 0x0600AED1 RID: 44753 RVA: 0x00260824 File Offset: 0x0025EA24 [Token(Token = "0x600AED1")] [Address(RVA = "0x1986B50", Offset = "0x1985950", VA = "0x181986B50")] internal static ECPrivateKeyParameters GenerateEphemeralServerKeyExchange(SecureRandom random, int[] namedCurves, byte[] ecPointFormats, Stream output) { ECDomainParameters parametersForNamedCurve; do { if (namedCurves != 0) { int num = 0; int num2 = 0; int length = namedCurves.Length; if (num2 < length) { int num3 = namedCurves[num]; if (!NamedCurve.IsValid(num3) || !TlsEccUtilities.IsSupportedNamedCurve(num3)) { num++; } } if (!Arrays.Contains(namedCurves, 65281) && !Arrays.Contains(namedCurves, 65282)) { continue; } } parametersForNamedCurve = TlsEccUtilities.GetParametersForNamedCurve(23); } while (parametersForNamedCurve == 0 || !NamedCurve.RefersToASpecificNamedCurve(23)); TlsUtilities.CheckUint16(23); TlsUtilities.WriteUint16(23, output); TlsEccUtilities.WriteExplicitECParameters(ecPointFormats, parametersForNamedCurve, output); return TlsEccUtilities.GenerateEphemeralClientKeyExchange(random, ecPointFormats, parametersForNamedCurve, output); } // Token: 0x0600AED2 RID: 44754 RVA: 0x002608B8 File Offset: 0x0025EAB8 [Token(Token = "0x600AED2")] [Address(RVA = "0x434BD0", Offset = "0x4339D0", VA = "0x180434BD0")] public static ECPublicKeyParameters ValidateECPublicKey(ECPublicKeyParameters key) { return key; } // Token: 0x0600AED3 RID: 44755 RVA: 0x002608C8 File Offset: 0x0025EAC8 [Token(Token = "0x600AED3")] [Address(RVA = "0x1987590", Offset = "0x1986390", VA = "0x181987590")] public static int ReadECExponent(int fieldSize, Stream input) { int intValue; for (;;) { BigInteger bigInteger = TlsEccUtilities.ReadECParameter(input); if (bigInteger.BitLength < 32) { intValue = bigInteger.IntValue; if (intValue > 0 && intValue < fieldSize) { break; } } } return intValue; } // Token: 0x0600AED4 RID: 44756 RVA: 0x002608F8 File Offset: 0x0025EAF8 [Token(Token = "0x600AED4")] [Address(RVA = "0x1987650", Offset = "0x1986450", VA = "0x181987650")] public static BigInteger ReadECFieldElement(int fieldSize, Stream input) { /* An exception occurred when decompiling this method (0600AED4) ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsEccUtilities::ReadECFieldElement(System.Int32,System.IO.Stream) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_24: stloc:TlsFatalAlert(var_2_2A, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](var_3))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660 */; } // Token: 0x0600AED5 RID: 44757 RVA: 0x00260930 File Offset: 0x0025EB30 [Token(Token = "0x600AED5")] [Address(RVA = "0x1987760", Offset = "0x1986560", VA = "0x181987760")] public static BigInteger ReadECParameter(Stream input) { byte[] array = TlsUtilities.ReadOpaque8(input); return new BigInteger(1, array); } // Token: 0x0600AED6 RID: 44758 RVA: 0x0026094C File Offset: 0x0025EB4C [Token(Token = "0x600AED6")] [Address(RVA = "0x19877F0", Offset = "0x19865F0", VA = "0x1819877F0")] public static ECDomainParameters ReadECParameters(int[] namedCurves, byte[] ecPointFormats, Stream input) { byte b = TlsUtilities.ReadUint8(input); int num = TlsUtilities.ReadUint16(input); if (NamedCurve.RefersToASpecificNamedCurve(num)) { TlsEccUtilities.CheckNamedCurve(namedCurves, num); ECDomainParameters parametersForNamedCurve = TlsEccUtilities.GetParametersForNamedCurve(num); uint num2; TlsEccUtilities.CheckNamedCurve(namedCurves, (int)num2); F2mCurve f2mCurve; ECPoint ecpoint; BigInteger bigInteger; BigInteger bigInteger2; ECDomainParameters ecdomainParameters = new ECDomainParameters(f2mCurve, ecpoint, bigInteger, bigInteger2); BigInteger bigInteger3; int bitLength = bigInteger3.BitLength; int bitLength2 = bigInteger3.BitLength; int num3 = 0; BigInteger bigInteger4; BigInteger bigInteger5; FpCurve fpCurve = new FpCurve(bigInteger3, num3, bigInteger, bigInteger4, bigInteger5); ECPoint ecpoint2; return new ECDomainParameters(fpCurve, ecpoint2, bigInteger4, bigInteger5); } ulong num4; TlsFatalAlert tlsFatalAlert = new TlsFatalAlert((byte)num4); ulong num5; TlsFatalAlert tlsFatalAlert2 = new TlsFatalAlert((byte)num5); throw new NullReferenceException(); } // Token: 0x0600AED7 RID: 44759 RVA: 0x002609F4 File Offset: 0x0025EBF4 [Token(Token = "0x600AED7")] [Address(RVA = "0x1986220", Offset = "0x1985020", VA = "0x181986220")] private static void CheckNamedCurve(int[] namedCurves, int namedCurve) { while (namedCurves != 0 && !Arrays.Contains(namedCurves, namedCurve)) { } } // Token: 0x0600AED8 RID: 44760 RVA: 0x00260A10 File Offset: 0x0025EC10 [Token(Token = "0x600AED8")] [Address(RVA = "0x1988180", Offset = "0x1986F80", VA = "0x181988180")] public static void WriteECExponent(int k, Stream output) { TlsUtilities.WriteOpaque8(BigIntegers.AsUnsignedByteArray(BigInteger.ValueOf((long)k)), output); } // Token: 0x0600AED9 RID: 44761 RVA: 0x00260A30 File Offset: 0x0025EC30 [Token(Token = "0x600AED9")] [Address(RVA = "0x1988310", Offset = "0x1987110", VA = "0x181988310")] public static void WriteECFieldElement(ECFieldElement x, Stream output) { } // Token: 0x0600AEDA RID: 44762 RVA: 0x00260A44 File Offset: 0x0025EC44 [Token(Token = "0x600AEDA")] [Address(RVA = "0x1988260", Offset = "0x1987060", VA = "0x181988260")] public static void WriteECFieldElement(int fieldSize, BigInteger x, Stream output) { byte[] array; TlsUtilities.WriteOpaque8(array, output); } // Token: 0x0600AEDB RID: 44763 RVA: 0x00260A58 File Offset: 0x0025EC58 [Token(Token = "0x600AEDB")] [Address(RVA = "0x19883A0", Offset = "0x19871A0", VA = "0x1819883A0")] public static void WriteECParameter(BigInteger x, Stream output) { TlsUtilities.WriteOpaque8(BigIntegers.AsUnsignedByteArray(x), output); } // Token: 0x0600AEDC RID: 44764 RVA: 0x00260A74 File Offset: 0x0025EC74 [Token(Token = "0x600AEDC")] [Address(RVA = "0x19884B0", Offset = "0x19872B0", VA = "0x1819884B0")] public static void WriteExplicitECParameters(byte[] ecPointFormats, ECDomainParameters ecParameters, Stream output) { /* An exception occurred when decompiling this method (0600AEDC) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.TlsEccUtilities::WriteExplicitECParameters(System.Byte[],BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.ECDomainParameters,System.IO.Stream) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_E8: stloc:ArgumentException(var_15_F2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Only trinomial and pentomial curves are supported"))) } at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88 --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1660 */; } // Token: 0x0600AEDD RID: 44765 RVA: 0x00260B74 File Offset: 0x0025ED74 [Token(Token = "0x600AEDD")] [Address(RVA = "0x1988410", Offset = "0x1987210", VA = "0x181988410")] public static void WriteECPoint(byte[] ecPointFormats, ECPoint point, Stream output) { TlsUtilities.WriteOpaque8(TlsEccUtilities.SerializeECPoint(ecPointFormats, point), output); } // Token: 0x0600AEDE RID: 44766 RVA: 0x00260B90 File Offset: 0x0025ED90 [Token(Token = "0x600AEDE")] [Address(RVA = "0x19889B0", Offset = "0x19877B0", VA = "0x1819889B0")] public static void WriteNamedECParameters(int namedCurve, Stream output) { while (!NamedCurve.RefersToASpecificNamedCurve(namedCurve)) { } TlsUtilities.CheckUint16(namedCurve); TlsUtilities.WriteUint16(namedCurve, output); } // Token: 0x0600AEDF RID: 44767 RVA: 0x00260BB4 File Offset: 0x0025EDB4 [Token(Token = "0x600AEDF")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] protected TlsEccUtilities() { } // Token: 0x0600AEE0 RID: 44768 RVA: 0x00260BC8 File Offset: 0x0025EDC8 // Note: this type is marked as 'beforefieldinit'. [Token(Token = "0x600AEE0")] [Address(RVA = "0x1988A60", Offset = "0x1987860", VA = "0x181988A60")] static TlsEccUtilities() { string[] array = new string[28]; if ("sect163k1" != 0) { } array[0] = "sect163k1"; if ("sect163r1" != 0) { } array[1] = "sect163r1"; if ("sect163r2" != 0) { } array[2] = "sect163r2"; if ("sect193r1" != 0) { } array[3] = "sect193r1"; if ("sect193r2" != 0) { } array[4] = "sect193r2"; if ("sect233k1" != 0) { } array[5] = "sect233k1"; if ("sect233r1" != 0) { } array[6] = "sect233r1"; if ("sect239k1" != 0) { } array[7] = "sect239k1"; if ("sect283k1" != 0) { } array[8] = "sect283k1"; if ("sect283r1" != 0) { } array[9] = "sect283r1"; if ("sect409k1" != 0) { } array[10] = "sect409k1"; if ("sect409r1" != 0) { } array[11] = "sect409r1"; if ("sect571k1" != 0) { } array[12] = "sect571k1"; if ("sect571r1" != 0) { } array[13] = "sect571r1"; if ("secp160k1" != 0) { } array[14] = "secp160k1"; if ("secp160r1" != 0) { } array[15] = "secp160r1"; if ("secp160r2" != 0) { } array[16] = "secp160r2"; if ("secp192k1" != 0) { } array[17] = "secp192k1"; if ("secp192r1" != 0) { } array[18] = "secp192r1"; if ("secp224k1" != 0) { } array[19] = "secp224k1"; if ("secp224r1" != 0) { } array[20] = "secp224r1"; if ("secp256k1" != 0) { } array[21] = "secp256k1"; if ("secp256r1" != 0) { } array[22] = "secp256r1"; if ("secp384r1" != 0) { } array[23] = "secp384r1"; if ("secp521r1" != 0) { } array[24] = "secp521r1"; if ("brainpoolP256r1" != 0) { } array[25] = "brainpoolP256r1"; if ("brainpoolP384r1" != 0) { } array[26] = "brainpoolP384r1"; if ("brainpoolP512r1" != 0) { } array[27] = "brainpoolP512r1"; } // Token: 0x0400701A RID: 28698 [Token(Token = "0x400701A")] private static readonly string[] CurveNames; } }