255 lines
9.3 KiB
C#
255 lines
9.3 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
|
|
{
|
|
// Token: 0x02001CBC RID: 7356
|
|
[Token(Token = "0x2001CBC")]
|
|
public class DHParameters : ICipherParameters
|
|
{
|
|
// Token: 0x0600B61C RID: 46620 RVA: 0x00276F44 File Offset: 0x00275144
|
|
[Token(Token = "0x600B61C")]
|
|
[Address(RVA = "0x22D0DE0", Offset = "0x22CFDE0", VA = "0x1822D0DE0")]
|
|
private static int GetDefaultMParam(int lParam)
|
|
{
|
|
if (lParam != 0)
|
|
{
|
|
return Math.Min(lParam, 160);
|
|
}
|
|
return 160;
|
|
}
|
|
|
|
// Token: 0x0600B61D RID: 46621 RVA: 0x00276F68 File Offset: 0x00275168
|
|
[Token(Token = "0x600B61D")]
|
|
[Address(RVA = "0x22D13C0", Offset = "0x22D03C0", VA = "0x1822D13C0")]
|
|
public DHParameters(BigInteger p, BigInteger g)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B61E RID: 46622 RVA: 0x00276F7C File Offset: 0x0027517C
|
|
[Token(Token = "0x600B61E")]
|
|
[Address(RVA = "0x22D1300", Offset = "0x22D0300", VA = "0x1822D1300")]
|
|
public DHParameters(BigInteger p, BigInteger g, BigInteger q)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B61F RID: 46623 RVA: 0x00276F8C File Offset: 0x0027518C
|
|
[Token(Token = "0x600B61F")]
|
|
[Address(RVA = "0x22D1440", Offset = "0x22D0440", VA = "0x1822D1440")]
|
|
public DHParameters(BigInteger p, BigInteger g, BigInteger q, int l)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B620 RID: 46624 RVA: 0x00276F9C File Offset: 0x0027519C
|
|
[Token(Token = "0x600B620")]
|
|
[Address(RVA = "0x22D12C0", Offset = "0x22D02C0", VA = "0x1822D12C0")]
|
|
public DHParameters(BigInteger p, BigInteger g, BigInteger q, int m, int l)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B621 RID: 46625 RVA: 0x00276FAC File Offset: 0x002751AC
|
|
[Token(Token = "0x600B621")]
|
|
[Address(RVA = "0x22D1380", Offset = "0x22D0380", VA = "0x1822D1380")]
|
|
public DHParameters(BigInteger p, BigInteger g, BigInteger q, BigInteger j, DHValidationParameters validation)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B622 RID: 46626 RVA: 0x00276FBC File Offset: 0x002751BC
|
|
[Token(Token = "0x600B622")]
|
|
[Address(RVA = "0x22D0ED0", Offset = "0x22CFED0", VA = "0x1822D0ED0")]
|
|
public DHParameters(BigInteger p, BigInteger g, BigInteger q, int m, int l, BigInteger j, DHValidationParameters validation)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B622)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DHParameters::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,System.Int32,System.Int32,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters.DHValidationParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_B3:
|
|
stloc:ArgumentException(var_13_C2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("q too big to be a factor of (p-1)"), ldstr:string("q")))
|
|
}
|
|
|
|
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: 0x17001C9B RID: 7323
|
|
// (get) Token: 0x0600B623 RID: 46627 RVA: 0x0027708C File Offset: 0x0027528C
|
|
[Token(Token = "0x17001C9B")]
|
|
public BigInteger P
|
|
{
|
|
[Token(Token = "0x600B623")]
|
|
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
|
|
get
|
|
{
|
|
return this.p;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9C RID: 7324
|
|
// (get) Token: 0x0600B624 RID: 46628 RVA: 0x002770A0 File Offset: 0x002752A0
|
|
[Token(Token = "0x17001C9C")]
|
|
public BigInteger G
|
|
{
|
|
[Token(Token = "0x600B624")]
|
|
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
|
|
get
|
|
{
|
|
return this.g;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9D RID: 7325
|
|
// (get) Token: 0x0600B625 RID: 46629 RVA: 0x002770B4 File Offset: 0x002752B4
|
|
[Token(Token = "0x17001C9D")]
|
|
public BigInteger Q
|
|
{
|
|
[Token(Token = "0x600B625")]
|
|
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
|
|
get
|
|
{
|
|
return this.q;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9E RID: 7326
|
|
// (get) Token: 0x0600B626 RID: 46630 RVA: 0x002770C8 File Offset: 0x002752C8
|
|
[Token(Token = "0x17001C9E")]
|
|
public BigInteger J
|
|
{
|
|
[Token(Token = "0x600B626")]
|
|
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
|
|
get
|
|
{
|
|
return this.j;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001C9F RID: 7327
|
|
// (get) Token: 0x0600B627 RID: 46631 RVA: 0x002770DC File Offset: 0x002752DC
|
|
[Token(Token = "0x17001C9F")]
|
|
public int M
|
|
{
|
|
[Token(Token = "0x600B627")]
|
|
[Address(RVA = "0x4257C0", Offset = "0x4247C0", VA = "0x1804257C0")]
|
|
get
|
|
{
|
|
return this.m;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001CA0 RID: 7328
|
|
// (get) Token: 0x0600B628 RID: 46632 RVA: 0x002770F0 File Offset: 0x002752F0
|
|
[Token(Token = "0x17001CA0")]
|
|
public int L
|
|
{
|
|
[Token(Token = "0x600B628")]
|
|
[Address(RVA = "0x4D9880", Offset = "0x4D8880", VA = "0x1804D9880")]
|
|
get
|
|
{
|
|
return this.l;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17001CA1 RID: 7329
|
|
// (get) Token: 0x0600B629 RID: 46633 RVA: 0x00277104 File Offset: 0x00275304
|
|
[Token(Token = "0x17001CA1")]
|
|
public DHValidationParameters ValidationParameters
|
|
{
|
|
[Token(Token = "0x600B629")]
|
|
[Address(RVA = "0x41CEF0", Offset = "0x41BEF0", VA = "0x18041CEF0")]
|
|
get
|
|
{
|
|
return this.validation;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B62A RID: 46634 RVA: 0x00277118 File Offset: 0x00275318
|
|
[Token(Token = "0x600B62A")]
|
|
[Address(RVA = "0x22D0D30", Offset = "0x22CFD30", VA = "0x1822D0D30", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj != this)
|
|
{
|
|
if (obj == 0 || obj != 0)
|
|
{
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x0600B62B RID: 46635 RVA: 0x00277138 File Offset: 0x00275338
|
|
[Token(Token = "0x600B62B")]
|
|
[Address(RVA = "0x22D0CA0", Offset = "0x22CFCA0", VA = "0x1822D0CA0", Slot = "4")]
|
|
protected virtual bool Equals(DHParameters other)
|
|
{
|
|
BigInteger bigInteger = this.p;
|
|
BigInteger bigInteger2 = this.g;
|
|
BigInteger bigInteger3 = other.q;
|
|
return object.Equals(this.q, bigInteger3);
|
|
}
|
|
|
|
// Token: 0x0600B62C RID: 46636 RVA: 0x00277170 File Offset: 0x00275370
|
|
[Token(Token = "0x600B62C")]
|
|
[Address(RVA = "0x22D0E50", Offset = "0x22CFE50", VA = "0x1822D0E50", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
this.p.Finalize();
|
|
this.g.Finalize();
|
|
BigInteger bigInteger = this.q;
|
|
if (bigInteger != 0)
|
|
{
|
|
bigInteger.Finalize();
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04007355 RID: 29525
|
|
[Token(Token = "0x4007355")]
|
|
private const int DefaultMinimumLength = 160;
|
|
|
|
// Token: 0x04007356 RID: 29526
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007356")]
|
|
private readonly BigInteger p;
|
|
|
|
// Token: 0x04007357 RID: 29527
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007357")]
|
|
private readonly BigInteger g;
|
|
|
|
// Token: 0x04007358 RID: 29528
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007358")]
|
|
private readonly BigInteger q;
|
|
|
|
// Token: 0x04007359 RID: 29529
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007359")]
|
|
private readonly BigInteger j;
|
|
|
|
// Token: 0x0400735A RID: 29530
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x400735A")]
|
|
private readonly int m;
|
|
|
|
// Token: 0x0400735B RID: 29531
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x400735B")]
|
|
private readonly int l;
|
|
|
|
// Token: 0x0400735C RID: 29532
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x400735C")]
|
|
private readonly DHValidationParameters validation;
|
|
}
|
|
}
|