This commit is contained in:
niko
2026-04-11 22:19:20 +02:00
parent 45b857ff11
commit 8fc35183db
17034 changed files with 2863552 additions and 0 deletions
@@ -0,0 +1,188 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA1 RID: 7073
[Token(Token = "0x2001BA1")]
public class DsaDigestSigner : ISigner
{
// Token: 0x0600B0BC RID: 45244 RVA: 0x00266408 File Offset: 0x00264608
[Token(Token = "0x600B0BC")]
[Address(RVA = "0x18924D0", Offset = "0x18912D0", VA = "0x1818924D0")]
public DsaDigestSigner(IDsa dsa, IDigest digest)
{
this.dsa = dsa;
this.digest = digest;
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
}
// Token: 0x0600B0BD RID: 45245 RVA: 0x00266434 File Offset: 0x00264634
[Token(Token = "0x600B0BD")]
[Address(RVA = "0x4A7B10", Offset = "0x4A6910", VA = "0x1804A7B10")]
public DsaDigestSigner(IDsaExt dsa, IDigest digest, IDsaEncoding encoding)
{
this.dsa = dsa;
this.digest = digest;
this.encoding = encoding;
}
// Token: 0x17001BD5 RID: 7125
// (get) Token: 0x0600B0BE RID: 45246 RVA: 0x0026645C File Offset: 0x0026465C
[Token(Token = "0x17001BD5")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0BE")]
[Address(RVA = "0x1892560", Offset = "0x1891360", VA = "0x181892560", Slot = "11")]
get
{
IDigest digest = this.digest;
IDsa dsa = this.dsa;
string text;
return text;
}
}
// Token: 0x0600B0BF RID: 45247 RVA: 0x00266480 File Offset: 0x00264680
[Token(Token = "0x600B0BF")]
[Address(RVA = "0x1891FD0", Offset = "0x1890DD0", VA = "0x181891FD0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B0BF)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.DsaDigestSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4C:
stloc:InvalidKeyException(var_8_56, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Signing Requires Private Key.")))
stloc:InvalidKeyException(var_9_62, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Verification Requires Public Key.")))
}
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: 0x0600B0C0 RID: 45248 RVA: 0x002664F0 File Offset: 0x002646F0
[Token(Token = "0x600B0C0")]
[Address(RVA = "0x18922A0", Offset = "0x18910A0", VA = "0x1818922A0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B0C1 RID: 45249 RVA: 0x0026650C File Offset: 0x0026470C
[Token(Token = "0x600B0C1")]
[Address(RVA = "0x1891CB0", Offset = "0x1890AB0", VA = "0x181891CB0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B0C2 RID: 45250 RVA: 0x00266528 File Offset: 0x00264728
[Token(Token = "0x600B0C2")]
[Address(RVA = "0x1891D30", Offset = "0x1890B30", VA = "0x181891D30", Slot = "15")]
public virtual byte[] GenerateSignature()
{
if (this.forSigning)
{
IDigest digest = this.digest;
byte[] array = new byte[0];
IDigest digest2 = this.digest;
IDsa dsa = this.dsa;
IDsaEncoding dsaEncoding = this.encoding;
this.Reset();
int length = array.Length;
byte b = array[0];
return array[1];
}
InvalidOperationException ex = new InvalidOperationException("DSADigestSigner not initialised for signature generation.");
throw new IndexOutOfRangeException();
}
// Token: 0x0600B0C3 RID: 45251 RVA: 0x002665B4 File Offset: 0x002647B4
[Token(Token = "0x600B0C3")]
[Address(RVA = "0x1892300", Offset = "0x1891100", VA = "0x181892300", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
if (!this.forSigning)
{
IDigest digest = this.digest;
byte[] array = new byte[0];
IDigest digest2 = this.digest;
IDsaEncoding dsaEncoding = this.encoding;
this.Reset();
IDsa dsa = this.dsa;
}
InvalidOperationException ex = new InvalidOperationException("DSADigestSigner not initialised for verification");
throw new IndexOutOfRangeException();
}
// Token: 0x0600B0C4 RID: 45252 RVA: 0x0026662C File Offset: 0x0026482C
[Token(Token = "0x600B0C4")]
[Address(RVA = "0x1892250", Offset = "0x1891050", VA = "0x181892250", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B0C5 RID: 45253 RVA: 0x00266648 File Offset: 0x00264848
[Token(Token = "0x600B0C5")]
[Address(RVA = "0x1891F10", Offset = "0x1890D10", VA = "0x181891F10", Slot = "18")]
protected virtual BigInteger GetOrder()
{
/*
An exception occurred when decompiling this method (0600B0C5)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.DsaDigestSigner::GetOrder()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:IDsa(var_0_06, ldfld:IDsa(DsaDigestSigner::dsa, ldloc:DsaDigestSigner(this)))
}
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: 0x04007098 RID: 28824
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007098")]
private readonly IDsa dsa;
// Token: 0x04007099 RID: 28825
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007099")]
private readonly IDigest digest;
// Token: 0x0400709A RID: 28826
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400709A")]
private readonly IDsaEncoding encoding;
// Token: 0x0400709B RID: 28827
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400709B")]
private bool forSigning;
}
}
@@ -0,0 +1,198 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA2 RID: 7074
[Token(Token = "0x2001BA2")]
public class DsaSigner : IDsaExt, IDsa
{
// Token: 0x0600B0C6 RID: 45254 RVA: 0x0026665C File Offset: 0x0026485C
[Token(Token = "0x600B0C6")]
[Address(RVA = "0x1892F40", Offset = "0x1891D40", VA = "0x181892F40")]
public DsaSigner()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
}
// Token: 0x0600B0C7 RID: 45255 RVA: 0x0026667C File Offset: 0x0026487C
[Token(Token = "0x600B0C7")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public DsaSigner(IDsaKCalculator kCalculator)
{
this.kCalculator = kCalculator;
}
// Token: 0x17001BD6 RID: 7126
// (get) Token: 0x0600B0C8 RID: 45256 RVA: 0x00266698 File Offset: 0x00264898
[Token(Token = "0x17001BD6")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0C8")]
[Address(RVA = "0x1892FA0", Offset = "0x1891DA0", VA = "0x181892FA0", Slot = "9")]
get
{
return "DSA";
}
}
// Token: 0x0600B0C9 RID: 45257 RVA: 0x002666AC File Offset: 0x002648AC
[Token(Token = "0x600B0C9")]
[Address(RVA = "0x1892A30", Offset = "0x1891830", VA = "0x181892A30", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B0C9)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.DsaSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_5E:
stloc:InvalidKeyException(var_9_68, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("DSA public key required for verification")))
}
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: 0x17001BD7 RID: 7127
// (get) Token: 0x0600B0CA RID: 45258 RVA: 0x00266724 File Offset: 0x00264924
[Token(Token = "0x17001BD7")]
public virtual BigInteger Order
{
[Token(Token = "0x600B0CA")]
[Address(RVA = "0x1892FD0", Offset = "0x1891DD0", VA = "0x181892FD0", Slot = "11")]
get
{
return this.key.parameters.q;
}
}
// Token: 0x0600B0CB RID: 45259 RVA: 0x00266748 File Offset: 0x00264948
[Token(Token = "0x600B0CB")]
[Address(RVA = "0x18926B0", Offset = "0x18914B0", VA = "0x1818926B0", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
DsaParameters parameters;
BigInteger q;
int num;
for (;;)
{
parameters = this.key.parameters;
q = parameters.q;
DsaKeyParameters dsaKeyParameters = this.key;
if (dsaKeyParameters != 0)
{
num = 0;
if (dsaKeyParameters != 0)
{
break;
}
}
}
IDsaKCalculator dsaKCalculator = this.kCalculator;
IDsaKCalculator dsaKCalculator2 = this.kCalculator;
if (num == 0)
{
SecureRandom secureRandom = this.random;
}
IDsaKCalculator dsaKCalculator3 = this.kCalculator;
BigInteger g = parameters.g;
BigInteger bigInteger2;
BigInteger bigInteger = bigInteger2.Mod(q);
BigInteger bigInteger4;
BigInteger bigInteger5;
BigInteger bigInteger3 = bigInteger4.Multiply(bigInteger5).Mod(q);
BigInteger[] array = new BigInteger[2];
if (bigInteger != 0)
{
}
array[0] = bigInteger;
if (bigInteger3 != 0)
{
}
array[1] = bigInteger3;
return array;
}
// Token: 0x0600B0CC RID: 45260 RVA: 0x002667F4 File Offset: 0x002649F4
[Token(Token = "0x600B0CC")]
[Address(RVA = "0x1892D10", Offset = "0x1891B10", VA = "0x181892D10", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
DsaParameters parameters = this.key.parameters;
BigInteger q = parameters.q;
if (r.sign > 0 && q.CompareTo(r) > 0 && s.sign > 0 && q.CompareTo(s) > 0)
{
BigInteger bigInteger = s.ModInverse(q);
BigInteger bigInteger3;
BigInteger bigInteger2 = bigInteger3.Mod(q);
BigInteger bigInteger4 = r.Multiply(bigInteger).Mod(q);
BigInteger g = parameters.g;
BigInteger p = parameters.p;
BigInteger bigInteger5 = g.ModPow(bigInteger2, p);
int nBitLength = bigInteger5.nBitLength;
BigInteger bigInteger7;
BigInteger bigInteger6 = bigInteger5.Multiply(bigInteger7).Mod(p).Mod(q);
}
throw new NullReferenceException();
}
// Token: 0x0600B0CD RID: 45261 RVA: 0x002668A4 File Offset: 0x00264AA4
[Token(Token = "0x600B0CD")]
[Address(RVA = "0x18925E0", Offset = "0x18913E0", VA = "0x1818925E0", Slot = "14")]
protected virtual BigInteger CalculateE(BigInteger n, byte[] message)
{
int num = 0;
int num2 = n.BitLength;
int length = message.Length;
num += num2;
num2 = Math.Min(length, num);
int num3;
BigInteger bigInteger = new BigInteger(1, message, num3, num2);
num3 = 0;
return bigInteger;
}
// Token: 0x0600B0CE RID: 45262 RVA: 0x002668E4 File Offset: 0x00264AE4
[Token(Token = "0x600B0CE")]
[Address(RVA = "0x18929C0", Offset = "0x18917C0", VA = "0x1818929C0", Slot = "15")]
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
{
do
{
if (!needed)
{
}
}
while (provided != 0);
return new SecureRandom();
}
// Token: 0x0400709C RID: 28828
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400709C")]
protected readonly IDsaKCalculator kCalculator;
// Token: 0x0400709D RID: 28829
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400709D")]
protected DsaKeyParameters key;
// Token: 0x0400709E RID: 28830
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400709E")]
protected SecureRandom random;
}
}
@@ -0,0 +1,276 @@
using System;
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.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA3 RID: 7075
[Token(Token = "0x2001BA3")]
public class ECDsaSigner : IDsaExt, IDsa
{
// Token: 0x0600B0CF RID: 45263 RVA: 0x00266900 File Offset: 0x00264B00
[Token(Token = "0x600B0CF")]
[Address(RVA = "0x1893E00", Offset = "0x1892C00", VA = "0x181893E00")]
public ECDsaSigner()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
}
// Token: 0x0600B0D0 RID: 45264 RVA: 0x00266920 File Offset: 0x00264B20
[Token(Token = "0x600B0D0")]
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
public ECDsaSigner(IDsaKCalculator kCalculator)
{
this.kCalculator = kCalculator;
}
// Token: 0x17001BD8 RID: 7128
// (get) Token: 0x0600B0D1 RID: 45265 RVA: 0x0026693C File Offset: 0x00264B3C
[Token(Token = "0x17001BD8")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0D1")]
[Address(RVA = "0x1893E60", Offset = "0x1892C60", VA = "0x181893E60", Slot = "9")]
get
{
return "ECDSA";
}
}
// Token: 0x0600B0D2 RID: 45266 RVA: 0x00266950 File Offset: 0x00264B50
[Token(Token = "0x600B0D2")]
[Address(RVA = "0x18936D0", Offset = "0x18924D0", VA = "0x1818936D0", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B0D2)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECDsaSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_75:
stloc:InvalidKeyException(var_11_7F, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("EC public key required for verification")))
}
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: 0x17001BD9 RID: 7129
// (get) Token: 0x0600B0D3 RID: 45267 RVA: 0x002669E0 File Offset: 0x00264BE0
[Token(Token = "0x17001BD9")]
public virtual BigInteger Order
{
[Token(Token = "0x600B0D3")]
[Address(RVA = "0x1893E90", Offset = "0x1892C90", VA = "0x181893E90", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B0D4 RID: 45268 RVA: 0x00266A04 File Offset: 0x00264C04
[Token(Token = "0x600B0D4")]
[Address(RVA = "0x1893110", Offset = "0x1891F10", VA = "0x181893110", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
BigInteger n;
ECKeyParameters eckeyParameters;
do
{
n = this.key.parameters.n;
eckeyParameters = this.key;
}
while (eckeyParameters == 0 || eckeyParameters == 0);
IDsaKCalculator dsaKCalculator = this.kCalculator;
IDsaKCalculator dsaKCalculator2 = this.kCalculator;
if (eckeyParameters == 0)
{
SecureRandom secureRandom = this.random;
}
int num = 0;
IDsaKCalculator dsaKCalculator3 = this.kCalculator;
if (num < dsaKCalculator2)
{
num += num;
num++;
}
uint num2;
if (num < (int)num2)
{
num += num;
num++;
}
char c;
string text = c.ToString();
BigInteger bigInteger;
while (bigInteger.sign == 0)
{
}
BigInteger bigInteger3;
BigInteger bigInteger4;
BigInteger bigInteger2 = bigInteger3.Multiply(bigInteger4).Mod(n);
while (bigInteger2.sign == 0)
{
}
return new BigInteger[] { bigInteger, bigInteger2 };
}
// Token: 0x0600B0D5 RID: 45269 RVA: 0x00266AD8 File Offset: 0x00264CD8
[Token(Token = "0x600B0D5")]
[Address(RVA = "0x18939B0", Offset = "0x18927B0", VA = "0x1818939B0", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
BigInteger n = this.key.parameters.n;
int num = r.CompareTo(n);
int num2 = s.CompareTo(n);
BigInteger bigInteger = s.ModInverse(n);
BigInteger bigInteger3;
BigInteger bigInteger2 = bigInteger3.Mod(n);
BigInteger bigInteger4 = r.Multiply(bigInteger);
int num3 = 0;
BigInteger bigInteger5 = bigInteger4.Mod(n);
ECPoint ecpoint = ECAlgorithms.SumOfTwoMultiplies(this.key.parameters.g, bigInteger2, num3, bigInteger5);
if (!ecpoint.IsInfinity)
{
bool flag = ecpoint.SatisfiesOrder();
if (flag && flag)
{
BigInteger eight = ECDsaSigner.Eight;
ECMultiplier ecmultiplier = this.CreateBasePointMultiplier();
if (ecmultiplier != 0 && ecmultiplier == 0)
{
ECFieldElement affineYCoord = ecpoint.AffineYCoord;
if (flag.GetTypeCode() != TypeCode.Empty)
{
int num4 = flag.CompareTo(r);
bool flag2;
if (!flag2)
{
BigInteger bigInteger6 = r.Add(n);
}
return true;
}
goto IL_DD;
}
}
bool flag3 = ecpoint.IsNormalized();
sbyte b;
string text = b.ToString();
}
IL_DD:
throw new NullReferenceException();
}
// Token: 0x0600B0D6 RID: 45270 RVA: 0x00266BC8 File Offset: 0x00264DC8
[Token(Token = "0x600B0D6")]
[Address(RVA = "0x1893000", Offset = "0x1891E00", VA = "0x181893000", Slot = "14")]
protected virtual BigInteger CalculateE(BigInteger n, byte[] message)
{
int num = message.Length;
BigInteger bigInteger = new BigInteger(1, message);
if (n.BitLength < num)
{
int bitLength = n.BitLength;
num -= bitLength;
BigInteger bigInteger2 = bigInteger.ShiftRight(num);
}
return bigInteger;
}
// Token: 0x0600B0D7 RID: 45271 RVA: 0x00266C08 File Offset: 0x00264E08
[Token(Token = "0x600B0D7")]
[Address(RVA = "0x18930C0", Offset = "0x1891EC0", VA = "0x1818930C0", Slot = "15")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B0D7)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier.ECMultiplier BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECDsaSigner::CreateBasePointMultiplier()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FixedPointCombMultiplier(var_0_05, newobj:FixedPointCombMultiplier(FixedPointCombMultiplier::.ctor))
}
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: 0x0600B0D8 RID: 45272 RVA: 0x00266C1C File Offset: 0x00264E1C
[Token(Token = "0x600B0D8")]
[Address(RVA = "0x18935B0", Offset = "0x18923B0", VA = "0x1818935B0", Slot = "16")]
protected virtual ECFieldElement GetDenominator(int coordinateSystem, ECPoint p)
{
if (coordinateSystem <= 6)
{
BigInteger bigInteger = p.YCoord.ToBigInteger();
bool flag = p.SatisfiesCurveEquation();
}
throw new NullReferenceException();
}
// Token: 0x0600B0D9 RID: 45273 RVA: 0x00266C48 File Offset: 0x00264E48
[Token(Token = "0x600B0D9")]
[Address(RVA = "0x1893660", Offset = "0x1892460", VA = "0x181893660", Slot = "17")]
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
{
do
{
if (!needed)
{
}
}
while (provided != 0);
return new SecureRandom();
}
// Token: 0x0600B0DA RID: 45274 RVA: 0x00266C64 File Offset: 0x00264E64
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B0DA")]
[Address(RVA = "0x1893DA0", Offset = "0x1892BA0", VA = "0x181893DA0")]
static ECDsaSigner()
{
BigInteger bigInteger;
ECDsaSigner.Eight = bigInteger;
}
// Token: 0x0400709F RID: 28831
[Token(Token = "0x400709F")]
private static readonly BigInteger Eight;
// Token: 0x040070A0 RID: 28832
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070A0")]
protected readonly IDsaKCalculator kCalculator;
// Token: 0x040070A1 RID: 28833
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070A1")]
protected ECKeyParameters key;
// Token: 0x040070A2 RID: 28834
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070A2")]
protected SecureRandom random;
}
}
@@ -0,0 +1,204 @@
using System;
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.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA4 RID: 7076
[Token(Token = "0x2001BA4")]
public class ECGost3410Signer : IDsaExt, IDsa
{
// Token: 0x17001BDA RID: 7130
// (get) Token: 0x0600B0DB RID: 45275 RVA: 0x00266C78 File Offset: 0x00264E78
[Token(Token = "0x17001BDA")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0DB")]
[Address(RVA = "0x18949E0", Offset = "0x18937E0", VA = "0x1818949E0", Slot = "9")]
get
{
return "ECGOST3410";
}
}
// Token: 0x0600B0DC RID: 45276 RVA: 0x00266C8C File Offset: 0x00264E8C
[Token(Token = "0x600B0DC")]
[Address(RVA = "0x1894370", Offset = "0x1893170", VA = "0x181894370", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B0DC)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECGost3410Signer::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_60:
stloc:InvalidKeyException(var_8_6A, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("EC public key required for verification")))
}
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: 0x17001BDB RID: 7131
// (get) Token: 0x0600B0DD RID: 45277 RVA: 0x00266D04 File Offset: 0x00264F04
[Token(Token = "0x17001BDB")]
public virtual BigInteger Order
{
[Token(Token = "0x600B0DD")]
[Address(RVA = "0x1894A10", Offset = "0x1893810", VA = "0x181894A10", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B0DE RID: 45278 RVA: 0x00266D28 File Offset: 0x00264F28
[Token(Token = "0x600B0DE")]
[Address(RVA = "0x1893F10", Offset = "0x1892D10", VA = "0x181893F10", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
BigInteger bigInteger;
ECKeyParameters eckeyParameters;
BigInteger n;
do
{
byte[] array = new byte[message.Length];
int num = 0;
int num2 = 0;
int num3 = array.Length;
if (num2 != num3)
{
num3 -= num;
num++;
}
bigInteger = new BigInteger(1, array);
eckeyParameters = this.key;
n = eckeyParameters.parameters.n;
}
while (eckeyParameters == 0 || eckeyParameters == 0);
int bitLength = n.BitLength;
BigInteger bigInteger2;
while (bigInteger2.sign == 0)
{
}
int num4 = 0;
if (num4 < message)
{
num4 += num4;
num4++;
}
char c;
string text = c.ToString();
BigInteger bigInteger3;
while (bigInteger3.sign == num4)
{
}
BigInteger bigInteger4 = bigInteger2.Multiply(bigInteger);
BigInteger bigInteger5 = bigInteger2.Multiply(bigInteger3);
BigInteger bigInteger6 = bigInteger4.Add(bigInteger5).Mod(n);
while (bigInteger6.sign == 0)
{
}
return new BigInteger[] { bigInteger3, bigInteger6 };
}
// Token: 0x0600B0DF RID: 45279 RVA: 0x00266E1C File Offset: 0x0026501C
[Token(Token = "0x600B0DF")]
[Address(RVA = "0x1894600", Offset = "0x1893400", VA = "0x181894600", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
ECKeyParameters eckeyParameters;
do
{
byte[] array = new byte[message.Length];
int num = 0;
int num2 = 0;
int num3 = array.Length;
if (num2 != num3)
{
num3 -= num;
num++;
}
BigInteger bigInteger = new BigInteger(1, array);
BigInteger n = this.key.parameters.n;
BigInteger one = BigInteger.One;
int num4 = r.CompareTo(one);
int num5 = r.CompareTo(n);
BigInteger one2 = BigInteger.One;
int num6 = s.CompareTo(one2);
int num7 = s.CompareTo(n);
BigInteger bigInteger2 = bigInteger.ModInverse(n);
BigInteger bigInteger3 = s.Multiply(bigInteger2).Mod(n);
BigInteger bigInteger4 = n.Subtract(r).Multiply(bigInteger2);
BigInteger bigInteger5 = bigInteger4.Mod(n);
eckeyParameters = this.key;
ECPoint g = eckeyParameters.parameters.g;
}
while (eckeyParameters == 0 || eckeyParameters == 0);
ECPoint ecpoint;
bool flag = ecpoint.IsNormalized();
bool flag2;
if (!flag2)
{
sbyte b;
string text = b.ToString();
}
throw new NullReferenceException();
}
// Token: 0x0600B0E0 RID: 45280 RVA: 0x00266F20 File Offset: 0x00265120
[Token(Token = "0x600B0E0")]
[Address(RVA = "0x1893EC0", Offset = "0x1892CC0", VA = "0x181893EC0", Slot = "14")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B0E0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier.ECMultiplier BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECGost3410Signer::CreateBasePointMultiplier()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FixedPointCombMultiplier(var_0_05, newobj:FixedPointCombMultiplier(FixedPointCombMultiplier::.ctor))
}
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: 0x0600B0E1 RID: 45281 RVA: 0x00266F34 File Offset: 0x00265134
[Token(Token = "0x600B0E1")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public ECGost3410Signer()
{
}
// Token: 0x040070A3 RID: 28835
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070A3")]
private ECKeyParameters key;
// Token: 0x040070A4 RID: 28836
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070A4")]
private SecureRandom random;
}
}
@@ -0,0 +1,139 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA5 RID: 7077
[Token(Token = "0x2001BA5")]
public class ECNRSigner : IDsaExt, IDsa
{
// Token: 0x17001BDC RID: 7132
// (get) Token: 0x0600B0E2 RID: 45282 RVA: 0x00266F48 File Offset: 0x00265148
[Token(Token = "0x17001BDC")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0E2")]
[Address(RVA = "0x18954E0", Offset = "0x18942E0", VA = "0x1818954E0", Slot = "9")]
get
{
return "ECNR";
}
}
// Token: 0x0600B0E3 RID: 45283 RVA: 0x00266F5C File Offset: 0x0026515C
[Token(Token = "0x600B0E3")]
[Address(RVA = "0x1894F10", Offset = "0x1893D10", VA = "0x181894F10", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B0E3)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECNRSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_67:
stloc:InvalidKeyException(var_8_71, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("EC public key required for verification")))
}
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: 0x17001BDD RID: 7133
// (get) Token: 0x0600B0E4 RID: 45284 RVA: 0x00266FDC File Offset: 0x002651DC
[Token(Token = "0x17001BDD")]
public virtual BigInteger Order
{
[Token(Token = "0x600B0E4")]
[Address(RVA = "0x1893E90", Offset = "0x1892C90", VA = "0x181893E90", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B0E5 RID: 45285 RVA: 0x00267000 File Offset: 0x00265200
[Token(Token = "0x600B0E5")]
[Address(RVA = "0x1894A40", Offset = "0x1893840", VA = "0x181894A40", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
/*
An exception occurred when decompiling this method (0600B0E5)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECNRSigner::GenerateSignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_D0:
stloc:InvalidOperationException(var_24_DA, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("not initialised for signing")))
}
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: 0x0600B0E6 RID: 45286 RVA: 0x002670E8 File Offset: 0x002652E8
[Token(Token = "0x600B0E6")]
[Address(RVA = "0x18951A0", Offset = "0x1893FA0", VA = "0x1818951A0", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
/*
An exception occurred when decompiling this method (0600B0E6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.ECNRSigner::VerifySignature(System.Byte[],BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_A4:
stloc:InvalidOperationException(var_19_AE, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("not initialised for verifying")))
}
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: 0x0600B0E7 RID: 45287 RVA: 0x002671A4 File Offset: 0x002653A4
[Token(Token = "0x600B0E7")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public ECNRSigner()
{
}
// Token: 0x040070A5 RID: 28837
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070A5")]
private bool forSigning;
// Token: 0x040070A6 RID: 28838
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070A6")]
private ECKeyParameters key;
// Token: 0x040070A7 RID: 28839
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070A7")]
private SecureRandom random;
}
}
@@ -0,0 +1,229 @@
using System;
using System.IO;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA6 RID: 7078
[Token(Token = "0x2001BA6")]
public class Ed25519Signer : ISigner
{
// Token: 0x0600B0E8 RID: 45288 RVA: 0x002671B8 File Offset: 0x002653B8
[Token(Token = "0x600B0E8")]
[Address(RVA = "0x1895780", Offset = "0x1894580", VA = "0x181895780")]
public Ed25519Signer()
{
Ed25519Signer.Buffer buffer = new Ed25519Signer.Buffer();
this.buffer = buffer;
base..ctor();
}
// Token: 0x17001BDE RID: 7134
// (get) Token: 0x0600B0E9 RID: 45289 RVA: 0x002671D8 File Offset: 0x002653D8
[Token(Token = "0x17001BDE")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0E9")]
[Address(RVA = "0x18957E0", Offset = "0x18945E0", VA = "0x1818957E0", Slot = "11")]
get
{
return "Ed25519";
}
}
// Token: 0x0600B0EA RID: 45290 RVA: 0x002671EC File Offset: 0x002653EC
[Token(Token = "0x600B0EA")]
[Address(RVA = "0x18955D0", Offset = "0x18943D0", VA = "0x1818955D0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
int num;
do
{
this.forSigning = forSigning;
num = 0;
if (!forSigning)
{
this.privateKey = num;
if (parameters == 0)
{
goto IL_2B;
}
if (parameters == 0)
{
continue;
}
}
}
while (parameters != 0 && parameters == 0);
this.privateKey = num;
IL_2B:
Ed25519PublicKeyParameters ed25519PublicKeyParameters;
this.publicKey = ed25519PublicKeyParameters;
string algorithmName = ((ISigner)this).AlgorithmName;
}
// Token: 0x0600B0EB RID: 45291 RVA: 0x00267234 File Offset: 0x00265434
[Token(Token = "0x600B0EB")]
[Address(RVA = "0x18956C0", Offset = "0x18944C0", VA = "0x1818956C0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B0EC RID: 45292 RVA: 0x00267254 File Offset: 0x00265454
[Token(Token = "0x600B0EC")]
[Address(RVA = "0x1895510", Offset = "0x1894310", VA = "0x181895510", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B0ED RID: 45293 RVA: 0x00267278 File Offset: 0x00265478
[Token(Token = "0x600B0ED")]
[Address(RVA = "0x1895540", Offset = "0x1894340", VA = "0x181895540", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B0ED)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519Signer::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2B:
stloc:InvalidOperationException(var_3_35, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed25519Signer not initialised for signature generation.")))
}
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: 0x0600B0EE RID: 45294 RVA: 0x002672BC File Offset: 0x002654BC
[Token(Token = "0x600B0EE")]
[Address(RVA = "0x18956F0", Offset = "0x18944F0", VA = "0x1818956F0", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B0EE)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519Signer::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_22:
stloc:InvalidOperationException(var_1_2C, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed25519Signer not initialised for verification")))
}
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: 0x0600B0EF RID: 45295 RVA: 0x002672F8 File Offset: 0x002654F8
[Token(Token = "0x600B0EF")]
[Address(RVA = "0x18956A0", Offset = "0x18944A0", VA = "0x1818956A0", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x040070A8 RID: 28840
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070A8")]
private readonly Ed25519Signer.Buffer buffer;
// Token: 0x040070A9 RID: 28841
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070A9")]
private bool forSigning;
// Token: 0x040070AA RID: 28842
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070AA")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x040070AB RID: 28843
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070AB")]
private Ed25519PublicKeyParameters publicKey;
// Token: 0x02001BA7 RID: 7079
[Token(Token = "0x2001BA7")]
private class Buffer : MemoryStream
{
// Token: 0x0600B0F0 RID: 45296 RVA: 0x00267318 File Offset: 0x00265518
[Token(Token = "0x600B0F0")]
[Address(RVA = "0x18907B0", Offset = "0x188F5B0", VA = "0x1818907B0")]
internal byte[] GenerateSignature(Ed25519PrivateKeyParameters privateKey, Ed25519PublicKeyParameters publicKey)
{
int num;
byte[] array;
do
{
num = 0;
long length = this.Length;
array = new byte[Ed25519PrivateKeyParameters.SignatureSize];
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
return array;
}
// Token: 0x0600B0F1 RID: 45297 RVA: 0x00267350 File Offset: 0x00265550
[Token(Token = "0x600B0F1")]
[Address(RVA = "0x1890EC0", Offset = "0x188FCC0", VA = "0x181890EC0")]
internal bool VerifySignature(Ed25519PublicKeyParameters publicKey, byte[] signature)
{
int num;
do
{
num = 0;
long length = this.Length;
byte[] encoded = publicKey.GetEncoded();
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
bool flag;
return flag;
}
// Token: 0x0600B0F2 RID: 45298 RVA: 0x00267384 File Offset: 0x00265584
[Token(Token = "0x600B0F2")]
[Address(RVA = "0x1890C80", Offset = "0x188FA80", VA = "0x181890C80")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B0F3 RID: 45299 RVA: 0x002673AC File Offset: 0x002655AC
[Token(Token = "0x600B0F3")]
[Address(RVA = "0x18911A0", Offset = "0x188FFA0", VA = "0x1818911A0")]
public Buffer()
{
}
}
}
}
@@ -0,0 +1,241 @@
using System;
using System.IO;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BA8 RID: 7080
[Token(Token = "0x2001BA8")]
public class Ed25519ctxSigner : ISigner
{
// Token: 0x0600B0F4 RID: 45300 RVA: 0x002673C0 File Offset: 0x002655C0
[Token(Token = "0x600B0F4")]
[Address(RVA = "0x1895A30", Offset = "0x1894830", VA = "0x181895A30")]
public Ed25519ctxSigner(byte[] context)
{
Ed25519ctxSigner.Buffer buffer = new Ed25519ctxSigner.Buffer();
this.buffer = buffer;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001BDF RID: 7135
// (get) Token: 0x0600B0F5 RID: 45301 RVA: 0x002673F0 File Offset: 0x002655F0
[Token(Token = "0x17001BDF")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B0F5")]
[Address(RVA = "0x1895AD0", Offset = "0x18948D0", VA = "0x181895AD0", Slot = "11")]
get
{
return "Ed25519ctx";
}
}
// Token: 0x0600B0F6 RID: 45302 RVA: 0x00267404 File Offset: 0x00265604
[Token(Token = "0x600B0F6")]
[Address(RVA = "0x18958A0", Offset = "0x18946A0", VA = "0x1818958A0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
int num;
do
{
this.forSigning = forSigning;
num = 0;
if (!forSigning)
{
this.privateKey = num;
if (parameters == 0)
{
goto IL_2B;
}
if (parameters == 0)
{
continue;
}
}
}
while (parameters != 0 && parameters == 0);
this.privateKey = num;
IL_2B:
Ed25519PublicKeyParameters ed25519PublicKeyParameters;
this.publicKey = ed25519PublicKeyParameters;
string algorithmName = ((ISigner)this).AlgorithmName;
}
// Token: 0x0600B0F7 RID: 45303 RVA: 0x0026744C File Offset: 0x0026564C
[Token(Token = "0x600B0F7")]
[Address(RVA = "0x18956C0", Offset = "0x18944C0", VA = "0x1818956C0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B0F8 RID: 45304 RVA: 0x0026746C File Offset: 0x0026566C
[Token(Token = "0x600B0F8")]
[Address(RVA = "0x1895510", Offset = "0x1894310", VA = "0x181895510", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B0F9 RID: 45305 RVA: 0x00267490 File Offset: 0x00265690
[Token(Token = "0x600B0F9")]
[Address(RVA = "0x1895810", Offset = "0x1894610", VA = "0x181895810", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B0F9)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519ctxSigner::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_33:
stloc:InvalidOperationException(var_5_3D, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed25519ctxSigner not initialised for signature generation.")))
}
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: 0x0600B0FA RID: 45306 RVA: 0x002674DC File Offset: 0x002656DC
[Token(Token = "0x600B0FA")]
[Address(RVA = "0x1895990", Offset = "0x1894790", VA = "0x181895990", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B0FA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519ctxSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2C:
stloc:InvalidOperationException(var_4_36, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed25519ctxSigner not initialised for verification")))
}
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: 0x0600B0FB RID: 45307 RVA: 0x00267520 File Offset: 0x00265720
[Token(Token = "0x600B0FB")]
[Address(RVA = "0x1895970", Offset = "0x1894770", VA = "0x181895970", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x040070AC RID: 28844
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070AC")]
private readonly Ed25519ctxSigner.Buffer buffer;
// Token: 0x040070AD RID: 28845
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070AD")]
private readonly byte[] context;
// Token: 0x040070AE RID: 28846
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070AE")]
private bool forSigning;
// Token: 0x040070AF RID: 28847
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070AF")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x040070B0 RID: 28848
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070B0")]
private Ed25519PublicKeyParameters publicKey;
// Token: 0x02001BA9 RID: 7081
[Token(Token = "0x2001BA9")]
private class Buffer : MemoryStream
{
// Token: 0x0600B0FC RID: 45308 RVA: 0x00267540 File Offset: 0x00265740
[Token(Token = "0x600B0FC")]
[Address(RVA = "0x1890940", Offset = "0x188F740", VA = "0x181890940")]
internal byte[] GenerateSignature(Ed25519PrivateKeyParameters privateKey, Ed25519PublicKeyParameters publicKey, byte[] ctx)
{
int num;
byte[] array;
do
{
num = 0;
long length = this.Length;
array = new byte[Ed25519PrivateKeyParameters.SignatureSize];
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
return array;
}
// Token: 0x0600B0FD RID: 45309 RVA: 0x00267578 File Offset: 0x00265778
[Token(Token = "0x600B0FD")]
[Address(RVA = "0x1890D50", Offset = "0x188FB50", VA = "0x181890D50")]
internal bool VerifySignature(Ed25519PublicKeyParameters publicKey, byte[] ctx, byte[] signature)
{
int num;
bool flag;
do
{
num = 0;
long length = this.Length;
byte[] encoded = publicKey.GetEncoded();
int num2 = 0;
int num3 = 0;
flag = Ed25519.Verify(signature, num3, encoded, num2, ctx, encoded, num, (int)length);
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
return flag;
}
// Token: 0x0600B0FE RID: 45310 RVA: 0x002675C4 File Offset: 0x002657C4
[Token(Token = "0x600B0FE")]
[Address(RVA = "0x1890BB0", Offset = "0x188F9B0", VA = "0x181890BB0")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B0FF RID: 45311 RVA: 0x002675EC File Offset: 0x002657EC
[Token(Token = "0x600B0FF")]
[Address(RVA = "0x18911A0", Offset = "0x188FFA0", VA = "0x1818911A0")]
public Buffer()
{
}
}
}
}
@@ -0,0 +1,168 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BAA RID: 7082
[Token(Token = "0x2001BAA")]
public class Ed25519phSigner : ISigner
{
// Token: 0x0600B100 RID: 45312 RVA: 0x00267600 File Offset: 0x00265800
[Token(Token = "0x600B100")]
[Address(RVA = "0x1896020", Offset = "0x1894E20", VA = "0x181896020")]
public Ed25519phSigner(byte[] context)
{
IDigest digest = Ed25519.CreatePrehash();
this.prehash = digest;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001BE0 RID: 7136
// (get) Token: 0x0600B101 RID: 45313 RVA: 0x00267630 File Offset: 0x00265830
[Token(Token = "0x17001BE0")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B101")]
[Address(RVA = "0x18960C0", Offset = "0x1894EC0", VA = "0x1818960C0", Slot = "11")]
get
{
return "Ed25519ph";
}
}
// Token: 0x0600B102 RID: 45314 RVA: 0x00267644 File Offset: 0x00265844
[Token(Token = "0x600B102")]
[Address(RVA = "0x1895DA0", Offset = "0x1894BA0", VA = "0x181895DA0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B102)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519phSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2B:
stfld:Ed25519PublicKeyParameters(Ed25519phSigner::publicKey, ldloc:Ed25519phSigner(this), ldloc:Ed25519PublicKeyParameters(var_1))
stloc:IDigest(var_2_38, ldfld:IDigest(Ed25519phSigner::prehash, ldloc:Ed25519phSigner(this)))
}
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: 0x0600B103 RID: 45315 RVA: 0x0026768C File Offset: 0x0026588C
[Token(Token = "0x600B103")]
[Address(RVA = "0x1895EE0", Offset = "0x1894CE0", VA = "0x181895EE0", Slot = "13")]
public virtual void Update(byte b)
{
IDigest digest = this.prehash;
throw new NullReferenceException();
}
// Token: 0x0600B104 RID: 45316 RVA: 0x002676A8 File Offset: 0x002658A8
[Token(Token = "0x600B104")]
[Address(RVA = "0x1895B00", Offset = "0x1894900", VA = "0x181895B00", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
IDigest digest = this.prehash;
}
// Token: 0x0600B105 RID: 45317 RVA: 0x002676C4 File Offset: 0x002658C4
[Token(Token = "0x600B105")]
[Address(RVA = "0x1895B80", Offset = "0x1894980", VA = "0x181895B80", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B105)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519phSigner::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_80:
stloc:InvalidOperationException(var_10_8A, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Prehash digest failed")))
}
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: 0x0600B106 RID: 45318 RVA: 0x0026775C File Offset: 0x0026595C
[Token(Token = "0x600B106")]
[Address(RVA = "0x1895F40", Offset = "0x1894D40", VA = "0x181895F40", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B106)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed25519phSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3D:
stloc:InvalidOperationException(var_7_47, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed25519phSigner not initialised for verification")))
}
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: 0x0600B107 RID: 45319 RVA: 0x002677B4 File Offset: 0x002659B4
[Token(Token = "0x600B107")]
[Address(RVA = "0x1895E90", Offset = "0x1894C90", VA = "0x181895E90", Slot = "10")]
public void Reset()
{
IDigest digest = this.prehash;
throw new NullReferenceException();
}
// Token: 0x040070B1 RID: 28849
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070B1")]
private readonly IDigest prehash;
// Token: 0x040070B2 RID: 28850
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070B2")]
private readonly byte[] context;
// Token: 0x040070B3 RID: 28851
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070B3")]
private bool forSigning;
// Token: 0x040070B4 RID: 28852
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070B4")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x040070B5 RID: 28853
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070B5")]
private Ed25519PublicKeyParameters publicKey;
}
}
@@ -0,0 +1,241 @@
using System;
using System.IO;
using System.Threading;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BAB RID: 7083
[Token(Token = "0x2001BAB")]
public class Ed448Signer : ISigner
{
// Token: 0x0600B108 RID: 45320 RVA: 0x002677D0 File Offset: 0x002659D0
[Token(Token = "0x600B108")]
[Address(RVA = "0x1896310", Offset = "0x1895110", VA = "0x181896310")]
public Ed448Signer(byte[] context)
{
Ed448Signer.Buffer buffer = new Ed448Signer.Buffer();
this.buffer = buffer;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001BE1 RID: 7137
// (get) Token: 0x0600B109 RID: 45321 RVA: 0x00267800 File Offset: 0x00265A00
[Token(Token = "0x17001BE1")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B109")]
[Address(RVA = "0x18963B0", Offset = "0x18951B0", VA = "0x1818963B0", Slot = "11")]
get
{
return "Ed448";
}
}
// Token: 0x0600B10A RID: 45322 RVA: 0x00267814 File Offset: 0x00265A14
[Token(Token = "0x600B10A")]
[Address(RVA = "0x1896180", Offset = "0x1894F80", VA = "0x181896180", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
int num;
do
{
this.forSigning = forSigning;
num = 0;
if (!forSigning)
{
this.privateKey = num;
if (parameters == 0)
{
goto IL_2B;
}
if (parameters == 0)
{
continue;
}
}
}
while (parameters != 0 && parameters == 0);
this.privateKey = num;
IL_2B:
Ed448PublicKeyParameters ed448PublicKeyParameters;
this.publicKey = ed448PublicKeyParameters;
string algorithmName = ((ISigner)this).AlgorithmName;
}
// Token: 0x0600B10B RID: 45323 RVA: 0x0026785C File Offset: 0x00265A5C
[Token(Token = "0x600B10B")]
[Address(RVA = "0x18956C0", Offset = "0x18944C0", VA = "0x1818956C0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B10C RID: 45324 RVA: 0x0026787C File Offset: 0x00265A7C
[Token(Token = "0x600B10C")]
[Address(RVA = "0x1895510", Offset = "0x1894310", VA = "0x181895510", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B10D RID: 45325 RVA: 0x002678A0 File Offset: 0x00265AA0
[Token(Token = "0x600B10D")]
[Address(RVA = "0x18960F0", Offset = "0x1894EF0", VA = "0x1818960F0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B10D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed448Signer::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_33:
stloc:InvalidOperationException(var_5_3D, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed448Signer not initialised for signature generation.")))
}
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: 0x0600B10E RID: 45326 RVA: 0x002678EC File Offset: 0x00265AEC
[Token(Token = "0x600B10E")]
[Address(RVA = "0x1896270", Offset = "0x1895070", VA = "0x181896270", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B10E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed448Signer::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2C:
stloc:InvalidOperationException(var_4_36, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed448Signer not initialised for verification")))
}
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: 0x0600B10F RID: 45327 RVA: 0x00267930 File Offset: 0x00265B30
[Token(Token = "0x600B10F")]
[Address(RVA = "0x1896250", Offset = "0x1895050", VA = "0x181896250", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x040070B6 RID: 28854
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070B6")]
private readonly Ed448Signer.Buffer buffer;
// Token: 0x040070B7 RID: 28855
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070B7")]
private readonly byte[] context;
// Token: 0x040070B8 RID: 28856
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070B8")]
private bool forSigning;
// Token: 0x040070B9 RID: 28857
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070B9")]
private Ed448PrivateKeyParameters privateKey;
// Token: 0x040070BA RID: 28858
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070BA")]
private Ed448PublicKeyParameters publicKey;
// Token: 0x02001BAC RID: 7084
[Token(Token = "0x2001BAC")]
private class Buffer : MemoryStream
{
// Token: 0x0600B110 RID: 45328 RVA: 0x00267950 File Offset: 0x00265B50
[Token(Token = "0x600B110")]
[Address(RVA = "0x1890620", Offset = "0x188F420", VA = "0x181890620")]
internal byte[] GenerateSignature(Ed448PrivateKeyParameters privateKey, Ed448PublicKeyParameters publicKey, byte[] ctx)
{
int num;
byte[] array;
do
{
num = 0;
long length = this.Length;
array = new byte[Ed448PrivateKeyParameters.SignatureSize];
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
return array;
}
// Token: 0x0600B111 RID: 45329 RVA: 0x00267988 File Offset: 0x00265B88
[Token(Token = "0x600B111")]
[Address(RVA = "0x1891030", Offset = "0x188FE30", VA = "0x181891030")]
internal bool VerifySignature(Ed448PublicKeyParameters publicKey, byte[] ctx, byte[] signature)
{
int num;
bool flag;
do
{
num = 0;
long length = this.Length;
byte[] encoded = publicKey.GetEncoded();
int num2 = 0;
int num3 = 0;
flag = Ed448.Verify(signature, num3, encoded, num2, ctx, encoded, num, (int)length);
this.Reset();
Monitor.Exit(this);
}
while (num != 0);
return flag;
}
// Token: 0x0600B112 RID: 45330 RVA: 0x002679D4 File Offset: 0x00265BD4
[Token(Token = "0x600B112")]
[Address(RVA = "0x1890AE0", Offset = "0x188F8E0", VA = "0x181890AE0")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B113 RID: 45331 RVA: 0x002679FC File Offset: 0x00265BFC
[Token(Token = "0x600B113")]
[Address(RVA = "0x18911A0", Offset = "0x188FFA0", VA = "0x1818911A0")]
public Buffer()
{
}
}
}
}
@@ -0,0 +1,168 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BAD RID: 7085
[Token(Token = "0x2001BAD")]
public class Ed448phSigner : ISigner
{
// Token: 0x0600B114 RID: 45332 RVA: 0x00267A10 File Offset: 0x00265C10
[Token(Token = "0x600B114")]
[Address(RVA = "0x1896970", Offset = "0x1895770", VA = "0x181896970")]
public Ed448phSigner(byte[] context)
{
IXof xof = Ed448.CreatePrehash();
this.prehash = xof;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001BE2 RID: 7138
// (get) Token: 0x0600B115 RID: 45333 RVA: 0x00267A40 File Offset: 0x00265C40
[Token(Token = "0x17001BE2")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B115")]
[Address(RVA = "0x1896A10", Offset = "0x1895810", VA = "0x181896A10", Slot = "11")]
get
{
return "Ed448ph";
}
}
// Token: 0x0600B116 RID: 45334 RVA: 0x00267A54 File Offset: 0x00265C54
[Token(Token = "0x600B116")]
[Address(RVA = "0x18966F0", Offset = "0x18954F0", VA = "0x1818966F0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B116)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed448phSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2B:
stfld:Ed448PublicKeyParameters(Ed448phSigner::publicKey, ldloc:Ed448phSigner(this), ldloc:Ed448PublicKeyParameters(var_1))
stloc:IXof(var_2_38, ldfld:IXof(Ed448phSigner::prehash, ldloc:Ed448phSigner(this)))
}
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: 0x0600B117 RID: 45335 RVA: 0x00267A9C File Offset: 0x00265C9C
[Token(Token = "0x600B117")]
[Address(RVA = "0x1896830", Offset = "0x1895630", VA = "0x181896830", Slot = "13")]
public virtual void Update(byte b)
{
IXof xof = this.prehash;
throw new NullReferenceException();
}
// Token: 0x0600B118 RID: 45336 RVA: 0x00267AB8 File Offset: 0x00265CB8
[Token(Token = "0x600B118")]
[Address(RVA = "0x18963E0", Offset = "0x18951E0", VA = "0x1818963E0", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
IXof xof = this.prehash;
}
// Token: 0x0600B119 RID: 45337 RVA: 0x00267AD4 File Offset: 0x00265CD4
[Token(Token = "0x600B119")]
[Address(RVA = "0x1896460", Offset = "0x1895260", VA = "0x181896460", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B119)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed448phSigner::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_6B:
stloc:InvalidOperationException(var_9_75, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Prehash digest failed")))
}
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: 0x0600B11A RID: 45338 RVA: 0x00267B58 File Offset: 0x00265D58
[Token(Token = "0x600B11A")]
[Address(RVA = "0x1896890", Offset = "0x1895690", VA = "0x181896890", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B11A)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Ed448phSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3D:
stloc:InvalidOperationException(var_7_47, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Ed448phSigner not initialised for verification")))
}
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: 0x0600B11B RID: 45339 RVA: 0x00267BB0 File Offset: 0x00265DB0
[Token(Token = "0x600B11B")]
[Address(RVA = "0x18967E0", Offset = "0x18955E0", VA = "0x1818967E0", Slot = "10")]
public void Reset()
{
IXof xof = this.prehash;
throw new NullReferenceException();
}
// Token: 0x040070BB RID: 28859
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070BB")]
private readonly IXof prehash;
// Token: 0x040070BC RID: 28860
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070BC")]
private readonly byte[] context;
// Token: 0x040070BD RID: 28861
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070BD")]
private bool forSigning;
// Token: 0x040070BE RID: 28862
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070BE")]
private Ed448PrivateKeyParameters privateKey;
// Token: 0x040070BF RID: 28863
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070BF")]
private Ed448PublicKeyParameters publicKey;
}
}
@@ -0,0 +1,172 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB0 RID: 7088
[Token(Token = "0x2001BB0")]
public class GenericSigner : ISigner
{
// Token: 0x0600B12A RID: 45354 RVA: 0x00268114 File Offset: 0x00266314
[Token(Token = "0x600B12A")]
[Address(RVA = "0x4089A0", Offset = "0x4077A0", VA = "0x1804089A0")]
public GenericSigner(IAsymmetricBlockCipher engine, IDigest digest)
{
this.engine = engine;
this.digest = digest;
}
// Token: 0x17001BE6 RID: 7142
// (get) Token: 0x0600B12B RID: 45355 RVA: 0x00268138 File Offset: 0x00266338
[Token(Token = "0x17001BE6")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B12B")]
[Address(RVA = "0x18971D0", Offset = "0x1895FD0", VA = "0x1818971D0", Slot = "11")]
get
{
string[] array = new string[5];
if ("Generic(" != 0)
{
}
array[0] = "Generic(";
IAsymmetricBlockCipher asymmetricBlockCipher = this.engine;
if ("Generic(" != 0)
{
}
array[1] = "Generic(";
if ("/" != 0)
{
}
array[2] = "/";
IDigest digest = this.digest;
if ("/" != 0)
{
}
array[3] = "/";
if (")" != 0)
{
}
array[4] = ")";
return string.Concat(array);
}
}
// Token: 0x0600B12C RID: 45356 RVA: 0x002681CC File Offset: 0x002663CC
[Token(Token = "0x600B12C")]
[Address(RVA = "0x1896CC0", Offset = "0x1895AC0", VA = "0x181896CC0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B12C)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.GenericSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4C:
stloc:InvalidKeyException(var_8_56, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Signing requires private key.")))
stloc:InvalidKeyException(var_9_62, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Verification requires public key.")))
}
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: 0x0600B12D RID: 45357 RVA: 0x0026823C File Offset: 0x0026643C
[Token(Token = "0x600B12D")]
[Address(RVA = "0x1896F90", Offset = "0x1895D90", VA = "0x181896F90", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B12E RID: 45358 RVA: 0x00268258 File Offset: 0x00266458
[Token(Token = "0x600B12E")]
[Address(RVA = "0x1896B40", Offset = "0x1895940", VA = "0x181896B40", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B12F RID: 45359 RVA: 0x00268274 File Offset: 0x00266474
[Token(Token = "0x600B12F")]
[Address(RVA = "0x1896BC0", Offset = "0x18959C0", VA = "0x181896BC0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B12F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.GenericSigner::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2E:
stloc:InvalidOperationException(var_7_38, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("GenericSigner not initialised for signature generation.")))
}
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: 0x0600B130 RID: 45360 RVA: 0x002682BC File Offset: 0x002664BC
[Token(Token = "0x600B130")]
[Address(RVA = "0x1896FF0", Offset = "0x1895DF0", VA = "0x181896FF0", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
if (!this.forSigning)
{
IDigest digest = this.digest;
byte[] array = new byte[0];
IDigest digest2 = this.digest;
IAsymmetricBlockCipher asymmetricBlockCipher = this.engine;
int length = signature.Length;
int length2 = array.Length;
int num = new byte[length2].Length;
num -= length2;
}
InvalidOperationException ex = new InvalidOperationException("GenericSigner not initialised for verification");
throw new NullReferenceException();
}
// Token: 0x0600B131 RID: 45361 RVA: 0x00268348 File Offset: 0x00266548
[Token(Token = "0x600B131")]
[Address(RVA = "0x1896F40", Offset = "0x1895D40", VA = "0x181896F40", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x040070C5 RID: 28869
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070C5")]
private readonly IAsymmetricBlockCipher engine;
// Token: 0x040070C6 RID: 28870
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070C6")]
private readonly IDigest digest;
// Token: 0x040070C7 RID: 28871
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070C7")]
private bool forSigning;
}
}
@@ -0,0 +1,152 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BAE RID: 7086
[Token(Token = "0x2001BAE")]
public class Gost3410DigestSigner : ISigner
{
// Token: 0x0600B11C RID: 45340 RVA: 0x00267BCC File Offset: 0x00265DCC
[Token(Token = "0x600B11C")]
[Address(RVA = "0x579630", Offset = "0x578430", VA = "0x180579630")]
public Gost3410DigestSigner(IDsa signer, IDigest digest)
{
this.dsaSigner = signer;
this.digest = digest;
}
// Token: 0x17001BE3 RID: 7139
// (get) Token: 0x0600B11D RID: 45341 RVA: 0x00267BF0 File Offset: 0x00265DF0
[Token(Token = "0x17001BE3")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B11D")]
[Address(RVA = "0x1897BF0", Offset = "0x18969F0", VA = "0x181897BF0", Slot = "11")]
get
{
IDigest digest = this.digest;
IDsa dsa = this.dsaSigner;
string text;
return text;
}
}
// Token: 0x0600B11E RID: 45342 RVA: 0x00267C14 File Offset: 0x00265E14
[Token(Token = "0x600B11E")]
[Address(RVA = "0x18976F0", Offset = "0x18964F0", VA = "0x1818976F0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B11E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Gost3410DigestSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4C:
stloc:InvalidKeyException(var_8_56, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Signing Requires Private Key.")))
stloc:InvalidKeyException(var_9_62, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Verification Requires Public Key.")))
}
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: 0x0600B11F RID: 45343 RVA: 0x00267C84 File Offset: 0x00265E84
[Token(Token = "0x600B11F")]
[Address(RVA = "0x18979C0", Offset = "0x18967C0", VA = "0x1818979C0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B120 RID: 45344 RVA: 0x00267CA0 File Offset: 0x00265EA0
[Token(Token = "0x600B120")]
[Address(RVA = "0x1897420", Offset = "0x1896220", VA = "0x181897420", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B121 RID: 45345 RVA: 0x00267CBC File Offset: 0x00265EBC
[Token(Token = "0x600B121")]
[Address(RVA = "0x18974A0", Offset = "0x18962A0", VA = "0x1818974A0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
if (this.forSigning)
{
IDigest digest = this.digest;
byte[] array = new byte[0];
IDigest digest2 = this.digest;
IDsa dsa = this.dsaSigner;
byte[] array2 = new byte[64];
byte b = array[0];
byte b2 = array[1];
return array2;
}
InvalidOperationException ex = new InvalidOperationException("GOST3410DigestSigner not initialised for signature generation.");
throw new IndexOutOfRangeException();
}
// Token: 0x0600B122 RID: 45346 RVA: 0x00267D50 File Offset: 0x00265F50
[Token(Token = "0x600B122")]
[Address(RVA = "0x1897A20", Offset = "0x1896820", VA = "0x181897A20", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B122)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Gost3410DigestSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_36:
stloc:InvalidOperationException(var_12_40, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("DSADigestSigner not initialised for verification")))
}
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: 0x0600B123 RID: 45347 RVA: 0x00267DA0 File Offset: 0x00265FA0
[Token(Token = "0x600B123")]
[Address(RVA = "0x1897970", Offset = "0x1896770", VA = "0x181897970", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x040070C0 RID: 28864
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070C0")]
private readonly IDigest digest;
// Token: 0x040070C1 RID: 28865
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070C1")]
private readonly IDsa dsaSigner;
// Token: 0x040070C2 RID: 28866
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070C2")]
private bool forSigning;
}
}
@@ -0,0 +1,186 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BAF RID: 7087
[Token(Token = "0x2001BAF")]
public class Gost3410Signer : IDsaExt, IDsa
{
// Token: 0x17001BE4 RID: 7140
// (get) Token: 0x0600B124 RID: 45348 RVA: 0x00267DBC File Offset: 0x00265FBC
[Token(Token = "0x17001BE4")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B124")]
[Address(RVA = "0x18985F0", Offset = "0x18973F0", VA = "0x1818985F0", Slot = "9")]
get
{
return "GOST3410";
}
}
// Token: 0x0600B125 RID: 45349 RVA: 0x00267DD0 File Offset: 0x00265FD0
[Token(Token = "0x600B125")]
[Address(RVA = "0x1897FD0", Offset = "0x1896DD0", VA = "0x181897FD0", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B125)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Gost3410Signer::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_60:
stloc:InvalidKeyException(var_8_6A, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("GOST3410 public key required for signing")))
}
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: 0x17001BE5 RID: 7141
// (get) Token: 0x0600B126 RID: 45350 RVA: 0x00267E48 File Offset: 0x00266048
[Token(Token = "0x17001BE5")]
public virtual BigInteger Order
{
[Token(Token = "0x600B126")]
[Address(RVA = "0x1898620", Offset = "0x1897420", VA = "0x181898620", Slot = "11")]
get
{
return this.key.parameters.q;
}
}
// Token: 0x0600B127 RID: 45351 RVA: 0x00267E6C File Offset: 0x0026606C
[Token(Token = "0x600B127")]
[Address(RVA = "0x1897C70", Offset = "0x1896A70", VA = "0x181897C70", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
Gost3410Parameters parameters;
BigInteger bigInteger2;
BigInteger bigInteger4;
BigInteger bigInteger5;
Gost3410KeyParameters gost3410KeyParameters;
do
{
byte[] array = new byte[message.Length];
int num = 0;
int num2 = array.Length;
if (num != num2)
{
num2 -= num;
num++;
}
BigInteger bigInteger = new BigInteger(1, array);
parameters = this.key.parameters;
int bitLength = parameters.q.BitLength;
SecureRandom secureRandom = this.random;
bigInteger2 = new BigInteger(bitLength, secureRandom);
BigInteger q = parameters.q;
int num3 = bigInteger2.CompareTo(q);
BigInteger a = parameters.a;
BigInteger p = parameters.p;
BigInteger bigInteger3 = a.ModPow(bigInteger2, p);
BigInteger q2 = parameters.q;
bigInteger4 = bigInteger3.Mod(q2);
bigInteger5 = bigInteger2.Multiply(bigInteger);
gost3410KeyParameters = this.key;
}
while (gost3410KeyParameters == 0 || gost3410KeyParameters == 0);
BigInteger bigInteger6 = bigInteger2.Multiply(bigInteger4);
BigInteger bigInteger7 = bigInteger5.Add(bigInteger6);
BigInteger q3 = parameters.q;
BigInteger bigInteger8 = bigInteger7.Mod(q3);
BigInteger[] array2 = new BigInteger[2];
if (bigInteger4 != 0)
{
}
array2[0] = bigInteger4;
if (bigInteger8 != 0)
{
}
array2[1] = bigInteger8;
return array2;
}
// Token: 0x0600B128 RID: 45352 RVA: 0x00267F9C File Offset: 0x0026619C
[Token(Token = "0x600B128")]
[Address(RVA = "0x1898260", Offset = "0x1897060", VA = "0x181898260", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
Gost3410Parameters parameters;
BigInteger bigInteger8;
Gost3410KeyParameters gost3410KeyParameters;
do
{
byte[] array = new byte[message.Length];
int num = 0;
int num2 = array.Length;
if (num != num2)
{
num2 -= num;
num++;
}
BigInteger bigInteger = new BigInteger(1, array);
parameters = this.key.parameters;
if (parameters.q.CompareTo(r) <= 0 || parameters.q.CompareTo(s) <= 0)
{
goto IL_14F;
}
BigInteger q = parameters.q;
BigInteger two = BigInteger.Two;
BigInteger bigInteger2 = q.Subtract(two);
BigInteger q2 = parameters.q;
BigInteger bigInteger3 = bigInteger.ModPow(bigInteger2, q2);
BigInteger bigInteger4 = s.Multiply(bigInteger3);
BigInteger q3 = parameters.q;
BigInteger bigInteger5 = bigInteger4.Mod(q3);
BigInteger bigInteger6 = parameters.q.Subtract(r).Multiply(bigInteger3);
BigInteger q4 = parameters.q;
BigInteger bigInteger7 = bigInteger6.Mod(q4);
BigInteger a = parameters.a;
BigInteger p = parameters.p;
bigInteger8 = a.ModPow(bigInteger5, p);
gost3410KeyParameters = this.key;
}
while (gost3410KeyParameters == 0 || gost3410KeyParameters == 0);
BigInteger p2 = parameters.p;
BigInteger bigInteger10;
BigInteger bigInteger9 = bigInteger8.Multiply(bigInteger10);
BigInteger p3 = parameters.p;
BigInteger bigInteger11 = bigInteger9.Mod(p3);
BigInteger q5 = parameters.q;
BigInteger bigInteger12 = bigInteger11.Mod(q5);
IL_14F:
throw new NullReferenceException();
}
// Token: 0x0600B129 RID: 45353 RVA: 0x00268100 File Offset: 0x00266300
[Token(Token = "0x600B129")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public Gost3410Signer()
{
}
// Token: 0x040070C3 RID: 28867
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070C3")]
private Gost3410KeyParameters key;
// Token: 0x040070C4 RID: 28868
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070C4")]
private SecureRandom random;
}
}
@@ -0,0 +1,204 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB1 RID: 7089
[Token(Token = "0x2001BB1")]
public class HMacDsaKCalculator : IDsaKCalculator
{
// Token: 0x0600B132 RID: 45362 RVA: 0x00268364 File Offset: 0x00266564
[Token(Token = "0x600B132")]
[Address(RVA = "0x1898FA0", Offset = "0x1897DA0", VA = "0x181898FA0")]
public HMacDsaKCalculator(IDigest digest)
{
HMac hmac = new HMac(digest);
this.hMac = hmac;
byte[] array = new byte[hmac];
HMac hmac2 = this.hMac;
this.V = array;
byte[] array2 = new byte[0];
this.K = array2;
}
// Token: 0x17001BE7 RID: 7143
// (get) Token: 0x0600B133 RID: 45363 RVA: 0x002683B0 File Offset: 0x002665B0
[Token(Token = "0x17001BE7")]
public virtual bool IsDeterministic
{
[Token(Token = "0x600B133")]
[Address(RVA = "0x460D40", Offset = "0x45FB40", VA = "0x180460D40", Slot = "8")]
get
{
return true;
}
}
// Token: 0x0600B134 RID: 45364 RVA: 0x002683C0 File Offset: 0x002665C0
[Token(Token = "0x600B134")]
[Address(RVA = "0x1898CB0", Offset = "0x1897AB0", VA = "0x181898CB0", Slot = "9")]
public virtual void Init(BigInteger n, SecureRandom random)
{
/*
An exception occurred when decompiling this method (0600B134)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.HMacDsaKCalculator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Security.SecureRandom)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:InvalidOperationException(var_0_0A, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Operation not 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: 0x0600B135 RID: 45365 RVA: 0x002683D8 File Offset: 0x002665D8
[Token(Token = "0x600B135")]
[Address(RVA = "0x1898800", Offset = "0x1897600", VA = "0x181898800", Slot = "6")]
public void Init(BigInteger n, BigInteger d, byte[] message)
{
byte[] v = this.V;
this.n = n;
ulong num;
Arrays.Fill(v, (byte)num);
byte[] k = this.K;
int num2 = 0;
Arrays.Fill(k, (byte)num2);
int unsignedByteLength = BigIntegers.GetUnsignedByteLength(n);
byte[] array = new byte[unsignedByteLength];
byte[] array2 = BigIntegers.AsUnsignedByteArray(d);
int length = array2.Length;
int num3 = array.Length;
int num4 = 0;
num3 -= length;
Array.Copy(array2, num4, array, num3, length);
byte[] array3 = new byte[unsignedByteLength];
BigInteger bigInteger = this.BitsToInt(message);
int num5 = bigInteger.CompareTo(n);
byte[] array4 = BigIntegers.AsUnsignedByteArray(bigInteger.Subtract(n));
int length2 = array4.Length;
int num6 = array3.Length;
int num7 = 0;
num6 -= length2;
Array.Copy(array4, num7, array3, num6, length2);
HMac hmac = this.hMac;
KeyParameter keyParameter = new KeyParameter(this.K);
IDigest underlyingDigest = hmac.GetUnderlyingDigest();
byte[] v2 = this.V;
this.hMac.Update(v2);
int macSize = this.hMac.GetMacSize();
this.hMac.Update(array);
this.hMac.Update(array3);
HMac hmac2 = this.hMac;
HMac hmac3 = this.hMac;
KeyParameter keyParameter2 = new KeyParameter(this.K);
IDigest underlyingDigest2 = hmac3.GetUnderlyingDigest();
byte[] v3 = this.V;
this.hMac.Update(v3);
HMac hmac4 = this.hMac;
byte[] v4 = this.V;
this.hMac.Update(v4);
int macSize2 = this.hMac.GetMacSize();
this.hMac.Update(array);
this.hMac.Update(array3);
HMac hmac5 = this.hMac;
HMac hmac6 = this.hMac;
KeyParameter keyParameter3 = new KeyParameter(this.K);
IDigest underlyingDigest3 = hmac6.GetUnderlyingDigest();
byte[] v5 = this.V;
this.hMac.Update(v5);
string algorithmName = ((IMac)this.hMac).AlgorithmName;
}
// Token: 0x0600B136 RID: 45366 RVA: 0x002685CC File Offset: 0x002667CC
[Token(Token = "0x600B136")]
[Address(RVA = "0x1898D10", Offset = "0x1897B10", VA = "0x181898D10", Slot = "10")]
public virtual BigInteger NextK()
{
byte[] array = new byte[BigIntegers.GetUnsignedByteLength(this.n)];
int num = 0;
if (num < array.Length)
{
byte[] v = this.V;
this.hMac.Update(v);
HMac hmac = this.hMac;
byte[] v2 = this.V;
int num2 = array.Length;
int length = v2.Length;
num2 -= num;
int num3 = Math.Min(num2, length);
byte[] v3 = this.V;
int num4 = 0;
Array.Copy(v3, num4, array, num, num3);
num += num3;
}
BigInteger bigInteger = this.BitsToInt(array);
if (bigInteger.sign > num)
{
BigInteger bigInteger2 = this.n;
int num5 = bigInteger.CompareTo(bigInteger2);
}
byte[] v4 = this.V;
this.hMac.Update(v4);
int macSize = this.hMac.GetMacSize();
HMac hmac2 = this.hMac;
HMac hmac3 = this.hMac;
KeyParameter keyParameter = new KeyParameter(this.K);
IDigest underlyingDigest = hmac3.GetUnderlyingDigest();
byte[] v5 = this.V;
this.hMac.Update(v5);
HMac hmac4 = this.hMac;
throw new NullReferenceException();
}
// Token: 0x0600B137 RID: 45367 RVA: 0x002686E8 File Offset: 0x002668E8
[Token(Token = "0x600B137")]
[Address(RVA = "0x1898740", Offset = "0x1897540", VA = "0x181898740")]
private BigInteger BitsToInt(byte[] t)
{
BigInteger bigInteger = new BigInteger(1, t);
int bitLength = this.n.BitLength;
if (t.Length > bitLength)
{
int bitLength2 = this.n.BitLength;
int num = t.Length;
num -= bitLength2;
BigInteger bigInteger2 = bigInteger.ShiftRight(num);
}
return bigInteger;
}
// Token: 0x040070C8 RID: 28872
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070C8")]
private readonly HMac hMac;
// Token: 0x040070C9 RID: 28873
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070C9")]
private readonly byte[] K;
// Token: 0x040070CA RID: 28874
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070CA")]
private readonly byte[] V;
// Token: 0x040070CB RID: 28875
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070CB")]
private BigInteger n;
}
}
@@ -0,0 +1,21 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB2 RID: 7090
[Token(Token = "0x2001BB2")]
public interface IDsaEncoding
{
// Token: 0x0600B138 RID: 45368
[Token(Token = "0x600B138")]
[Address(Slot = "0")]
BigInteger[] Decode(BigInteger n, byte[] encoding);
// Token: 0x0600B139 RID: 45369
[Token(Token = "0x600B139")]
[Address(Slot = "1")]
byte[] Encode(BigInteger n, BigInteger r, BigInteger s);
}
}
@@ -0,0 +1,37 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB3 RID: 7091
[Token(Token = "0x2001BB3")]
public interface IDsaKCalculator
{
// Token: 0x17001BE8 RID: 7144
// (get) Token: 0x0600B13A RID: 45370
[Token(Token = "0x17001BE8")]
bool IsDeterministic
{
[Token(Token = "0x600B13A")]
[Address(Slot = "0")]
get;
}
// Token: 0x0600B13B RID: 45371
[Token(Token = "0x600B13B")]
[Address(Slot = "1")]
void Init(BigInteger n, SecureRandom random);
// Token: 0x0600B13C RID: 45372
[Token(Token = "0x600B13C")]
[Address(Slot = "2")]
void Init(BigInteger n, BigInteger d, byte[] message);
// Token: 0x0600B13D RID: 45373
[Token(Token = "0x600B13D")]
[Address(Slot = "3")]
BigInteger NextK();
}
}
@@ -0,0 +1,645 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB4 RID: 7092
[Token(Token = "0x2001BB4")]
public class Iso9796d2PssSigner : ISignerWithRecovery, ISigner
{
// Token: 0x0600B13E RID: 45374 RVA: 0x0026873C File Offset: 0x0026693C
[Token(Token = "0x600B13E")]
[Address(RVA = "0x423DE0", Offset = "0x422BE0", VA = "0x180423DE0", Slot = "5")]
public byte[] GetRecoveredMessage()
{
return this.recoveredMessage;
}
// Token: 0x0600B13F RID: 45375 RVA: 0x00268750 File Offset: 0x00266950
[Token(Token = "0x600B13F")]
[Address(RVA = "0x189CEC0", Offset = "0x189BCC0", VA = "0x18189CEC0")]
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B13F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2PssSigner::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,System.Int32,System.Boolean)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_46:
stloc:ArgumentException(var_1_55, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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: 0x0600B140 RID: 45376 RVA: 0x002687B4 File Offset: 0x002669B4
[Token(Token = "0x600B140")]
[Address(RVA = "0x189CDA0", Offset = "0x189BBA0", VA = "0x18189CDA0")]
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength)
{
/*
An exception occurred when decompiling this method (0600B140)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2PssSigner::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_39:
stloc:ArgumentException(var_1_48, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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: 0x17001BE9 RID: 7145
// (get) Token: 0x0600B141 RID: 45377 RVA: 0x0026880C File Offset: 0x00266A0C
[Token(Token = "0x17001BE9")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B141")]
[Address(RVA = "0x189CFF0", Offset = "0x189BDF0", VA = "0x18189CFF0", Slot = "14")]
get
{
IDigest digest = this.digest;
return 0 + "withISO9796-2S2";
}
}
// Token: 0x0600B142 RID: 45378 RVA: 0x00268834 File Offset: 0x00266A34
[Token(Token = "0x600B142")]
[Address(RVA = "0x189B8B0", Offset = "0x189A6B0", VA = "0x18189B8B0", Slot = "15")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
while (parameters != 0)
{
if (parameters == 0)
{
if ((parameters == 0 && parameters == 0) || !forSigning)
{
continue;
}
int num = 0;
if (parameters == 0)
{
continue;
}
this.standardSalt = num;
int num2 = this.saltLength;
}
if (parameters != 0)
{
int num3 = 0;
if (forSigning)
{
this.random = num3;
break;
}
IL_5B:
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int num4 = 0;
int num5;
this.keyBits = num5;
num5 += 7;
num4 += num5;
byte[] array = new byte[num4];
this.block = array;
if (this.trailer != 188)
{
IDigest digest = this.digest;
int num6 = array.Length;
num6 -= array;
}
IDigest digest2 = this.digest;
int num7 = array.Length;
num7 -= array;
byte[] array2 = new byte[num7];
this.mBuf = array2;
string algorithmName = ((ISigner)this).AlgorithmName;
return;
}
}
if (forSigning)
{
SecureRandom secureRandom = new SecureRandom();
this.random = secureRandom;
goto IL_5B;
}
goto IL_5B;
}
// Token: 0x0600B143 RID: 45379 RVA: 0x0026892C File Offset: 0x00266B2C
[Token(Token = "0x600B143")]
[Address(RVA = "0x189BC80", Offset = "0x189AA80", VA = "0x18189BC80")]
private bool IsSameAs(byte[] a, byte[] b)
{
int length = b.Length;
if (this.messageLength == length)
{
int num = 0;
int num2 = 0;
if (num2 != length)
{
num++;
}
}
throw new NullReferenceException();
}
// Token: 0x0600B144 RID: 45380 RVA: 0x00268960 File Offset: 0x00266B60
[Token(Token = "0x600B144")]
[Address(RVA = "0x189B390", Offset = "0x189A190", VA = "0x18189B390")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B145 RID: 45381 RVA: 0x00268984 File Offset: 0x00266B84
[Token(Token = "0x600B145")]
[Address(RVA = "0x189C3C0", Offset = "0x189B1C0", VA = "0x18189C3C0", Slot = "16")]
public virtual void UpdateWithRecoveredMessage(byte[] signature)
{
int length;
int num;
do
{
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
length = signature.Length;
num = 0;
int num2 = this.keyBits;
num2 += 7;
num2 += typeof(IAsymmetricBlockCipher).TypeHandle;
int num3 = new byte[num2].Length;
num3 -= typeof(byte[]).TypeHandle;
if (asymmetricBlockCipher == 0)
{
goto IL_59;
}
}
while (IsoTrailers.NoTrailerAvailable(this.digest));
int num4 = IsoTrailers.GetTrailer(this.digest);
IL_59:
byte[] array = new byte[this.hLen];
IDigest digest = this.digest;
int num5 = this.hLen;
digest -= num5;
uint num6;
digest -= num6;
byte[] array2;
int length2 = array2.Length;
if (num != length2)
{
num++;
}
if (num < 0)
{
num++;
}
bool flag = num > 1;
this.fullMessage = flag;
int num7 = array2.Length;
num7 -= num;
byte[] array3 = new byte[num7];
this.recoveredMessage = array3;
int length3 = array3.Length;
byte[] array4 = this.recoveredMessage;
byte[] array5 = this.mBuf;
this.preBlock = length;
this.preMStart = num;
this.preTLength = (int)num6;
this.preSig = signature;
}
// Token: 0x0600B146 RID: 45382 RVA: 0x00268AB4 File Offset: 0x00266CB4
[Token(Token = "0x600B146")]
[Address(RVA = "0x189C7D0", Offset = "0x189B5D0", VA = "0x18189C7D0", Slot = "17")]
public virtual void Update(byte input)
{
if (this.preSig == (ulong)0L)
{
byte[] array = this.mBuf;
int num = this.messageLength;
if (num < array.Length)
{
int num2 = num + 1;
this.messageLength = num2;
return;
}
}
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B147 RID: 45383 RVA: 0x00268AFC File Offset: 0x00266CFC
[Token(Token = "0x600B147")]
[Address(RVA = "0x189B2B0", Offset = "0x189A0B0", VA = "0x18189B2B0", Slot = "18")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
if (this.preSig == (ulong)0L)
{
if (length > 0)
{
int length2 = this.mBuf.Length;
if (this.messageLength >= length2)
{
goto IL_27;
}
}
return;
}
IL_27:
while (length <= 0)
{
}
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B148 RID: 45384 RVA: 0x00268B40 File Offset: 0x00266D40
[Token(Token = "0x600B148")]
[Address(RVA = "0x189C300", Offset = "0x189B100", VA = "0x18189C300", Slot = "19")]
public virtual void Reset()
{
IDigest digest = this.digest;
byte[] array = this.mBuf;
int num = 0;
this.messageLength = num;
if (array != 0)
{
int length = array.Length;
int num2 = 0;
Array.Clear(array, num2, length);
}
byte[] array2 = this.recoveredMessage;
if (array2 != 0)
{
int length2 = array2.Length;
int num3 = 0;
Array.Clear(array2, num3, length2);
this.recoveredMessage = num;
}
this.fullMessage = num != 0;
if (this.preSig != num)
{
byte[] array3 = this.preBlock;
this.preSig = num;
int length3 = array3.Length;
int num4 = 0;
Array.Clear(array3, num4, length3);
this.preBlock = num;
}
}
// Token: 0x0600B149 RID: 45385 RVA: 0x00268BEC File Offset: 0x00266DEC
[Token(Token = "0x600B149")]
[Address(RVA = "0x189B3C0", Offset = "0x189A1C0", VA = "0x18189B3C0", Slot = "20")]
public virtual byte[] GenerateSignature()
{
IDigest digest = this.digest;
byte[] array = new byte[0];
IDigest digest2 = this.digest;
int num = 0;
byte[] array2 = new byte[0];
int num2 = this.messageLength;
this.LtoOSP((long)num2, array2);
IDigest digest3 = this.digest;
int length = array2.Length;
IDigest digest4 = this.digest;
int num3 = this.messageLength;
IDigest digest5 = this.digest;
int length2 = array.Length;
byte[] array3 = this.standardSalt;
if (array3 == 0)
{
byte[] array4 = new byte[this.saltLength];
double num4 = this.random.NextDouble();
}
IDigest digest6 = this.digest;
int length3 = array3.Length;
IDigest digest7 = this.digest;
byte[] array5 = new byte[length3];
IDigest digest8 = this.digest;
byte[] array6 = this.block;
bool flag = this.trailer != 188;
int num5 = array6.Length;
num5 -= (flag ? 1 : 0);
int num6 = this.messageLength;
int num7 = 0;
byte[] array7 = this.block;
Array.Copy(this.mBuf, num7, array7, num5, num6);
int num8 = this.messageLength;
int num9 = 0;
int length4 = array3.Length;
num8 += num5;
byte[] array8 = this.block;
Array.Copy(array3, num9, array8, num8, length4);
int num10 = this.block.Length;
int num11 = 0;
int length5 = array5.Length;
num10 -= (flag ? 1 : 0);
int length6 = this.MaskGeneratorFunction1(array5, num11, length5, num10).Length;
byte[] array9 = this.block;
if (num != length6)
{
num++;
}
int num12 = this.hLen;
int num13 = 0;
int num14 = array9.Length;
num14 -= num12;
num14 -= (flag ? 1 : 0);
Array.Copy(array5, num13, array9, num14, num12);
int num15 = this.trailer;
byte[] array10 = this.block;
int length8;
if (num15 != 188)
{
int length7 = array10.Length;
length8 = this.block.Length;
int num16 = this.trailer;
int num17 = length8 - 1;
}
int num18 = length8 - 1;
byte[] array11 = this.block;
byte[] array12 = this.block;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length9 = array12.Length;
byte[] array13 = this.mBuf;
int length10 = array13.Length;
int num19 = 0;
Array.Clear(array13, num19, length10);
byte[] array14 = this.block;
int length11 = array14.Length;
int num20 = 0;
Array.Clear(array14, num20, length11);
this.messageLength = num;
throw new NullReferenceException();
}
// Token: 0x0600B14A RID: 45386 RVA: 0x00268E54 File Offset: 0x00267054
[Token(Token = "0x600B14A")]
[Address(RVA = "0x189C880", Offset = "0x189B680", VA = "0x18189C880", Slot = "21")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B14A)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2PssSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1EF:
stloc:InvalidOperationException(var_42_1F9, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("UpdateWithRecoveredMessage called on different signature")))
}
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: 0x0600B14B RID: 45387 RVA: 0x0026905C File Offset: 0x0026725C
[Token(Token = "0x600B14B")]
[Address(RVA = "0x40FFA0", Offset = "0x40EDA0", VA = "0x18040FFA0", Slot = "22")]
public virtual bool HasFullMessage()
{
return this.fullMessage;
}
// Token: 0x0600B14C RID: 45388 RVA: 0x00269070 File Offset: 0x00267270
[Token(Token = "0x600B14C")]
[Address(RVA = "0x189BD10", Offset = "0x189AB10", VA = "0x18189BD10")]
private void ItoOSP(int i, byte[] sp)
{
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
}
// Token: 0x0600B14D RID: 45389 RVA: 0x002690A4 File Offset: 0x002672A4
[Token(Token = "0x600B14D")]
[Address(RVA = "0x189BDA0", Offset = "0x189ABA0", VA = "0x18189BDA0")]
private void LtoOSP(long l, byte[] sp)
{
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
sp[0] = (byte)l;
}
// Token: 0x0600B14E RID: 45390 RVA: 0x002690F8 File Offset: 0x002672F8
[Token(Token = "0x600B14E")]
[Address(RVA = "0x189BEE0", Offset = "0x189ACE0", VA = "0x18189BEE0")]
private byte[] MaskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length)
{
byte[] array = new byte[0];
byte[] array2 = new byte[this.hLen];
byte[] array3 = new byte[4];
IDigest digest = this.digest;
int num = 0;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
IDigest digest2 = this.digest;
int num2 = 0;
if (num2 < digest)
{
num2 += num2;
num2++;
}
IDigest digest3 = this.digest;
int num3 = 0;
if (num3 < zOff)
{
num3 += num3;
num3++;
}
int num4 = 0;
IDigest digest4 = this.digest;
int num5 = 0;
if (num5 < num4)
{
num5 += num5;
num5++;
}
int num6 = this.hLen;
int num7 = num6 * num;
int num8 = 0;
Array.Copy(array2, num8, array, num7, num6);
int num9 = this.hLen;
this.ItoOSP(1, array3);
IDigest digest5 = this.digest;
IDigest digest6 = this.digest;
int length2 = array3.Length;
IDigest digest7 = this.digest;
int num10 = this.hLen;
int num11 = array.Length;
int num12 = 0;
num11 -= num10;
Array.Copy(array2, num12, array, num10, num11);
return array;
}
// Token: 0x040070CC RID: 28876
[Token(Token = "0x40070CC")]
[Obsolete]
public const int TrailerImplicit = 188;
// Token: 0x040070CD RID: 28877
[Token(Token = "0x40070CD")]
[Obsolete]
public const int TrailerRipeMD160 = 12748;
// Token: 0x040070CE RID: 28878
[Token(Token = "0x40070CE")]
[Obsolete]
public const int TrailerRipeMD128 = 13004;
// Token: 0x040070CF RID: 28879
[Token(Token = "0x40070CF")]
[Obsolete]
public const int TrailerSha1 = 13260;
// Token: 0x040070D0 RID: 28880
[Token(Token = "0x40070D0")]
[Obsolete]
public const int TrailerSha256 = 13516;
// Token: 0x040070D1 RID: 28881
[Token(Token = "0x40070D1")]
[Obsolete]
public const int TrailerSha512 = 13772;
// Token: 0x040070D2 RID: 28882
[Token(Token = "0x40070D2")]
[Obsolete]
public const int TrailerSha384 = 14028;
// Token: 0x040070D3 RID: 28883
[Token(Token = "0x40070D3")]
[Obsolete]
public const int TrailerWhirlpool = 14284;
// Token: 0x040070D4 RID: 28884
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070D4")]
private IDigest digest;
// Token: 0x040070D5 RID: 28885
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070D5")]
private IAsymmetricBlockCipher cipher;
// Token: 0x040070D6 RID: 28886
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070D6")]
private SecureRandom random;
// Token: 0x040070D7 RID: 28887
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070D7")]
private byte[] standardSalt;
// Token: 0x040070D8 RID: 28888
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070D8")]
private int hLen;
// Token: 0x040070D9 RID: 28889
[FieldOffset(Offset = "0x34")]
[Token(Token = "0x40070D9")]
private int trailer;
// Token: 0x040070DA RID: 28890
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40070DA")]
private int keyBits;
// Token: 0x040070DB RID: 28891
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40070DB")]
private byte[] block;
// Token: 0x040070DC RID: 28892
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40070DC")]
private byte[] mBuf;
// Token: 0x040070DD RID: 28893
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40070DD")]
private int messageLength;
// Token: 0x040070DE RID: 28894
[FieldOffset(Offset = "0x54")]
[Token(Token = "0x40070DE")]
private readonly int saltLength;
// Token: 0x040070DF RID: 28895
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40070DF")]
private bool fullMessage;
// Token: 0x040070E0 RID: 28896
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40070E0")]
private byte[] recoveredMessage;
// Token: 0x040070E1 RID: 28897
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x40070E1")]
private byte[] preSig;
// Token: 0x040070E2 RID: 28898
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x40070E2")]
private byte[] preBlock;
// Token: 0x040070E3 RID: 28899
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x40070E3")]
private int preMStart;
// Token: 0x040070E4 RID: 28900
[FieldOffset(Offset = "0x7C")]
[Token(Token = "0x40070E4")]
private int preTLength;
}
}
@@ -0,0 +1,483 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB5 RID: 7093
[Token(Token = "0x2001BB5")]
public class Iso9796d2Signer : ISignerWithRecovery, ISigner
{
// Token: 0x0600B14F RID: 45391 RVA: 0x00269240 File Offset: 0x00267440
[Token(Token = "0x600B14F")]
[Address(RVA = "0x408890", Offset = "0x407690", VA = "0x180408890", Slot = "5")]
public byte[] GetRecoveredMessage()
{
return this.recoveredMessage;
}
// Token: 0x0600B150 RID: 45392 RVA: 0x00269254 File Offset: 0x00267454
[Token(Token = "0x600B150")]
[Address(RVA = "0x189E420", Offset = "0x189D220", VA = "0x18189E420")]
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B150)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2Signer::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,System.Boolean)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3D:
stloc:ArgumentException(var_1_4C, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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.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: 0x0600B151 RID: 45393 RVA: 0x002692B0 File Offset: 0x002674B0
[Token(Token = "0x600B151")]
[Address(RVA = "0x189E520", Offset = "0x189D320", VA = "0x18189E520")]
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest)
{
/*
An exception occurred when decompiling this method (0600B151)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2Signer::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2C:
stloc:ArgumentException(var_1_3B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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: 0x17001BEA RID: 7146
// (get) Token: 0x0600B152 RID: 45394 RVA: 0x002692F8 File Offset: 0x002674F8
[Token(Token = "0x17001BEA")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B152")]
[Address(RVA = "0x189E610", Offset = "0x189D410", VA = "0x18189E610", Slot = "14")]
get
{
IDigest digest = this.digest;
return 0 + "withISO9796-2S1";
}
}
// Token: 0x0600B153 RID: 45395 RVA: 0x00269320 File Offset: 0x00267520
[Token(Token = "0x600B153")]
[Address(RVA = "0x189D490", Offset = "0x189C290", VA = "0x18189D490", Slot = "15")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
do
{
if (parameters == 0)
{
}
}
while (parameters == 0);
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int num = 0;
int num2;
this.keyBits = num2;
num2 += 7;
num += num2;
byte[] array = new byte[num];
this.block = array;
if (this.trailer != 188)
{
IDigest digest = this.digest;
int num3 = array.Length;
num3 -= array;
num3 += -3;
}
IDigest digest2 = this.digest;
int num4 = array.Length;
num4 -= array;
num4 += -2;
byte[] array2 = new byte[num4];
this.mBuf = array2;
string algorithmName = ((ISigner)this).AlgorithmName;
}
// Token: 0x0600B154 RID: 45396 RVA: 0x002693C8 File Offset: 0x002675C8
[Token(Token = "0x600B154")]
[Address(RVA = "0x189D620", Offset = "0x189C420", VA = "0x18189D620")]
private bool IsSameAs(byte[] a, byte[] b)
{
byte[] array = this.mBuf;
int num = this.messageLength;
int num2 = array.Length;
int length = b.Length;
if (num == length)
{
num2 = length;
int length2 = b.Length;
int num3 = 0;
if (num2 != 0)
{
num3++;
while (num3 != num2)
{
}
}
return true;
}
throw new NullReferenceException();
}
// Token: 0x0600B155 RID: 45397 RVA: 0x0026941C File Offset: 0x0026761C
[Token(Token = "0x600B155")]
[Address(RVA = "0x189B390", Offset = "0x189A190", VA = "0x18189B390")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B156 RID: 45398 RVA: 0x00269440 File Offset: 0x00267640
[Token(Token = "0x600B156")]
[Address(RVA = "0x189D800", Offset = "0x189C600", VA = "0x18189D800", Slot = "16")]
public virtual void UpdateWithRecoveredMessage(byte[] signature)
{
int length;
for (;;)
{
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
length = signature.Length;
uint num;
if (length == 192 && num == (uint)15)
{
if (num != (uint)0)
{
if (IsoTrailers.NoTrailerAvailable(this.digest))
{
continue;
}
int num2 = IsoTrailers.GetTrailer(this.digest);
}
int num3 = 0;
int num4 = 0;
if (num4 != asymmetricBlockCipher && num != (uint)15)
{
num3++;
}
IDigest digest = this.digest;
uint num5;
num5 -= (uint)num3;
uint num6;
num5 -= num6;
num5 -= 1U;
if (num5 > (uint)0)
{
break;
}
}
}
this.fullMessage = false;
this.fullMessage = true;
byte[] array = new byte[1];
this.recoveredMessage = array;
int length2 = array.Length;
byte[] array2 = this.recoveredMessage;
this.preSig = signature;
this.preBlock = length;
IDigest digest2 = this.digest;
int length3 = array2.Length;
int length4 = this.recoveredMessage.Length;
byte[] array3 = this.mBuf;
this.messageLength = length4;
}
// Token: 0x0600B157 RID: 45399 RVA: 0x00269554 File Offset: 0x00267754
[Token(Token = "0x600B157")]
[Address(RVA = "0x189DBF0", Offset = "0x189C9F0", VA = "0x18189DBF0", Slot = "17")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
byte[] array = this.mBuf;
int num = this.messageLength;
int length = array.Length;
if (num < length)
{
}
num++;
this.messageLength = num;
}
// Token: 0x0600B158 RID: 45400 RVA: 0x00269594 File Offset: 0x00267794
[Token(Token = "0x600B158")]
[Address(RVA = "0x189D050", Offset = "0x189BE50", VA = "0x18189D050", Slot = "18")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
if (length > 0)
{
int length2 = this.mBuf.Length;
if (this.messageLength < length2)
{
}
}
IDigest digest = this.digest;
}
// Token: 0x0600B159 RID: 45401 RVA: 0x002695CC File Offset: 0x002677CC
[Token(Token = "0x600B159")]
[Address(RVA = "0x189D6F0", Offset = "0x189C4F0", VA = "0x18189D6F0", Slot = "19")]
public virtual void Reset()
{
IDigest digest = this.digest;
byte[] array = this.mBuf;
int num = 0;
this.messageLength = num;
int length = array.Length;
int num2 = 0;
Array.Clear(array, num2, length);
byte[] array2 = this.recoveredMessage;
if (array2 != 0)
{
int length2 = array2.Length;
int num3 = 0;
Array.Clear(array2, num3, length2);
}
this.recoveredMessage = num;
this.fullMessage = num != 0;
if (this.preSig != num)
{
byte[] array3 = this.preBlock;
this.preSig = num;
int length3 = array3.Length;
int num4 = 0;
Array.Clear(array3, num4, length3);
this.preBlock = num;
}
}
// Token: 0x0600B15A RID: 45402 RVA: 0x00269674 File Offset: 0x00267874
[Token(Token = "0x600B15A")]
[Address(RVA = "0x189D130", Offset = "0x189BF30", VA = "0x18189D130", Slot = "20")]
public virtual byte[] GenerateSignature()
{
IDigest digest = this.digest;
byte[] array = this.block;
if (this.trailer != 188)
{
int length = array.Length;
IDigest digest2 = this.digest;
int length2 = this.block.Length;
int num = this.trailer;
int length3 = this.block.Length;
int num2 = this.trailer;
int num3 = length3 - 1;
}
int num4 = array.Length;
IDigest digest3 = this.digest;
int num5 = this.block.Length;
int num6 = num5 - 1;
int num7 = this.messageLength;
uint num8;
num5 += (int)num8;
num5 += 7;
num5 += (int)num8;
num7 -= num5;
num4 -= num7;
byte[] array2 = this.block;
int num9 = 0;
Array.Copy(this.mBuf, num9, array2, num4, num7);
int num10 = num4 - 1;
byte[] array3 = this.block;
byte[] array4 = this.block;
byte[] array5 = this.block;
while (num10 != array5.Length)
{
}
byte[] array6 = this.block;
byte[] array7 = this.block;
byte[] array8 = this.block;
byte[] array9 = this.block;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length4 = array9.Length;
byte[] array10 = this.mBuf;
this.messageLength = (int)((ulong)0L);
int length5 = array10.Length;
int num11 = 0;
Array.Clear(array10, num11, length5);
byte[] array11 = this.block;
int length6 = array11.Length;
int num12 = 0;
Array.Clear(array11, num12, length6);
throw new NullReferenceException();
}
// Token: 0x0600B15B RID: 45403 RVA: 0x002697F8 File Offset: 0x002679F8
[Token(Token = "0x600B15B")]
[Address(RVA = "0x189DC90", Offset = "0x189CA90", VA = "0x18189DC90", Slot = "21")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B15B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.Iso9796d2Signer::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21E:
stloc:InvalidOperationException(var_42_22F, newobj:InvalidOperationException(InvalidOperationException::.ctor, call:string(string::Concat, ldstr:string[exp:object]("signer initialised with wrong digest for trailer "), ldloc:InvalidOperationException[exp:object](var_41))))
}
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: 0x0600B15C RID: 45404 RVA: 0x00269A38 File Offset: 0x00267C38
[Token(Token = "0x600B15C")]
[Address(RVA = "0x189D7B0", Offset = "0x189C5B0", VA = "0x18189D7B0")]
private bool ReturnFalse(byte[] block)
{
this.messageLength = (int)((ulong)0L);
byte[] array = this.mBuf;
int length = array.Length;
int num = 0;
Array.Clear(array, num, length);
int length2 = block.Length;
int num2 = 0;
Array.Clear(block, num2, length2);
throw new NullReferenceException();
}
// Token: 0x0600B15D RID: 45405 RVA: 0x00269A84 File Offset: 0x00267C84
[Token(Token = "0x600B15D")]
[Address(RVA = "0x4508A0", Offset = "0x44F6A0", VA = "0x1804508A0", Slot = "22")]
public virtual bool HasFullMessage()
{
return this.fullMessage;
}
// Token: 0x040070E5 RID: 28901
[Token(Token = "0x40070E5")]
[Obsolete]
public const int TrailerImplicit = 188;
// Token: 0x040070E6 RID: 28902
[Token(Token = "0x40070E6")]
[Obsolete]
public const int TrailerRipeMD160 = 12748;
// Token: 0x040070E7 RID: 28903
[Token(Token = "0x40070E7")]
[Obsolete]
public const int TrailerRipeMD128 = 13004;
// Token: 0x040070E8 RID: 28904
[Token(Token = "0x40070E8")]
[Obsolete]
public const int TrailerSha1 = 13260;
// Token: 0x040070E9 RID: 28905
[Token(Token = "0x40070E9")]
[Obsolete]
public const int TrailerSha256 = 13516;
// Token: 0x040070EA RID: 28906
[Token(Token = "0x40070EA")]
[Obsolete]
public const int TrailerSha512 = 13772;
// Token: 0x040070EB RID: 28907
[Token(Token = "0x40070EB")]
[Obsolete]
public const int TrailerSha384 = 14028;
// Token: 0x040070EC RID: 28908
[Token(Token = "0x40070EC")]
[Obsolete]
public const int TrailerWhirlpool = 14284;
// Token: 0x040070ED RID: 28909
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40070ED")]
private IDigest digest;
// Token: 0x040070EE RID: 28910
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40070EE")]
private IAsymmetricBlockCipher cipher;
// Token: 0x040070EF RID: 28911
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40070EF")]
private int trailer;
// Token: 0x040070F0 RID: 28912
[FieldOffset(Offset = "0x24")]
[Token(Token = "0x40070F0")]
private int keyBits;
// Token: 0x040070F1 RID: 28913
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40070F1")]
private byte[] block;
// Token: 0x040070F2 RID: 28914
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40070F2")]
private byte[] mBuf;
// Token: 0x040070F3 RID: 28915
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40070F3")]
private int messageLength;
// Token: 0x040070F4 RID: 28916
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x40070F4")]
private bool fullMessage;
// Token: 0x040070F5 RID: 28917
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40070F5")]
private byte[] recoveredMessage;
// Token: 0x040070F6 RID: 28918
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40070F6")]
private byte[] preSig;
// Token: 0x040070F7 RID: 28919
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40070F7")]
private byte[] preBlock;
}
}
@@ -0,0 +1,108 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB6 RID: 7094
[Token(Token = "0x2001BB6")]
public class IsoTrailers
{
// Token: 0x0600B15E RID: 45406 RVA: 0x00269A98 File Offset: 0x00267C98
[Token(Token = "0x600B15E")]
[Address(RVA = "0x189E670", Offset = "0x189D470", VA = "0x18189E670")]
private static IDictionary CreateTrailerMap()
{
return CollectionUtilities.ReadOnly(Platform.CreateHashtable());
}
// Token: 0x0600B15F RID: 45407 RVA: 0x00269AB8 File Offset: 0x00267CB8
[Token(Token = "0x600B15F")]
[Address(RVA = "0x189E920", Offset = "0x189D720", VA = "0x18189E920")]
public static int GetTrailer(IDigest digest)
{
throw new NullReferenceException();
}
// Token: 0x0600B160 RID: 45408 RVA: 0x00269ACC File Offset: 0x00267CCC
[Token(Token = "0x600B160")]
[Address(RVA = "0x189E9F0", Offset = "0x189D7F0", VA = "0x18189E9F0")]
public static bool NoTrailerAvailable(IDigest digest)
{
int num = 0;
if (num < digest)
{
num += num;
num++;
}
bool flag;
return flag;
}
// Token: 0x0600B161 RID: 45409 RVA: 0x00269AF0 File Offset: 0x00267CF0
[Token(Token = "0x600B161")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public IsoTrailers()
{
}
// Token: 0x0600B162 RID: 45410 RVA: 0x00269B04 File Offset: 0x00267D04
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B162")]
[Address(RVA = "0x189EB00", Offset = "0x189D900", VA = "0x18189EB00")]
static IsoTrailers()
{
IDictionary dictionary = IsoTrailers.CreateTrailerMap();
}
// Token: 0x040070F8 RID: 28920
[Token(Token = "0x40070F8")]
public const int TRAILER_IMPLICIT = 188;
// Token: 0x040070F9 RID: 28921
[Token(Token = "0x40070F9")]
public const int TRAILER_RIPEMD160 = 12748;
// Token: 0x040070FA RID: 28922
[Token(Token = "0x40070FA")]
public const int TRAILER_RIPEMD128 = 13004;
// Token: 0x040070FB RID: 28923
[Token(Token = "0x40070FB")]
public const int TRAILER_SHA1 = 13260;
// Token: 0x040070FC RID: 28924
[Token(Token = "0x40070FC")]
public const int TRAILER_SHA256 = 13516;
// Token: 0x040070FD RID: 28925
[Token(Token = "0x40070FD")]
public const int TRAILER_SHA512 = 13772;
// Token: 0x040070FE RID: 28926
[Token(Token = "0x40070FE")]
public const int TRAILER_SHA384 = 14028;
// Token: 0x040070FF RID: 28927
[Token(Token = "0x40070FF")]
public const int TRAILER_WHIRLPOOL = 14284;
// Token: 0x04007100 RID: 28928
[Token(Token = "0x4007100")]
public const int TRAILER_SHA224 = 14540;
// Token: 0x04007101 RID: 28929
[Token(Token = "0x4007101")]
public const int TRAILER_SHA512_224 = 14796;
// Token: 0x04007102 RID: 28930
[Token(Token = "0x4007102")]
public const int TRAILER_SHA512_256 = 16588;
// Token: 0x04007103 RID: 28931
[Token(Token = "0x4007103")]
private static readonly IDictionary trailerMap;
}
}
@@ -0,0 +1,99 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB7 RID: 7095
[Token(Token = "0x2001BB7")]
public class PlainDsaEncoding : IDsaEncoding
{
// Token: 0x0600B163 RID: 45411 RVA: 0x00269B1C File Offset: 0x00267D1C
[Token(Token = "0x600B163")]
[Address(RVA = "0x189EC90", Offset = "0x189DA90", VA = "0x18189EC90", Slot = "6")]
public virtual BigInteger[] Decode(BigInteger n, byte[] encoding)
{
do
{
int unsignedByteLength = BigIntegers.GetUnsignedByteLength(n);
}
while (encoding.Length != n);
BigInteger[] array = new BigInteger[2];
BigInteger bigInteger;
if (bigInteger != 0)
{
}
array[0] = bigInteger;
BigInteger bigInteger2;
if (bigInteger2 != 0)
{
}
array[1] = bigInteger2;
return array;
}
// Token: 0x0600B164 RID: 45412 RVA: 0x00269B60 File Offset: 0x00267D60
[Token(Token = "0x600B164")]
[Address(RVA = "0x189EF70", Offset = "0x189DD70", VA = "0x18189EF70", Slot = "7")]
public virtual byte[] Encode(BigInteger n, BigInteger r, BigInteger s)
{
int num = 0;
int unsignedByteLength = BigIntegers.GetUnsignedByteLength(n);
return new byte[num];
}
// Token: 0x0600B165 RID: 45413 RVA: 0x00269B7C File Offset: 0x00267D7C
[Token(Token = "0x600B165")]
[Address(RVA = "0x189EB40", Offset = "0x189D940", VA = "0x18189EB40", Slot = "8")]
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
{
int num = x.CompareTo(n);
return x;
}
// Token: 0x0600B166 RID: 45414 RVA: 0x00269B98 File Offset: 0x00267D98
[Token(Token = "0x600B166")]
[Address(RVA = "0x189EBE0", Offset = "0x189D9E0", VA = "0x18189EBE0", Slot = "9")]
protected virtual BigInteger DecodeValue(BigInteger n, byte[] buf, int off, int len)
{
BigInteger bigInteger;
return bigInteger;
}
// Token: 0x0600B167 RID: 45415 RVA: 0x00269BA8 File Offset: 0x00267DA8
[Token(Token = "0x600B167")]
[Address(RVA = "0x189EE40", Offset = "0x189DC40", VA = "0x18189EE40", Slot = "10")]
protected virtual void EncodeValue(BigInteger n, BigInteger x, byte[] buf, int off, int len)
{
byte[] array;
int length = array.Length;
int num = Math.Max(0, length);
int num2 = array.Length;
num2 -= num;
ulong num3;
ulong num4;
Array.Copy(array, num, buf, (int)num3, (int)num4);
}
// Token: 0x0600B168 RID: 45416 RVA: 0x00269BE4 File Offset: 0x00267DE4
[Token(Token = "0x600B168")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public PlainDsaEncoding()
{
}
// Token: 0x0600B169 RID: 45417 RVA: 0x00269BF8 File Offset: 0x00267DF8
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B169")]
[Address(RVA = "0x189F050", Offset = "0x189DE50", VA = "0x18189F050")]
static PlainDsaEncoding()
{
PlainDsaEncoding plainDsaEncoding = new PlainDsaEncoding();
}
// Token: 0x04007104 RID: 28932
[Token(Token = "0x4007104")]
public static readonly PlainDsaEncoding Instance;
}
}
@@ -0,0 +1,469 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB8 RID: 7096
[Token(Token = "0x2001BB8")]
public class PssSigner : ISigner
{
// Token: 0x0600B16A RID: 45418 RVA: 0x00269C0C File Offset: 0x00267E0C
[Token(Token = "0x600B16A")]
[Address(RVA = "0x189F130", Offset = "0x189DF30", VA = "0x18189F130")]
public static PssSigner CreateRawSigner(IAsymmetricBlockCipher cipher, IDigest digest)
{
NullDigest nullDigest = new NullDigest();
PssSigner pssSigner;
pssSigner.cipher = cipher;
pssSigner.contentDigest1 = nullDigest;
pssSigner.contentDigest2 = digest;
pssSigner.mgfDigest = digest;
pssSigner.hLen = pssSigner;
pssSigner.mgfhLen = pssSigner;
pssSigner.sLen = nullDigest;
pssSigner.sSet = false;
byte[] array = new byte[nullDigest];
pssSigner.salt = array;
byte[] array2 = new byte[nullDigest];
pssSigner.mDash = array2;
pssSigner.trailer = (byte)((ulong)188L);
return pssSigner;
}
// Token: 0x0600B16B RID: 45419 RVA: 0x00269C88 File Offset: 0x00267E88
[Token(Token = "0x600B16B")]
[Address(RVA = "0x189F270", Offset = "0x189E070", VA = "0x18189F270")]
public static PssSigner CreateRawSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, int saltLen, byte trailer)
{
NullDigest nullDigest = new NullDigest();
PssSigner pssSigner;
pssSigner.cipher = cipher;
pssSigner.contentDigest1 = nullDigest;
pssSigner.contentDigest2 = contentDigest;
pssSigner.mgfDigest = mgfDigest;
pssSigner.hLen = pssSigner;
pssSigner.mgfhLen = pssSigner;
pssSigner.sLen = saltLen;
pssSigner.sSet = false;
byte[] array = new byte[saltLen];
pssSigner.salt = array;
byte[] array2 = new byte[saltLen];
pssSigner.mDash = array2;
pssSigner.trailer = 0;
return pssSigner;
}
// Token: 0x0600B16C RID: 45420 RVA: 0x00269D00 File Offset: 0x00267F00
[Token(Token = "0x600B16C")]
[Address(RVA = "0x18A0540", Offset = "0x189F340", VA = "0x1818A0540")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest)
{
}
// Token: 0x0600B16D RID: 45421 RVA: 0x00269D14 File Offset: 0x00267F14
[Token(Token = "0x600B16D")]
[Address(RVA = "0x18A0510", Offset = "0x189F310", VA = "0x1818A0510")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen)
{
}
// Token: 0x0600B16E RID: 45422 RVA: 0x00269D24 File Offset: 0x00267F24
[Token(Token = "0x600B16E")]
[Address(RVA = "0x18A04A0", Offset = "0x189F2A0", VA = "0x1818A04A0")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, byte[] salt)
{
int length = salt.Length;
}
// Token: 0x0600B16F RID: 45423 RVA: 0x00269D40 File Offset: 0x00267F40
[Token(Token = "0x600B16F")]
[Address(RVA = "0x18A04E0", Offset = "0x189F2E0", VA = "0x1818A04E0")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, int saltLen)
{
}
// Token: 0x0600B170 RID: 45424 RVA: 0x00269D50 File Offset: 0x00267F50
[Token(Token = "0x600B170")]
[Address(RVA = "0x18A0450", Offset = "0x189F250", VA = "0x1818A0450")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, byte[] salt)
{
}
// Token: 0x0600B171 RID: 45425 RVA: 0x00269D64 File Offset: 0x00267F64
[Token(Token = "0x600B171")]
[Address(RVA = "0x18A0510", Offset = "0x189F310", VA = "0x1818A0510")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen, byte trailer)
{
}
// Token: 0x0600B172 RID: 45426 RVA: 0x00269D74 File Offset: 0x00267F74
[Token(Token = "0x600B172")]
[Address(RVA = "0x18A0360", Offset = "0x189F160", VA = "0x1818A0360")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, int saltLen, byte trailer)
{
this.cipher = cipher;
this.contentDigest1 = contentDigest;
this.contentDigest2 = contentDigest;
this.mgfDigest = mgfDigest;
this.sLen = 0;
this.sSet = false;
byte[] array = new byte[0];
this.salt = array;
byte[] array2 = new byte[0];
this.mDash = array2;
this.trailer = 0;
}
// Token: 0x0600B173 RID: 45427 RVA: 0x00269DDC File Offset: 0x00267FDC
[Token(Token = "0x600B173")]
[Address(RVA = "0x18A05D0", Offset = "0x189F3D0", VA = "0x1818A05D0")]
private PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest1, IDigest contentDigest2, IDigest mgfDigest, int saltLen, byte[] salt, byte trailer)
{
this.contentDigest1 = contentDigest1;
this.mgfDigest = 0;
this.cipher = cipher;
this.contentDigest2 = contentDigest2;
this.sLen = 0;
bool flag;
this.sSet = flag;
byte[] array = new byte[0];
this.salt = 0;
byte[] array2 = new byte[0];
this.mDash = array2;
this.trailer = 0;
}
// Token: 0x17001BEB RID: 7147
// (get) Token: 0x0600B174 RID: 45428 RVA: 0x00269E44 File Offset: 0x00268044
[Token(Token = "0x17001BEB")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B174")]
[Address(RVA = "0x18A06D0", Offset = "0x189F4D0", VA = "0x1818A06D0", Slot = "11")]
get
{
IDigest digest = this.mgfDigest;
return 0 + "withRSAandMGF1";
}
}
// Token: 0x0600B175 RID: 45429 RVA: 0x00269E6C File Offset: 0x0026806C
[Token(Token = "0x600B175")]
[Address(RVA = "0x189F6F0", Offset = "0x189E4F0", VA = "0x18189F6F0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
do
{
if (parameters != 0 && parameters != 0)
{
if (parameters == 0)
{
continue;
}
this.random = parameters;
}
if (forSigning)
{
SecureRandom secureRandom = new SecureRandom();
this.random = secureRandom;
}
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
}
while ((parameters == 0 && parameters == 0) || parameters == 0 || parameters == 0);
int num = 0;
int num3;
int num2 = num3 - 1;
int num4 = this.sLen;
this.emBits = num2;
num += num4;
byte[] array = new byte[num];
this.block = array;
}
// Token: 0x0600B176 RID: 45430 RVA: 0x00269EFC File Offset: 0x002680FC
[Token(Token = "0x600B176")]
[Address(RVA = "0x189B390", Offset = "0x189A190", VA = "0x18189B390")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B177 RID: 45431 RVA: 0x00269F20 File Offset: 0x00268120
[Token(Token = "0x600B177")]
[Address(RVA = "0x189FEB0", Offset = "0x189ECB0", VA = "0x18189FEB0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.contentDigest1;
throw new NullReferenceException();
}
// Token: 0x0600B178 RID: 45432 RVA: 0x00269F3C File Offset: 0x0026813C
[Token(Token = "0x600B178")]
[Address(RVA = "0x189F0B0", Offset = "0x189DEB0", VA = "0x18189F0B0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.contentDigest1;
}
// Token: 0x0600B179 RID: 45433 RVA: 0x00269F58 File Offset: 0x00268158
[Token(Token = "0x600B179")]
[Address(RVA = "0x189FE60", Offset = "0x189EC60", VA = "0x18189FE60", Slot = "15")]
public virtual void Reset()
{
IDigest digest = this.contentDigest1;
throw new NullReferenceException();
}
// Token: 0x0600B17A RID: 45434 RVA: 0x00269F74 File Offset: 0x00268174
[Token(Token = "0x600B17A")]
[Address(RVA = "0x189F3B0", Offset = "0x189E1B0", VA = "0x18189F3B0", Slot = "16")]
public virtual byte[] GenerateSignature()
{
byte[] array = this.mDash;
IDigest digest = this.contentDigest1;
int length = array.Length;
if (this.sLen != 0)
{
if (!this.sSet)
{
double num = this.random.NextDouble();
}
byte[] array2 = this.mDash;
byte[] array3 = this.salt;
int length2 = array2.Length;
}
byte[] array4 = new byte[this.hLen];
byte[] array5 = this.mDash;
IDigest digest2 = this.contentDigest2;
int length3 = array5.Length;
int num2 = 0;
IDigest digest3 = this.contentDigest2;
int length4 = this.block.Length;
byte[] array6 = this.block;
byte[] array7 = this.salt;
int length5 = array6.Length;
int length6 = this.block.Length;
int num3 = 0;
int length7 = array4.Length;
int length8 = this.MaskGeneratorFunction1(array4, num3, length7, length6).Length;
byte[] array8 = this.block;
if (num2 != length8)
{
num2++;
}
int length9 = array8.Length;
int length10 = this.block.Length;
int length11 = this.block.Length;
byte b = this.trailer;
int num4 = length11 - 1;
byte[] array9 = this.block;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length12 = array9.Length;
byte[] array10 = this.block;
int length13 = array10.Length;
int num5 = 0;
Array.Clear(array10, num5, length13);
throw new NullReferenceException();
}
// Token: 0x0600B17B RID: 45435 RVA: 0x0026A0D4 File Offset: 0x002682D4
[Token(Token = "0x600B17B")]
[Address(RVA = "0x189FF10", Offset = "0x189ED10", VA = "0x18189FF10", Slot = "17")]
public virtual bool VerifySignature(byte[] signature)
{
byte[] array = this.mDash;
IDigest digest = this.contentDigest1;
int length = array.Length;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length2 = signature.Length;
int num = 0;
int length3 = this.block.Length;
byte[] array2 = this.block;
int num2 = array2.Length;
int num3 = num2 - 1;
byte b = this.trailer;
int num4 = this.hLen;
num2 -= num4;
int num5 = this.MaskGeneratorFunction1(array2, num2, num4, num2).Length;
byte[] array3 = this.block;
if (num != num5)
{
num++;
}
int length4 = array3.Length;
byte[] array4 = this.block;
int num6 = array4.Length;
num5 = num6;
int num7 = this.hLen;
num5 -= num7;
int num8 = this.sLen;
num5 -= num8;
num5 += -2;
int num9;
if (num != num5)
{
num++;
num9 = 0;
int num10 = 0;
Array.Clear(array4, num10, num6);
}
num6 -= num7;
num6 -= num8;
num9 -= num8;
num6 = num8;
int num11 = array4.Length;
num11 -= num8;
int num12 = num11 - 1;
num12 += num6;
if (num6 != num8)
{
num6++;
num12++;
}
throw new NullReferenceException();
}
// Token: 0x0600B17C RID: 45436 RVA: 0x0026A228 File Offset: 0x00268428
[Token(Token = "0x600B17C")]
[Address(RVA = "0x189BD10", Offset = "0x189AB10", VA = "0x18189BD10")]
private void ItoOSP(int i, byte[] sp)
{
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
}
// Token: 0x0600B17D RID: 45437 RVA: 0x0026A25C File Offset: 0x0026845C
[Token(Token = "0x600B17D")]
[Address(RVA = "0x189F9C0", Offset = "0x189E7C0", VA = "0x18189F9C0")]
private byte[] MaskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length)
{
byte[] array = new byte[0];
byte[] array2 = new byte[this.mgfhLen];
byte[] array3 = new byte[4];
IDigest digest = this.mgfDigest;
int num = 0;
int num2 = this.mgfhLen;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
IDigest digest2 = this.mgfDigest;
int num3 = 0;
if (num3 < digest)
{
num3 += num3;
num3++;
}
IDigest digest3 = this.mgfDigest;
int num4 = 0;
num4 += num4;
num4++;
int num5 = 0;
IDigest digest4 = this.mgfDigest;
int num6 = 0;
if (num6 < num5)
{
num6 += num6;
num6++;
}
int num7 = this.mgfhLen * num;
num++;
int num8 = num2 * num;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
array3[0] = (byte)num;
IDigest digest5 = this.mgfDigest;
IDigest digest6 = this.mgfDigest;
int length2 = array3.Length;
IDigest digest7 = this.mgfDigest;
int num9 = this.mgfhLen;
int num10 = array.Length;
int num11 = 0;
int num12 = num9 * num;
num10 -= num12;
Array.Copy(array2, num11, array, num12, num10);
return array;
}
// Token: 0x04007105 RID: 28933
[Token(Token = "0x4007105")]
public const byte TrailerImplicit = 188;
// Token: 0x04007106 RID: 28934
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007106")]
private readonly IDigest contentDigest1;
// Token: 0x04007107 RID: 28935
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007107")]
private readonly IDigest contentDigest2;
// Token: 0x04007108 RID: 28936
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007108")]
private readonly IDigest mgfDigest;
// Token: 0x04007109 RID: 28937
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007109")]
private readonly IAsymmetricBlockCipher cipher;
// Token: 0x0400710A RID: 28938
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400710A")]
private SecureRandom random;
// Token: 0x0400710B RID: 28939
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400710B")]
private int hLen;
// Token: 0x0400710C RID: 28940
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x400710C")]
private int mgfhLen;
// Token: 0x0400710D RID: 28941
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400710D")]
private int sLen;
// Token: 0x0400710E RID: 28942
[FieldOffset(Offset = "0x44")]
[Token(Token = "0x400710E")]
private bool sSet;
// Token: 0x0400710F RID: 28943
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x400710F")]
private int emBits;
// Token: 0x04007110 RID: 28944
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007110")]
private byte[] salt;
// Token: 0x04007111 RID: 28945
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007111")]
private byte[] mDash;
// Token: 0x04007112 RID: 28946
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007112")]
private byte[] block;
// Token: 0x04007113 RID: 28947
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4007113")]
private byte trailer;
}
}
@@ -0,0 +1,89 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BB9 RID: 7097
[Token(Token = "0x2001BB9")]
public class RandomDsaKCalculator : IDsaKCalculator
{
// Token: 0x17001BEC RID: 7148
// (get) Token: 0x0600B17E RID: 45438 RVA: 0x0026A3A8 File Offset: 0x002685A8
[Token(Token = "0x17001BEC")]
public virtual bool IsDeterministic
{
[Token(Token = "0x600B17E")]
[Address(RVA = "0x403930", Offset = "0x402730", VA = "0x180403930", Slot = "8")]
get
{
}
}
// Token: 0x0600B17F RID: 45439 RVA: 0x0026A3B8 File Offset: 0x002685B8
[Token(Token = "0x600B17F")]
[Address(RVA = "0x18A0730", Offset = "0x189F530", VA = "0x1818A0730", Slot = "9")]
public virtual void Init(BigInteger n, SecureRandom random)
{
this.q = n;
this.random = random;
}
// Token: 0x0600B180 RID: 45440 RVA: 0x0026A3D4 File Offset: 0x002685D4
[Token(Token = "0x600B180")]
[Address(RVA = "0x18A0740", Offset = "0x189F540", VA = "0x1818A0740", Slot = "10")]
public virtual void Init(BigInteger n, BigInteger d, byte[] message)
{
/*
An exception occurred when decompiling this method (0600B180)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.RandomDsaKCalculator::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,BestHTTP.SecureProtocol.Org.BouncyCastle.Math.BigInteger,System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:InvalidOperationException(var_0_0A, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Operation not 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: 0x0600B181 RID: 45441 RVA: 0x0026A3EC File Offset: 0x002685EC
[Token(Token = "0x600B181")]
[Address(RVA = "0x18A07A0", Offset = "0x189F5A0", VA = "0x1818A07A0", Slot = "11")]
public virtual BigInteger NextK()
{
int bitLength = this.q.BitLength;
SecureRandom secureRandom = this.random;
BigInteger bigInteger = new BigInteger(bitLength, secureRandom);
BigInteger bigInteger2 = this.q;
int num = bigInteger.CompareTo(bigInteger2);
return bigInteger;
}
// Token: 0x0600B182 RID: 45442 RVA: 0x0026A42C File Offset: 0x0026862C
[Token(Token = "0x600B182")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public RandomDsaKCalculator()
{
}
// Token: 0x04007114 RID: 28948
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007114")]
private BigInteger q;
// Token: 0x04007115 RID: 28949
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007115")]
private SecureRandom random;
}
}
@@ -0,0 +1,273 @@
using System;
using System.Collections;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BBA RID: 7098
[Token(Token = "0x2001BBA")]
public class RsaDigestSigner : ISigner
{
// Token: 0x0600B183 RID: 45443 RVA: 0x0026A440 File Offset: 0x00268640
[Token(Token = "0x600B183")]
[Address(RVA = "0x18A1500", Offset = "0x18A0300", VA = "0x1818A1500")]
static RsaDigestSigner()
{
IDictionary dictionary = RsaDigestSigner.oidMap;
DerObjectIdentifier ripeMD = TeleTrusTObjectIdentifiers.RipeMD128;
IDictionary dictionary2 = RsaDigestSigner.oidMap;
DerObjectIdentifier ripeMD2 = TeleTrusTObjectIdentifiers.RipeMD160;
IDictionary dictionary3 = RsaDigestSigner.oidMap;
DerObjectIdentifier ripeMD3 = TeleTrusTObjectIdentifiers.RipeMD256;
IDictionary dictionary4 = RsaDigestSigner.oidMap;
DerObjectIdentifier idSha = X509ObjectIdentifiers.IdSha1;
IDictionary dictionary5 = RsaDigestSigner.oidMap;
DerObjectIdentifier idSha2 = NistObjectIdentifiers.IdSha224;
IDictionary dictionary6 = RsaDigestSigner.oidMap;
DerObjectIdentifier idSha3 = NistObjectIdentifiers.IdSha256;
IDictionary dictionary7 = RsaDigestSigner.oidMap;
DerObjectIdentifier idSha4 = NistObjectIdentifiers.IdSha384;
IDictionary dictionary8 = RsaDigestSigner.oidMap;
DerObjectIdentifier idSha5 = NistObjectIdentifiers.IdSha512;
IDictionary dictionary9 = RsaDigestSigner.oidMap;
DerObjectIdentifier md = PkcsObjectIdentifiers.MD2;
IDictionary dictionary10 = RsaDigestSigner.oidMap;
DerObjectIdentifier md2 = PkcsObjectIdentifiers.MD4;
IDictionary dictionary11 = RsaDigestSigner.oidMap;
DerObjectIdentifier md3 = PkcsObjectIdentifiers.MD5;
}
// Token: 0x0600B184 RID: 45444 RVA: 0x0026A4F8 File Offset: 0x002686F8
[Token(Token = "0x600B184")]
[Address(RVA = "0x18A1BD0", Offset = "0x18A09D0", VA = "0x1818A1BD0")]
public RsaDigestSigner(IDigest digest)
{
IDictionary dictionary = RsaDigestSigner.oidMap;
IDictionary dictionary2 = RsaDigestSigner.oidMap;
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B185 RID: 45445 RVA: 0x0026A524 File Offset: 0x00268724
[Token(Token = "0x600B185")]
[Address(RVA = "0x18A1DB0", Offset = "0x18A0BB0", VA = "0x1818A1DB0")]
public RsaDigestSigner(IDigest digest, DerObjectIdentifier digestOid)
{
DerNull instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B186 RID: 45446 RVA: 0x0026A548 File Offset: 0x00268748
[Token(Token = "0x600B186")]
[Address(RVA = "0x18A19B0", Offset = "0x18A07B0", VA = "0x1818A19B0")]
public RsaDigestSigner(IDigest digest, AlgorithmIdentifier algId)
{
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B187 RID: 45447 RVA: 0x0026A55C File Offset: 0x0026875C
[Token(Token = "0x600B187")]
[Address(RVA = "0x18A1B00", Offset = "0x18A0900", VA = "0x1818A1B00")]
public RsaDigestSigner(IRsa rsa, IDigest digest, DerObjectIdentifier digestOid)
{
DerNull instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
}
// Token: 0x0600B188 RID: 45448 RVA: 0x0026A578 File Offset: 0x00268778
[Token(Token = "0x600B188")]
[Address(RVA = "0x18A1A30", Offset = "0x18A0830", VA = "0x1818A1A30")]
public RsaDigestSigner(IRsa rsa, IDigest digest, AlgorithmIdentifier algId)
{
RsaBlindedEngine rsaBlindedEngine = new RsaBlindedEngine(rsa);
int num = 0;
int num2 = 0;
base.FieldGetter(num2, num, algId);
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(rsaBlindedEngine);
this.rsaEngine = pkcs1Encoding;
this.algId = algId;
this.digest = digest;
}
// Token: 0x0600B189 RID: 45449 RVA: 0x0026A5B8 File Offset: 0x002687B8
[Token(Token = "0x600B189")]
[Address(RVA = "0x18A1920", Offset = "0x18A0720", VA = "0x1818A1920")]
public RsaDigestSigner(IAsymmetricBlockCipher rsaEngine, IDigest digest, AlgorithmIdentifier algId)
{
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(rsaEngine);
this.rsaEngine = pkcs1Encoding;
this.digest = digest;
this.algId = algId;
}
// Token: 0x17001BED RID: 7149
// (get) Token: 0x0600B18A RID: 45450 RVA: 0x0026A5E8 File Offset: 0x002687E8
[Token(Token = "0x17001BED")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B18A")]
[Address(RVA = "0x18A1EB0", Offset = "0x18A0CB0", VA = "0x1818A1EB0", Slot = "11")]
get
{
IDigest digest = this.digest;
return 0 + "withRSA";
}
}
// Token: 0x0600B18B RID: 45451 RVA: 0x0026A610 File Offset: 0x00268810
[Token(Token = "0x600B18B")]
[Address(RVA = "0x18A0EE0", Offset = "0x189FCE0", VA = "0x1818A0EE0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B18B)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.RsaDigestSigner::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_4C:
stloc:InvalidKeyException(var_8_56, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Signing requires private key.")))
stloc:InvalidKeyException(var_9_62, newobj:InvalidKeyException(InvalidKeyException::.ctor, ldstr:string("Verification requires public key.")))
}
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: 0x0600B18C RID: 45452 RVA: 0x0026A680 File Offset: 0x00268880
[Token(Token = "0x600B18C")]
[Address(RVA = "0x18A11B0", Offset = "0x189FFB0", VA = "0x1818A11B0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B18D RID: 45453 RVA: 0x0026A69C File Offset: 0x0026889C
[Token(Token = "0x600B18D")]
[Address(RVA = "0x18A0CC0", Offset = "0x189FAC0", VA = "0x1818A0CC0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B18E RID: 45454 RVA: 0x0026A6B8 File Offset: 0x002688B8
[Token(Token = "0x600B18E")]
[Address(RVA = "0x18A0DD0", Offset = "0x189FBD0", VA = "0x1818A0DD0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B18E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.RsaDigestSigner::GenerateSignature()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3B:
stloc:InvalidOperationException(var_8_45, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("RsaDigestSigner not initialised for signature generation.")))
}
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: 0x0600B18F RID: 45455 RVA: 0x0026A70C File Offset: 0x0026890C
[Token(Token = "0x600B18F")]
[Address(RVA = "0x18A1210", Offset = "0x18A0010", VA = "0x1818A1210", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B18F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.RsaDigestSigner::VerifySignature(System.Byte[])
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_6A:
stloc:InvalidOperationException(var_10_74, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("RsaDigestSigner not initialised for verification")))
}
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: 0x0600B190 RID: 45456 RVA: 0x0026A790 File Offset: 0x00268990
[Token(Token = "0x600B190")]
[Address(RVA = "0x18A1160", Offset = "0x189FF60", VA = "0x1818A1160", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B191 RID: 45457 RVA: 0x0026A7AC File Offset: 0x002689AC
[Token(Token = "0x600B191")]
[Address(RVA = "0x18A0D40", Offset = "0x189FB40", VA = "0x1818A0D40")]
private byte[] DerEncode(byte[] hash)
{
AlgorithmIdentifier algorithmIdentifier = this.algId;
if (algorithmIdentifier != 0)
{
return new DigestInfo(algorithmIdentifier, hash).GetDerEncoded();
}
return hash;
}
// Token: 0x04007116 RID: 28950
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007116")]
private readonly IAsymmetricBlockCipher rsaEngine;
// Token: 0x04007117 RID: 28951
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007117")]
private readonly AlgorithmIdentifier algId;
// Token: 0x04007118 RID: 28952
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007118")]
private readonly IDigest digest;
// Token: 0x04007119 RID: 28953
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007119")]
private bool forSigning;
// Token: 0x0400711A RID: 28954
[Token(Token = "0x400711A")]
private static readonly IDictionary oidMap = Platform.CreateHashtable();
}
}
@@ -0,0 +1,365 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
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.Math.EC.Multiplier;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BBB RID: 7099
[Token(Token = "0x2001BBB")]
public class SM2Signer : ISigner
{
// Token: 0x0600B192 RID: 45458 RVA: 0x0026A7D8 File Offset: 0x002689D8
[Token(Token = "0x600B192")]
[Address(RVA = "0x18A3310", Offset = "0x18A2110", VA = "0x1818A3310")]
public SM2Signer()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
SM3Digest sm3Digest = new SM3Digest();
this.digest = sm3Digest;
base..ctor();
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
}
// Token: 0x0600B193 RID: 45459 RVA: 0x0026A810 File Offset: 0x00268A10
[Token(Token = "0x600B193")]
[Address(RVA = "0x18A33C0", Offset = "0x18A21C0", VA = "0x1818A33C0")]
public SM2Signer(IDsaEncoding encoding)
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
SM3Digest sm3Digest = new SM3Digest();
this.digest = sm3Digest;
base..ctor();
this.encoding = encoding;
}
// Token: 0x17001BEE RID: 7150
// (get) Token: 0x0600B194 RID: 45460 RVA: 0x0026A844 File Offset: 0x00268A44
[Token(Token = "0x17001BEE")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B194")]
[Address(RVA = "0x18A3450", Offset = "0x18A2250", VA = "0x1818A3450", Slot = "11")]
get
{
return "SM2Sign";
}
}
// Token: 0x0600B195 RID: 45461 RVA: 0x0026A858 File Offset: 0x00268A58
[Token(Token = "0x600B195")]
[Address(RVA = "0x18A2900", Offset = "0x18A1700", VA = "0x1818A2900", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
byte[] array;
ECKeyParameters eckeyParameters;
for (;;)
{
if (parameters == 0 || parameters == 0 || (parameters != 0 && parameters != 0 && parameters != 0 && parameters != 0))
{
array = Hex.Decode("31323334353637383132333435363738");
if (!forSigning)
{
if (parameters == 0)
{
}
int num = 0;
if (parameters == 0)
{
continue;
}
this.ecKey = parameters;
this.ecParams = num;
if (parameters == 0 || parameters == 0)
{
continue;
}
}
int num2;
if (parameters != 0)
{
if ((parameters == 0 && parameters == 0) || parameters == 0)
{
continue;
}
num2 = 0;
this.ecParams = num2;
IDsaKCalculator dsaKCalculator = this.kCalculator;
}
int num3 = 0;
this.ecKey = num3;
IDsaKCalculator dsaKCalculator2 = this.kCalculator;
this.ecParams = num2;
SecureRandom secureRandom = new SecureRandom();
ECDomainParameters ecdomainParameters = this.ecParams;
eckeyParameters = this.ecKey;
if (eckeyParameters != 0 && eckeyParameters != 0)
{
break;
}
}
}
this.pubPoint = eckeyParameters;
SM3Digest sm3Digest = this.digest;
byte[] array2 = this.GetZ(array);
this.z = array2;
SM3Digest sm3Digest2 = this.digest;
int length = array2.Length;
int num4 = 0;
sm3Digest2.BlockUpdate(array2, num4, length);
}
// Token: 0x0600B196 RID: 45462 RVA: 0x0026A984 File Offset: 0x00268B84
[Token(Token = "0x600B196")]
[Address(RVA = "0x18A2F40", Offset = "0x18A1D40", VA = "0x1818A2F40", Slot = "13")]
public virtual void Update(byte b)
{
this.digest.Update(b);
}
// Token: 0x0600B197 RID: 45463 RVA: 0x0026A9A4 File Offset: 0x00268BA4
[Token(Token = "0x600B197")]
[Address(RVA = "0x18A2050", Offset = "0x18A0E50", VA = "0x1818A2050", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
this.digest.BlockUpdate(buf, off, len);
}
// Token: 0x0600B198 RID: 45464 RVA: 0x0026A9C8 File Offset: 0x00268BC8
[Token(Token = "0x600B198")]
[Address(RVA = "0x18A2F60", Offset = "0x18A1D60", VA = "0x1818A2F60", Slot = "15")]
public virtual bool VerifySignature(byte[] signature)
{
IDsaEncoding dsaEncoding = this.encoding;
byte[] seed = this.ecParams.seed;
bool flag;
return flag;
}
// Token: 0x0600B199 RID: 45465 RVA: 0x0026AA0C File Offset: 0x00268C0C
[Token(Token = "0x600B199")]
[Address(RVA = "0x18A2EE0", Offset = "0x18A1CE0", VA = "0x1818A2EE0", Slot = "16")]
public virtual void Reset()
{
if (this.z != (ulong)0L)
{
SM3Digest sm3Digest = this.digest;
byte[] array = this.z;
SM3Digest sm3Digest2 = this.digest;
int length = array.Length;
int num = 0;
sm3Digest2.BlockUpdate(array, num, length);
}
}
// Token: 0x0600B19A RID: 45466 RVA: 0x0026AA54 File Offset: 0x00268C54
[Token(Token = "0x600B19A")]
[Address(RVA = "0x18A2130", Offset = "0x18A0F30", VA = "0x1818A2130", Slot = "17")]
public virtual byte[] GenerateSignature()
{
for (;;)
{
byte[] array = DigestUtilities.DoFinal(this.digest);
BigInteger n = this.ecParams.n;
ECKeyParameters eckeyParameters = this.ecKey;
if ("{il2cpp array field local3->}" == typeof(ECPrivateKeyParameters).TypeHandle)
{
}
if (eckeyParameters != 0)
{
int num = 0;
if (eckeyParameters != 0)
{
int num2 = 0;
IDsaKCalculator dsaKCalculator = this.kCalculator;
if (num2 < num)
{
num2 += num2;
num2++;
}
ECDomainParameters ecdomainParameters = this.ecParams;
int num3 = 0;
uint num4;
if (num3 < (int)num4)
{
num3 += num3;
num3++;
}
char c;
string text = c.ToString();
BigInteger bigInteger2;
BigInteger bigInteger = bigInteger2.Mod(n);
while (bigInteger.sign == 0)
{
}
if (bigInteger.Add(num2) == 0)
{
BigInteger one = BigInteger.One;
BigInteger bigInteger4;
BigInteger bigInteger3 = bigInteger4.ModInverse(n);
BigInteger bigInteger5 = bigInteger.Multiply(n);
BigInteger bigInteger7;
BigInteger bigInteger6 = bigInteger7.Mod(n);
if (bigInteger3.Multiply(bigInteger6).Mod(n).sign != 0)
{
break;
}
}
}
}
}
IDsaEncoding dsaEncoding = this.encoding;
ECDomainParameters ecdomainParameters2 = this.ecParams;
throw new NullReferenceException();
}
// Token: 0x0600B19B RID: 45467 RVA: 0x0026AB68 File Offset: 0x00268D68
[Token(Token = "0x600B19B")]
[Address(RVA = "0x18A3050", Offset = "0x18A1E50", VA = "0x1818A3050")]
private bool VerifySignature(BigInteger r, BigInteger s)
{
BigInteger n = this.ecParams.n;
BigInteger one = BigInteger.One;
int num = r.CompareTo(one);
int num2 = r.CompareTo(n);
BigInteger one2 = BigInteger.One;
int num3 = s.CompareTo(one2);
int num4 = s.CompareTo(n);
byte[] array = DigestUtilities.DoFinal(this.digest);
byte[] array2 = this.GenerateSignature();
BigInteger bigInteger = r.Add(s);
int num5 = 0;
BigInteger bigInteger2 = bigInteger.Mod(n);
if (bigInteger2.sign != 0)
{
bool flag = ECAlgorithms.SumOfTwoMultiplies(this.ecParams.g, s, num5, bigInteger2).IsNormalized();
bool flag2;
if (!flag2)
{
sbyte b;
string text = b.ToString();
BigInteger bigInteger4;
BigInteger bigInteger3 = bigInteger4.Mod(n);
}
}
throw new NullReferenceException();
}
// Token: 0x0600B19C RID: 45468 RVA: 0x0026AC20 File Offset: 0x00268E20
[Token(Token = "0x600B19C")]
[Address(RVA = "0x18A2690", Offset = "0x18A1490", VA = "0x1818A2690")]
private byte[] GetZ(byte[] userID)
{
SM3Digest sm3Digest = this.digest;
int length = userID.Length;
IFiniteField field = this.ecParams.curve.Field;
ECDomainParameters ecdomainParameters = this.ecParams;
SM3Digest sm3Digest2 = this.digest;
ECFieldElement a = ecdomainParameters.curve.A;
this.AddFieldElement(sm3Digest2, a);
int curveCoordinateSystem = this.ecParams.g.CurveCoordinateSystem;
ECDomainParameters ecdomainParameters2 = this.ecParams;
SM3Digest sm3Digest3 = this.digest;
ECFieldElement affineXCoord = ecdomainParameters2.g.AffineXCoord;
this.AddFieldElement(sm3Digest3, affineXCoord);
int curveCoordinateSystem2 = this.pubPoint.CurveCoordinateSystem;
ECPoint ecpoint = this.pubPoint;
SM3Digest sm3Digest4 = this.digest;
ECFieldElement affineXCoord2 = ecpoint.AffineXCoord;
this.AddFieldElement(sm3Digest4, affineXCoord2);
return DigestUtilities.DoFinal(this.digest);
}
// Token: 0x0600B19D RID: 45469 RVA: 0x0026ACF0 File Offset: 0x00268EF0
[Token(Token = "0x600B19D")]
[Address(RVA = "0x18A1FA0", Offset = "0x18A0DA0", VA = "0x1818A1FA0")]
private void AddUserID(IDigest digest, byte[] userID)
{
int length = userID.Length;
}
// Token: 0x0600B19E RID: 45470 RVA: 0x0026AD0C File Offset: 0x00268F0C
[Token(Token = "0x600B19E")]
[Address(RVA = "0x18A1F10", Offset = "0x18A0D10", VA = "0x1818A1F10")]
private void AddFieldElement(IDigest digest, ECFieldElement v)
{
}
// Token: 0x0600B19F RID: 45471 RVA: 0x0026AD20 File Offset: 0x00268F20
[Token(Token = "0x600B19F")]
[Address(RVA = "0x18A2080", Offset = "0x18A0E80", VA = "0x1818A2080", Slot = "18")]
protected virtual BigInteger CalculateE(byte[] message)
{
return new BigInteger(1, message);
}
// Token: 0x0600B1A0 RID: 45472 RVA: 0x0026AD34 File Offset: 0x00268F34
[Token(Token = "0x600B1A0")]
[Address(RVA = "0x18A20E0", Offset = "0x18A0EE0", VA = "0x1818A20E0", Slot = "19")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B1A0)
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier.ECMultiplier BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.SM2Signer::CreateBasePointMultiplier()
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:FixedPointCombMultiplier(var_0_05, newobj:FixedPointCombMultiplier(FixedPointCombMultiplier::.ctor))
}
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: 0x0400711B RID: 28955
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400711B")]
private readonly IDsaKCalculator kCalculator;
// Token: 0x0400711C RID: 28956
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400711C")]
private readonly SM3Digest digest;
// Token: 0x0400711D RID: 28957
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400711D")]
private readonly IDsaEncoding encoding;
// Token: 0x0400711E RID: 28958
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400711E")]
private ECDomainParameters ecParams;
// Token: 0x0400711F RID: 28959
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400711F")]
private ECPoint pubPoint;
// Token: 0x04007120 RID: 28960
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007120")]
private ECKeyParameters ecKey;
// Token: 0x04007121 RID: 28961
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007121")]
private byte[] z;
}
}
@@ -0,0 +1,95 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BBC RID: 7100
[Token(Token = "0x2001BBC")]
public class StandardDsaEncoding : IDsaEncoding
{
// Token: 0x0600B1A1 RID: 45473 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B1A1")]
[Address(RVA = "0x18A4300", Offset = "0x18A3100", VA = "0x1818A4300", Slot = "6")]
public virtual BigInteger[] Decode(BigInteger n, byte[] encoding)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B1A2 RID: 45474 RVA: 0x0026AD48 File Offset: 0x00268F48
[Token(Token = "0x600B1A2")]
[Address(RVA = "0x18A45E0", Offset = "0x18A33E0", VA = "0x1818A45E0", Slot = "7")]
public virtual byte[] Encode(BigInteger n, BigInteger r, BigInteger s)
{
Asn1Encodable[] array = new Asn1Encodable[2];
BigInteger bigInteger;
if (bigInteger != 0)
{
}
array[0] = bigInteger;
BigInteger bigInteger2;
if (bigInteger2 != 0)
{
}
array[1] = bigInteger2;
return new DerSequence(array).GetEncoded("DER");
}
// Token: 0x0600B1A3 RID: 45475 RVA: 0x0026AD8C File Offset: 0x00268F8C
[Token(Token = "0x600B1A3")]
[Address(RVA = "0x18A4140", Offset = "0x18A2F40", VA = "0x1818A4140", Slot = "8")]
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
{
if (n != 0)
{
int num = x.CompareTo(n);
}
return x;
}
// Token: 0x0600B1A4 RID: 45476 RVA: 0x0026ADAC File Offset: 0x00268FAC
[Token(Token = "0x600B1A4")]
[Address(RVA = "0x18A41E0", Offset = "0x18A2FE0", VA = "0x1818A41E0", Slot = "9")]
protected virtual BigInteger DecodeValue(BigInteger n, Asn1Sequence s, int pos)
{
Asn1SequenceParser parser;
do
{
parser = s.Parser;
}
while (parser == 0 || parser == 0);
BigInteger bigInteger;
return bigInteger;
}
// Token: 0x0600B1A5 RID: 45477 RVA: 0x0026ADD4 File Offset: 0x00268FD4
[Token(Token = "0x600B1A5")]
[Address(RVA = "0x18A4560", Offset = "0x18A3360", VA = "0x1818A4560", Slot = "10")]
protected virtual DerInteger EncodeValue(BigInteger n, BigInteger x)
{
DerInteger derInteger;
return derInteger;
}
// Token: 0x0600B1A6 RID: 45478 RVA: 0x0026ADE4 File Offset: 0x00268FE4
[Token(Token = "0x600B1A6")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
public StandardDsaEncoding()
{
}
// Token: 0x0600B1A7 RID: 45479 RVA: 0x0026ADF8 File Offset: 0x00268FF8
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B1A7")]
[Address(RVA = "0x18A4770", Offset = "0x18A3570", VA = "0x1818A4770")]
static StandardDsaEncoding()
{
StandardDsaEncoding standardDsaEncoding = new StandardDsaEncoding();
}
// Token: 0x04007122 RID: 28962
[Token(Token = "0x4007122")]
public static readonly StandardDsaEncoding Instance;
}
}
@@ -0,0 +1,301 @@
using System;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001BBD RID: 7101
[Token(Token = "0x2001BBD")]
public class X931Signer : ISigner
{
// Token: 0x0600B1A8 RID: 45480 RVA: 0x0026AE0C File Offset: 0x0026900C
[Token(Token = "0x600B1A8")]
[Address(RVA = "0x18A6A30", Offset = "0x18A5830", VA = "0x1818A6A30")]
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B1A8)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.X931Signer::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest,System.Boolean)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3D:
stloc:ArgumentException(var_1_4C, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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.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: 0x17001BEF RID: 7151
// (get) Token: 0x0600B1A9 RID: 45481 RVA: 0x0026AE68 File Offset: 0x00269068
[Token(Token = "0x17001BEF")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B1A9")]
[Address(RVA = "0x18A6B30", Offset = "0x18A5930", VA = "0x1818A6B30", Slot = "11")]
get
{
IDigest digest = this.digest;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
string text;
return text;
}
}
// Token: 0x0600B1AA RID: 45482 RVA: 0x0026AE90 File Offset: 0x00269090
[Token(Token = "0x600B1AA")]
[Address(RVA = "0x18A6940", Offset = "0x18A5740", VA = "0x1818A6940")]
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest)
{
/*
An exception occurred when decompiling this method (0600B1AA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers.X931Signer::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IAsymmetricBlockCipher,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IDigest)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_2C:
stloc:ArgumentException(var_1_3B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("no valid trailer"), ldstr:string("digest")))
}
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: 0x0600B1AB RID: 45483 RVA: 0x0026AED8 File Offset: 0x002690D8
[Token(Token = "0x600B1AB")]
[Address(RVA = "0x18A6580", Offset = "0x18A5380", VA = "0x1818A6580", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
do
{
if (parameters == 0)
{
}
}
while (parameters == 0);
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
this.kParam = parameters;
BigInteger modulus = this.kParam.modulus;
int num = 0;
int num2 = modulus.BitLength;
this.keyBits = num2;
num2 += 7;
num += num2;
byte[] array = new byte[num];
this.block = array;
string algorithmName = ((ISigner)this).AlgorithmName;
}
// Token: 0x0600B1AC RID: 45484 RVA: 0x0026AF40 File Offset: 0x00269140
[Token(Token = "0x600B1AC")]
[Address(RVA = "0x189B390", Offset = "0x189A190", VA = "0x18189B390")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B1AD RID: 45485 RVA: 0x0026AF64 File Offset: 0x00269164
[Token(Token = "0x600B1AD")]
[Address(RVA = "0x18A66E0", Offset = "0x18A54E0", VA = "0x1818A66E0", Slot = "13")]
public virtual void Update(byte b)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B1AE RID: 45486 RVA: 0x0026AF80 File Offset: 0x00269180
[Token(Token = "0x600B1AE")]
[Address(RVA = "0x18A61E0", Offset = "0x18A4FE0", VA = "0x1818A61E0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int off, int len)
{
IDigest digest = this.digest;
}
// Token: 0x0600B1AF RID: 45487 RVA: 0x0026AF9C File Offset: 0x0026919C
[Token(Token = "0x600B1AF")]
[Address(RVA = "0x18A6690", Offset = "0x18A5490", VA = "0x1818A6690", Slot = "15")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B1B0 RID: 45488 RVA: 0x0026AFB8 File Offset: 0x002691B8
[Token(Token = "0x600B1B0")]
[Address(RVA = "0x18A6460", Offset = "0x18A5260", VA = "0x1818A6460", Slot = "16")]
public virtual byte[] GenerateSignature()
{
this.CreateSignatureBlock();
byte[] array = this.block;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length = array.Length;
byte[] array2 = this.block;
int length2 = array2.Length;
int num = 0;
Array.Clear(array2, num, length2);
BigInteger bigInteger2;
BigInteger bigInteger = this.kParam.modulus.Subtract(bigInteger2);
BigInteger bigInteger3 = bigInteger2.Min(bigInteger);
return BigIntegers.AsUnsignedByteArray(BigIntegers.GetUnsignedByteLength(this.kParam.modulus), bigInteger3);
}
// Token: 0x0600B1B1 RID: 45489 RVA: 0x0026B03C File Offset: 0x0026923C
[Token(Token = "0x600B1B1")]
[Address(RVA = "0x18A6260", Offset = "0x18A5060", VA = "0x1818A6260")]
private void CreateSignatureBlock()
{
IDigest digest = this.digest;
byte[] array = this.block;
if (this.trailer != 188)
{
int length = array.Length;
IDigest digest2 = this.digest;
int length2 = this.block.Length;
int num = this.trailer;
int length3 = this.block.Length;
int num2 = this.trailer;
int num3 = length3 - 1;
}
int length4 = array.Length;
IDigest digest3 = this.digest;
int num4 = this.block.Length - 1;
byte[] array2 = this.block;
if (num4 != 0)
{
byte[] array3 = this.block;
while (num4 != array3.Length)
{
}
}
byte[] array4 = this.block;
}
// Token: 0x0600B1B2 RID: 45490 RVA: 0x0026B0F4 File Offset: 0x002692F4
[Token(Token = "0x600B1B2")]
[Address(RVA = "0x18A6740", Offset = "0x18A5540", VA = "0x1818A6740", Slot = "17")]
public virtual bool VerifySignature(byte[] signature)
{
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
int length = signature.Length;
this.block = length;
BigInteger bigInteger;
if (bigInteger.IntValue == 12 || this.kParam.modulus.Subtract(bigInteger).IntValue != 12)
{
}
this.CreateSignatureBlock();
byte[] array = BigIntegers.AsUnsignedByteArray(this.block.Length, bigInteger);
bool flag = Arrays.ConstantTimeAreEqual(this.block, array);
byte[] array2 = this.block;
int length2 = array2.Length;
int num = 0;
Array.Clear(array2, num, length2);
int length3 = array.Length;
int num2 = 0;
Array.Clear(array, num2, length3);
return flag;
}
// Token: 0x04007123 RID: 28963
[Token(Token = "0x4007123")]
[Obsolete]
public const int TRAILER_IMPLICIT = 188;
// Token: 0x04007124 RID: 28964
[Token(Token = "0x4007124")]
[Obsolete]
public const int TRAILER_RIPEMD160 = 12748;
// Token: 0x04007125 RID: 28965
[Token(Token = "0x4007125")]
[Obsolete]
public const int TRAILER_RIPEMD128 = 13004;
// Token: 0x04007126 RID: 28966
[Token(Token = "0x4007126")]
[Obsolete]
public const int TRAILER_SHA1 = 13260;
// Token: 0x04007127 RID: 28967
[Token(Token = "0x4007127")]
[Obsolete]
public const int TRAILER_SHA256 = 13516;
// Token: 0x04007128 RID: 28968
[Token(Token = "0x4007128")]
[Obsolete]
public const int TRAILER_SHA512 = 13772;
// Token: 0x04007129 RID: 28969
[Token(Token = "0x4007129")]
[Obsolete]
public const int TRAILER_SHA384 = 14028;
// Token: 0x0400712A RID: 28970
[Token(Token = "0x400712A")]
[Obsolete]
public const int TRAILER_WHIRLPOOL = 14284;
// Token: 0x0400712B RID: 28971
[Token(Token = "0x400712B")]
[Obsolete]
public const int TRAILER_SHA224 = 14540;
// Token: 0x0400712C RID: 28972
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400712C")]
private IDigest digest;
// Token: 0x0400712D RID: 28973
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400712D")]
private IAsymmetricBlockCipher cipher;
// Token: 0x0400712E RID: 28974
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400712E")]
private RsaKeyParameters kParam;
// Token: 0x0400712F RID: 28975
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400712F")]
private int trailer;
// Token: 0x04007130 RID: 28976
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4007130")]
private int keyBits;
// Token: 0x04007131 RID: 28977
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007131")]
private byte[] block;
}
}