137 lines
8.9 KiB
C#
137 lines
8.9 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
|
|
{
|
|
// Token: 0x02001637 RID: 5687
|
|
[Token(Token = "0x2001637")]
|
|
[StructLayout(3)]
|
|
public class RsaKeyParameters : AsymmetricKeyParameter
|
|
{
|
|
// Token: 0x060097A9 RID: 38825 RVA: 0x00219BC4 File Offset: 0x00217DC4
|
|
[Token(Token = "0x60097A9")]
|
|
[Address(RVA = "0x1DDE5D0", Offset = "0x1DDCFD0", VA = "0x181DDE5D0")]
|
|
private static BigInteger Validate(BigInteger modulus)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060097A9)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.RsaKeyParameters::Validate(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_1F:
|
|
stloc:ArgumentException(var_2_2E, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("RSA modulus is even"), ldstr:string("modulus")))
|
|
}
|
|
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x060097AA RID: 38826 RVA: 0x00219C00 File Offset: 0x00217E00
|
|
[Token(Token = "0x60097AA")]
|
|
[Address(RVA = "0x1DDE780", Offset = "0x1DDD180", VA = "0x181DDE780")]
|
|
public RsaKeyParameters(bool isPrivate, BigInteger modulus, BigInteger exponent)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060097AA)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.RsaKeyParameters::.ctor(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_5F:
|
|
stloc:ArgumentException(var_3_6E, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("RSA publicExponent is even"), ldstr:string("exponent")))
|
|
stloc:ArgumentException(var_4_79, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("RSA modulus has a small prime factor")))
|
|
}
|
|
|
|
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 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x17001854 RID: 6228
|
|
// (get) Token: 0x060097AB RID: 38827 RVA: 0x00219C88 File Offset: 0x00217E88
|
|
[Token(Token = "0x17001854")]
|
|
public BigInteger Modulus
|
|
{
|
|
[Token(Token = "0x60097AB")]
|
|
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
|
|
get
|
|
{
|
|
return this.modulus;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001855 RID: 6229
|
|
// (get) Token: 0x060097AC RID: 38828 RVA: 0x00219C9C File Offset: 0x00217E9C
|
|
[Token(Token = "0x17001855")]
|
|
public BigInteger Exponent
|
|
{
|
|
[Token(Token = "0x60097AC")]
|
|
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
|
|
get
|
|
{
|
|
return this.exponent;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060097AD RID: 38829 RVA: 0x00219CB0 File Offset: 0x00217EB0
|
|
[Token(Token = "0x60097AD")]
|
|
[Address(RVA = "0x1DDE460", Offset = "0x1DDCE60", VA = "0x181DDE460", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj != 0 && obj != 0)
|
|
{
|
|
bool privateKey = this.privateKey;
|
|
if (privateKey)
|
|
{
|
|
return privateKey;
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060097AE RID: 38830 RVA: 0x00219CDC File Offset: 0x00217EDC
|
|
[Token(Token = "0x60097AE")]
|
|
[Address(RVA = "0x1DDE550", Offset = "0x1DDCF50", VA = "0x181DDE550", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
this.modulus.Finalize();
|
|
this.exponent.Finalize();
|
|
bool privateKey = this.privateKey;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x040063D1 RID: 25553
|
|
[Token(Token = "0x40063D1")]
|
|
private static BigInteger SmallPrimesProduct = new BigInteger("8138E8A0FCF3A4E84A771D40FD305D7F4AA59306D7251DE54D98AF8FE95729A1F73D893FA424CD2EDC8636A6C3285E022B0E3866A565AE8108EED8591CD4FE8D2CE86165A978D719EBF647F362D33FCA29CD179FB42401CBAF3DF0C614056F9C8F3CFD51E474AFB6BC6974F78DB8ABA8E9E517FDED658591AB7502BD41849462F", 16);
|
|
|
|
// Token: 0x040063D2 RID: 25554
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40063D2")]
|
|
private readonly BigInteger modulus;
|
|
|
|
// Token: 0x040063D3 RID: 25555
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40063D3")]
|
|
private readonly BigInteger exponent;
|
|
}
|
|
}
|