226 lines
8.8 KiB
C#
226 lines
8.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
|
|
{
|
|
// Token: 0x02001638 RID: 5688
|
|
[Token(Token = "0x2001638")]
|
|
[StructLayout(3)]
|
|
public class RsaPrivateCrtKeyParameters : RsaKeyParameters
|
|
{
|
|
// Token: 0x060097B0 RID: 38832 RVA: 0x00219D2C File Offset: 0x00217F2C
|
|
[Token(Token = "0x60097B0")]
|
|
[Address(RVA = "0x1DDEE90", Offset = "0x1DDD890", VA = "0x181DDEE90")]
|
|
public RsaPrivateCrtKeyParameters(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger p, BigInteger q, BigInteger dP, BigInteger dQ, BigInteger qInv)
|
|
: base(true, modulus, privateExponent)
|
|
{
|
|
RsaPrivateCrtKeyParameters.ValidateValue(publicExponent, "publicExponent", "exponent");
|
|
this.q = 0;
|
|
this.dP = 0;
|
|
this.dQ = 0;
|
|
this.qInv = 0;
|
|
this.e = publicExponent;
|
|
this.p = 0;
|
|
}
|
|
|
|
// Token: 0x060097B1 RID: 38833 RVA: 0x00219D7C File Offset: 0x00217F7C
|
|
[Token(Token = "0x60097B1")]
|
|
[Address(RVA = "0x1DDF000", Offset = "0x1DDDA00", VA = "0x181DDF000")]
|
|
public RsaPrivateCrtKeyParameters(RsaPrivateKeyStructure rsaPrivateKey)
|
|
{
|
|
BigInteger prime = rsaPrivateKey.prime2;
|
|
BigInteger prime2 = rsaPrivateKey.prime1;
|
|
BigInteger publicExponent = rsaPrivateKey.publicExponent;
|
|
BigInteger coefficient = rsaPrivateKey.coefficient;
|
|
BigInteger modulus = rsaPrivateKey.modulus;
|
|
BigInteger exponent = rsaPrivateKey.exponent1;
|
|
BigInteger privateExponent = rsaPrivateKey.privateExponent;
|
|
BigInteger exponent2 = rsaPrivateKey.exponent2;
|
|
base..ctor(true, modulus, privateExponent);
|
|
RsaPrivateCrtKeyParameters.ValidateValue(publicExponent, "publicExponent", "exponent");
|
|
RsaPrivateCrtKeyParameters.ValidateValue(prime2, "p", "P value");
|
|
RsaPrivateCrtKeyParameters.ValidateValue(prime, "q", "Q value");
|
|
RsaPrivateCrtKeyParameters.ValidateValue(exponent, "dP", "DP value");
|
|
RsaPrivateCrtKeyParameters.ValidateValue(exponent2, "dQ", "DQ value");
|
|
RsaPrivateCrtKeyParameters.ValidateValue(coefficient, "qInv", "InverseQ value");
|
|
this.e = publicExponent;
|
|
this.p = prime2;
|
|
this.q = prime;
|
|
this.dP = exponent;
|
|
this.dQ = exponent2;
|
|
this.qInv = coefficient;
|
|
}
|
|
|
|
// Token: 0x17001856 RID: 6230
|
|
// (get) Token: 0x060097B2 RID: 38834 RVA: 0x00219E64 File Offset: 0x00218064
|
|
[Token(Token = "0x17001856")]
|
|
public BigInteger PublicExponent
|
|
{
|
|
[Token(Token = "0x60097B2")]
|
|
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
|
|
get
|
|
{
|
|
return this.e;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001857 RID: 6231
|
|
// (get) Token: 0x060097B3 RID: 38835 RVA: 0x00219E78 File Offset: 0x00218078
|
|
[Token(Token = "0x17001857")]
|
|
public BigInteger P
|
|
{
|
|
[Token(Token = "0x60097B3")]
|
|
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250")]
|
|
get
|
|
{
|
|
return this.p;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001858 RID: 6232
|
|
// (get) Token: 0x060097B4 RID: 38836 RVA: 0x00219E8C File Offset: 0x0021808C
|
|
[Token(Token = "0x17001858")]
|
|
public BigInteger Q
|
|
{
|
|
[Token(Token = "0x60097B4")]
|
|
[Address(RVA = "0x3EE8E0", Offset = "0x3ED2E0", VA = "0x1803EE8E0")]
|
|
get
|
|
{
|
|
return this.q;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001859 RID: 6233
|
|
// (get) Token: 0x060097B5 RID: 38837 RVA: 0x00219EA0 File Offset: 0x002180A0
|
|
[Token(Token = "0x17001859")]
|
|
public BigInteger DP
|
|
{
|
|
[Token(Token = "0x60097B5")]
|
|
[Address(RVA = "0x3D32F0", Offset = "0x3D1CF0", VA = "0x1803D32F0")]
|
|
get
|
|
{
|
|
return this.dP;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700185A RID: 6234
|
|
// (get) Token: 0x060097B6 RID: 38838 RVA: 0x00219EB4 File Offset: 0x002180B4
|
|
[Token(Token = "0x1700185A")]
|
|
public BigInteger DQ
|
|
{
|
|
[Token(Token = "0x60097B6")]
|
|
[Address(RVA = "0x3EDEA0", Offset = "0x3EC8A0", VA = "0x1803EDEA0")]
|
|
get
|
|
{
|
|
return this.dQ;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700185B RID: 6235
|
|
// (get) Token: 0x060097B7 RID: 38839 RVA: 0x00219EC8 File Offset: 0x002180C8
|
|
[Token(Token = "0x1700185B")]
|
|
public BigInteger QInv
|
|
{
|
|
[Token(Token = "0x60097B7")]
|
|
[Address(RVA = "0x462740", Offset = "0x461140", VA = "0x180462740")]
|
|
get
|
|
{
|
|
return this.qInv;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060097B8 RID: 38840 RVA: 0x00219EDC File Offset: 0x002180DC
|
|
[Token(Token = "0x60097B8")]
|
|
[Address(RVA = "0x1DDEA90", Offset = "0x1DDD490", VA = "0x181DDEA90", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj != this)
|
|
{
|
|
if (obj != 0)
|
|
{
|
|
int num = 0;
|
|
if (obj == 0 || num == 0 || num == 0 || num == 0 || num == 0 || num == 0 || num == 0 || num != 0)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x060097B9 RID: 38841 RVA: 0x00219F1C File Offset: 0x0021811C
|
|
[Token(Token = "0x60097B9")]
|
|
[Address(RVA = "0x1DDEC80", Offset = "0x1DDD680", VA = "0x181DDEC80", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
this.dP.Finalize();
|
|
this.dQ.Finalize();
|
|
this.exponent.Finalize();
|
|
this.modulus.Finalize();
|
|
this.p.Finalize();
|
|
this.q.Finalize();
|
|
this.e.Finalize();
|
|
this.qInv.Finalize();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060097BA RID: 38842 RVA: 0x00219F88 File Offset: 0x00218188
|
|
[Token(Token = "0x60097BA")]
|
|
[Address(RVA = "0x1DDEDD0", Offset = "0x1DDD7D0", VA = "0x181DDEDD0")]
|
|
private static void ValidateValue(BigInteger x, string name, string desc)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060097BA)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.RsaPrivateCrtKeyParameters::ValidateValue(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,System.String,System.String)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_20:
|
|
stloc:ArgumentNullException(var_1_26, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldloc:string(name)))
|
|
}
|
|
|
|
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: 0x040063D4 RID: 25556
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40063D4")]
|
|
private readonly BigInteger e;
|
|
|
|
// Token: 0x040063D5 RID: 25557
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40063D5")]
|
|
private readonly BigInteger p;
|
|
|
|
// Token: 0x040063D6 RID: 25558
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40063D6")]
|
|
private readonly BigInteger q;
|
|
|
|
// Token: 0x040063D7 RID: 25559
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40063D7")]
|
|
private readonly BigInteger dP;
|
|
|
|
// Token: 0x040063D8 RID: 25560
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x40063D8")]
|
|
private readonly BigInteger dQ;
|
|
|
|
// Token: 0x040063D9 RID: 25561
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x40063D9")]
|
|
private readonly BigInteger qInv;
|
|
}
|
|
}
|