This commit is contained in:
niko
2026-04-12 16:51:38 +02:00
parent 1b6f6d81d0
commit c12fbe3fc6
17828 changed files with 2994770 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: 0x02001C81 RID: 7297
[Token(Token = "0x2001C81")]
public class DsaDigestSigner : ISigner
{
// Token: 0x0600B48A RID: 46218 RVA: 0x0026F5CC File Offset: 0x0026D7CC
[Token(Token = "0x600B48A")]
[Address(RVA = "0x2355EF0", Offset = "0x2354EF0", VA = "0x182355EF0")]
public DsaDigestSigner(IDsa dsa, IDigest digest)
{
this.dsa = dsa;
this.digest = digest;
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
}
// Token: 0x0600B48B RID: 46219 RVA: 0x0026F5F8 File Offset: 0x0026D7F8
[Token(Token = "0x600B48B")]
[Address(RVA = "0x466000", Offset = "0x465000", VA = "0x180466000")]
public DsaDigestSigner(IDsaExt dsa, IDigest digest, IDsaEncoding encoding)
{
this.dsa = dsa;
this.digest = digest;
this.encoding = encoding;
}
// Token: 0x17001C72 RID: 7282
// (get) Token: 0x0600B48C RID: 46220 RVA: 0x0026F620 File Offset: 0x0026D820
[Token(Token = "0x17001C72")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B48C")]
[Address(RVA = "0x2355F80", Offset = "0x2354F80", VA = "0x182355F80", Slot = "11")]
get
{
IDigest digest = this.digest;
IDsa dsa = this.dsa;
string text;
return text;
}
}
// Token: 0x0600B48D RID: 46221 RVA: 0x0026F644 File Offset: 0x0026D844
[Token(Token = "0x600B48D")]
[Address(RVA = "0x23559F0", Offset = "0x23549F0", VA = "0x1823559F0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B48D)
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 1663
*/;
}
// Token: 0x0600B48E RID: 46222 RVA: 0x0026F6B4 File Offset: 0x0026D8B4
[Token(Token = "0x600B48E")]
[Address(RVA = "0x2355CC0", Offset = "0x2354CC0", VA = "0x182355CC0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B48F RID: 46223 RVA: 0x0026F6D0 File Offset: 0x0026D8D0
[Token(Token = "0x600B48F")]
[Address(RVA = "0x23556D0", Offset = "0x23546D0", VA = "0x1823556D0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B490 RID: 46224 RVA: 0x0026F6EC File Offset: 0x0026D8EC
[Token(Token = "0x600B490")]
[Address(RVA = "0x2355750", Offset = "0x2354750", VA = "0x182355750", 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: 0x0600B491 RID: 46225 RVA: 0x0026F778 File Offset: 0x0026D978
[Token(Token = "0x600B491")]
[Address(RVA = "0x2355D20", Offset = "0x2354D20", VA = "0x182355D20", 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: 0x0600B492 RID: 46226 RVA: 0x0026F7F0 File Offset: 0x0026D9F0
[Token(Token = "0x600B492")]
[Address(RVA = "0x2355C70", Offset = "0x2354C70", VA = "0x182355C70", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B493 RID: 46227 RVA: 0x0026F80C File Offset: 0x0026DA0C
[Token(Token = "0x600B493")]
[Address(RVA = "0x2355930", Offset = "0x2354930", VA = "0x182355930", Slot = "18")]
protected virtual BigInteger GetOrder()
{
/*
An exception occurred when decompiling this method (0600B493)
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 1663
*/;
}
// Token: 0x04007251 RID: 29265
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007251")]
private readonly IDsa dsa;
// Token: 0x04007252 RID: 29266
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007252")]
private readonly IDigest digest;
// Token: 0x04007253 RID: 29267
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007253")]
private readonly IDsaEncoding encoding;
// Token: 0x04007254 RID: 29268
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007254")]
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: 0x02001C82 RID: 7298
[Token(Token = "0x2001C82")]
public class DsaSigner : IDsaExt, IDsa
{
// Token: 0x0600B494 RID: 46228 RVA: 0x0026F820 File Offset: 0x0026DA20
[Token(Token = "0x600B494")]
[Address(RVA = "0x2356960", Offset = "0x2355960", VA = "0x182356960")]
public DsaSigner()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
}
// Token: 0x0600B495 RID: 46229 RVA: 0x0026F840 File Offset: 0x0026DA40
[Token(Token = "0x600B495")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public DsaSigner(IDsaKCalculator kCalculator)
{
this.kCalculator = kCalculator;
}
// Token: 0x17001C73 RID: 7283
// (get) Token: 0x0600B496 RID: 46230 RVA: 0x0026F85C File Offset: 0x0026DA5C
[Token(Token = "0x17001C73")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B496")]
[Address(RVA = "0x23569C0", Offset = "0x23559C0", VA = "0x1823569C0", Slot = "9")]
get
{
return "DSA";
}
}
// Token: 0x0600B497 RID: 46231 RVA: 0x0026F870 File Offset: 0x0026DA70
[Token(Token = "0x600B497")]
[Address(RVA = "0x2356450", Offset = "0x2355450", VA = "0x182356450", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B497)
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 1663
*/;
}
// Token: 0x17001C74 RID: 7284
// (get) Token: 0x0600B498 RID: 46232 RVA: 0x0026F8E8 File Offset: 0x0026DAE8
[Token(Token = "0x17001C74")]
public virtual BigInteger Order
{
[Token(Token = "0x600B498")]
[Address(RVA = "0x23569F0", Offset = "0x23559F0", VA = "0x1823569F0", Slot = "11")]
get
{
return this.key.parameters.q;
}
}
// Token: 0x0600B499 RID: 46233 RVA: 0x0026F90C File Offset: 0x0026DB0C
[Token(Token = "0x600B499")]
[Address(RVA = "0x23560D0", Offset = "0x23550D0", VA = "0x1823560D0", 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: 0x0600B49A RID: 46234 RVA: 0x0026F9B8 File Offset: 0x0026DBB8
[Token(Token = "0x600B49A")]
[Address(RVA = "0x2356730", Offset = "0x2355730", VA = "0x182356730", 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: 0x0600B49B RID: 46235 RVA: 0x0026FA68 File Offset: 0x0026DC68
[Token(Token = "0x600B49B")]
[Address(RVA = "0x2356000", Offset = "0x2355000", VA = "0x182356000", 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: 0x0600B49C RID: 46236 RVA: 0x0026FAA8 File Offset: 0x0026DCA8
[Token(Token = "0x600B49C")]
[Address(RVA = "0x23563E0", Offset = "0x23553E0", VA = "0x1823563E0", Slot = "15")]
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
{
do
{
if (!needed)
{
}
}
while (provided != 0);
return new SecureRandom();
}
// Token: 0x04007255 RID: 29269
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007255")]
protected readonly IDsaKCalculator kCalculator;
// Token: 0x04007256 RID: 29270
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007256")]
protected DsaKeyParameters key;
// Token: 0x04007257 RID: 29271
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007257")]
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: 0x02001C83 RID: 7299
[Token(Token = "0x2001C83")]
public class ECDsaSigner : IDsaExt, IDsa
{
// Token: 0x0600B49D RID: 46237 RVA: 0x0026FAC4 File Offset: 0x0026DCC4
[Token(Token = "0x600B49D")]
[Address(RVA = "0x2357820", Offset = "0x2356820", VA = "0x182357820")]
public ECDsaSigner()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
}
// Token: 0x0600B49E RID: 46238 RVA: 0x0026FAE4 File Offset: 0x0026DCE4
[Token(Token = "0x600B49E")]
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
public ECDsaSigner(IDsaKCalculator kCalculator)
{
this.kCalculator = kCalculator;
}
// Token: 0x17001C75 RID: 7285
// (get) Token: 0x0600B49F RID: 46239 RVA: 0x0026FB00 File Offset: 0x0026DD00
[Token(Token = "0x17001C75")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B49F")]
[Address(RVA = "0x2357880", Offset = "0x2356880", VA = "0x182357880", Slot = "9")]
get
{
return "ECDSA";
}
}
// Token: 0x0600B4A0 RID: 46240 RVA: 0x0026FB14 File Offset: 0x0026DD14
[Token(Token = "0x600B4A0")]
[Address(RVA = "0x23570F0", Offset = "0x23560F0", VA = "0x1823570F0", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4A0)
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 1663
*/;
}
// Token: 0x17001C76 RID: 7286
// (get) Token: 0x0600B4A1 RID: 46241 RVA: 0x0026FBA4 File Offset: 0x0026DDA4
[Token(Token = "0x17001C76")]
public virtual BigInteger Order
{
[Token(Token = "0x600B4A1")]
[Address(RVA = "0x23578B0", Offset = "0x23568B0", VA = "0x1823578B0", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B4A2 RID: 46242 RVA: 0x0026FBC8 File Offset: 0x0026DDC8
[Token(Token = "0x600B4A2")]
[Address(RVA = "0x2356B30", Offset = "0x2355B30", VA = "0x182356B30", 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: 0x0600B4A3 RID: 46243 RVA: 0x0026FC9C File Offset: 0x0026DE9C
[Token(Token = "0x600B4A3")]
[Address(RVA = "0x23573D0", Offset = "0x23563D0", VA = "0x1823573D0", 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: 0x0600B4A4 RID: 46244 RVA: 0x0026FD8C File Offset: 0x0026DF8C
[Token(Token = "0x600B4A4")]
[Address(RVA = "0x2356A20", Offset = "0x2355A20", VA = "0x182356A20", 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: 0x0600B4A5 RID: 46245 RVA: 0x0026FDCC File Offset: 0x0026DFCC
[Token(Token = "0x600B4A5")]
[Address(RVA = "0x2356AE0", Offset = "0x2355AE0", VA = "0x182356AE0", Slot = "15")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B4A5)
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 1663
*/;
}
// Token: 0x0600B4A6 RID: 46246 RVA: 0x0026FDE0 File Offset: 0x0026DFE0
[Token(Token = "0x600B4A6")]
[Address(RVA = "0x2356FD0", Offset = "0x2355FD0", VA = "0x182356FD0", 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: 0x0600B4A7 RID: 46247 RVA: 0x0026FE0C File Offset: 0x0026E00C
[Token(Token = "0x600B4A7")]
[Address(RVA = "0x2357080", Offset = "0x2356080", VA = "0x182357080", Slot = "17")]
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
{
do
{
if (!needed)
{
}
}
while (provided != 0);
return new SecureRandom();
}
// Token: 0x0600B4A8 RID: 46248 RVA: 0x0026FE28 File Offset: 0x0026E028
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B4A8")]
[Address(RVA = "0x23577C0", Offset = "0x23567C0", VA = "0x1823577C0")]
static ECDsaSigner()
{
BigInteger bigInteger;
ECDsaSigner.Eight = bigInteger;
}
// Token: 0x04007258 RID: 29272
[Token(Token = "0x4007258")]
private static readonly BigInteger Eight;
// Token: 0x04007259 RID: 29273
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007259")]
protected readonly IDsaKCalculator kCalculator;
// Token: 0x0400725A RID: 29274
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400725A")]
protected ECKeyParameters key;
// Token: 0x0400725B RID: 29275
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400725B")]
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: 0x02001C84 RID: 7300
[Token(Token = "0x2001C84")]
public class ECGost3410Signer : IDsaExt, IDsa
{
// Token: 0x17001C77 RID: 7287
// (get) Token: 0x0600B4A9 RID: 46249 RVA: 0x0026FE3C File Offset: 0x0026E03C
[Token(Token = "0x17001C77")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4A9")]
[Address(RVA = "0x2358400", Offset = "0x2357400", VA = "0x182358400", Slot = "9")]
get
{
return "ECGOST3410";
}
}
// Token: 0x0600B4AA RID: 46250 RVA: 0x0026FE50 File Offset: 0x0026E050
[Token(Token = "0x600B4AA")]
[Address(RVA = "0x2357D90", Offset = "0x2356D90", VA = "0x182357D90", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4AA)
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 1663
*/;
}
// Token: 0x17001C78 RID: 7288
// (get) Token: 0x0600B4AB RID: 46251 RVA: 0x0026FEC8 File Offset: 0x0026E0C8
[Token(Token = "0x17001C78")]
public virtual BigInteger Order
{
[Token(Token = "0x600B4AB")]
[Address(RVA = "0x2358430", Offset = "0x2357430", VA = "0x182358430", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B4AC RID: 46252 RVA: 0x0026FEEC File Offset: 0x0026E0EC
[Token(Token = "0x600B4AC")]
[Address(RVA = "0x2357930", Offset = "0x2356930", VA = "0x182357930", 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: 0x0600B4AD RID: 46253 RVA: 0x0026FFE0 File Offset: 0x0026E1E0
[Token(Token = "0x600B4AD")]
[Address(RVA = "0x2358020", Offset = "0x2357020", VA = "0x182358020", 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: 0x0600B4AE RID: 46254 RVA: 0x002700E4 File Offset: 0x0026E2E4
[Token(Token = "0x600B4AE")]
[Address(RVA = "0x23578E0", Offset = "0x23568E0", VA = "0x1823578E0", Slot = "14")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B4AE)
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 1663
*/;
}
// Token: 0x0600B4AF RID: 46255 RVA: 0x002700F8 File Offset: 0x0026E2F8
[Token(Token = "0x600B4AF")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public ECGost3410Signer()
{
}
// Token: 0x0400725C RID: 29276
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400725C")]
private ECKeyParameters key;
// Token: 0x0400725D RID: 29277
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400725D")]
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: 0x02001C85 RID: 7301
[Token(Token = "0x2001C85")]
public class ECNRSigner : IDsaExt, IDsa
{
// Token: 0x17001C79 RID: 7289
// (get) Token: 0x0600B4B0 RID: 46256 RVA: 0x0027010C File Offset: 0x0026E30C
[Token(Token = "0x17001C79")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4B0")]
[Address(RVA = "0x2358F00", Offset = "0x2357F00", VA = "0x182358F00", Slot = "9")]
get
{
return "ECNR";
}
}
// Token: 0x0600B4B1 RID: 46257 RVA: 0x00270120 File Offset: 0x0026E320
[Token(Token = "0x600B4B1")]
[Address(RVA = "0x2358930", Offset = "0x2357930", VA = "0x182358930", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4B1)
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 1663
*/;
}
// Token: 0x17001C7A RID: 7290
// (get) Token: 0x0600B4B2 RID: 46258 RVA: 0x002701A0 File Offset: 0x0026E3A0
[Token(Token = "0x17001C7A")]
public virtual BigInteger Order
{
[Token(Token = "0x600B4B2")]
[Address(RVA = "0x23578B0", Offset = "0x23568B0", VA = "0x1823578B0", Slot = "11")]
get
{
return this.key.parameters.n;
}
}
// Token: 0x0600B4B3 RID: 46259 RVA: 0x002701C4 File Offset: 0x0026E3C4
[Token(Token = "0x600B4B3")]
[Address(RVA = "0x2358460", Offset = "0x2357460", VA = "0x182358460", Slot = "12")]
public virtual BigInteger[] GenerateSignature(byte[] message)
{
/*
An exception occurred when decompiling this method (0600B4B3)
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 1663
*/;
}
// Token: 0x0600B4B4 RID: 46260 RVA: 0x002702AC File Offset: 0x0026E4AC
[Token(Token = "0x600B4B4")]
[Address(RVA = "0x2358BC0", Offset = "0x2357BC0", VA = "0x182358BC0", Slot = "13")]
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
{
/*
An exception occurred when decompiling this method (0600B4B4)
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 1663
*/;
}
// Token: 0x0600B4B5 RID: 46261 RVA: 0x00270368 File Offset: 0x0026E568
[Token(Token = "0x600B4B5")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public ECNRSigner()
{
}
// Token: 0x0400725E RID: 29278
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400725E")]
private bool forSigning;
// Token: 0x0400725F RID: 29279
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400725F")]
private ECKeyParameters key;
// Token: 0x04007260 RID: 29280
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007260")]
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: 0x02001C86 RID: 7302
[Token(Token = "0x2001C86")]
public class Ed25519Signer : ISigner
{
// Token: 0x0600B4B6 RID: 46262 RVA: 0x0027037C File Offset: 0x0026E57C
[Token(Token = "0x600B4B6")]
[Address(RVA = "0x2359170", Offset = "0x2358170", VA = "0x182359170")]
public Ed25519Signer()
{
Ed25519Signer.Buffer buffer = new Ed25519Signer.Buffer();
this.buffer = buffer;
base..ctor();
}
// Token: 0x17001C7B RID: 7291
// (get) Token: 0x0600B4B7 RID: 46263 RVA: 0x0027039C File Offset: 0x0026E59C
[Token(Token = "0x17001C7B")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4B7")]
[Address(RVA = "0x23591D0", Offset = "0x23581D0", VA = "0x1823591D0", Slot = "11")]
get
{
return "Ed25519";
}
}
// Token: 0x0600B4B8 RID: 46264 RVA: 0x002703B0 File Offset: 0x0026E5B0
[Token(Token = "0x600B4B8")]
[Address(RVA = "0x2358FF0", Offset = "0x2357FF0", VA = "0x182358FF0", 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: 0x0600B4B9 RID: 46265 RVA: 0x002703F8 File Offset: 0x0026E5F8
[Token(Token = "0x600B4B9")]
[Address(RVA = "0xAC4CC0", Offset = "0xAC3CC0", VA = "0x180AC4CC0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B4BA RID: 46266 RVA: 0x00270418 File Offset: 0x0026E618
[Token(Token = "0x600B4BA")]
[Address(RVA = "0x2358F30", Offset = "0x2357F30", VA = "0x182358F30", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B4BB RID: 46267 RVA: 0x0027043C File Offset: 0x0026E63C
[Token(Token = "0x600B4BB")]
[Address(RVA = "0x2358F60", Offset = "0x2357F60", VA = "0x182358F60", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4BB)
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 1663
*/;
}
// Token: 0x0600B4BC RID: 46268 RVA: 0x00270480 File Offset: 0x0026E680
[Token(Token = "0x600B4BC")]
[Address(RVA = "0x23590E0", Offset = "0x23580E0", VA = "0x1823590E0", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4BC)
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 1663
*/;
}
// Token: 0x0600B4BD RID: 46269 RVA: 0x002704BC File Offset: 0x0026E6BC
[Token(Token = "0x600B4BD")]
[Address(RVA = "0x23590C0", Offset = "0x23580C0", VA = "0x1823590C0", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x04007261 RID: 29281
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007261")]
private readonly Ed25519Signer.Buffer buffer;
// Token: 0x04007262 RID: 29282
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007262")]
private bool forSigning;
// Token: 0x04007263 RID: 29283
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007263")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x04007264 RID: 29284
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007264")]
private Ed25519PublicKeyParameters publicKey;
// Token: 0x02001C87 RID: 7303
[Token(Token = "0x2001C87")]
private class Buffer : MemoryStream
{
// Token: 0x0600B4BE RID: 46270 RVA: 0x002704DC File Offset: 0x0026E6DC
[Token(Token = "0x600B4BE")]
[Address(RVA = "0x2351700", Offset = "0x2350700", VA = "0x182351700")]
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: 0x0600B4BF RID: 46271 RVA: 0x00270514 File Offset: 0x0026E714
[Token(Token = "0x600B4BF")]
[Address(RVA = "0x2351E10", Offset = "0x2350E10", VA = "0x182351E10")]
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: 0x0600B4C0 RID: 46272 RVA: 0x00270548 File Offset: 0x0026E748
[Token(Token = "0x600B4C0")]
[Address(RVA = "0x2351BD0", Offset = "0x2350BD0", VA = "0x182351BD0")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B4C1 RID: 46273 RVA: 0x00270570 File Offset: 0x0026E770
[Token(Token = "0x600B4C1")]
[Address(RVA = "0x495270", Offset = "0x494270", VA = "0x180495270")]
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: 0x02001C88 RID: 7304
[Token(Token = "0x2001C88")]
public class Ed25519ctxSigner : ISigner
{
// Token: 0x0600B4C2 RID: 46274 RVA: 0x00270584 File Offset: 0x0026E784
[Token(Token = "0x600B4C2")]
[Address(RVA = "0x2359420", Offset = "0x2358420", VA = "0x182359420")]
public Ed25519ctxSigner(byte[] context)
{
Ed25519ctxSigner.Buffer buffer = new Ed25519ctxSigner.Buffer();
this.buffer = buffer;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001C7C RID: 7292
// (get) Token: 0x0600B4C3 RID: 46275 RVA: 0x002705B4 File Offset: 0x0026E7B4
[Token(Token = "0x17001C7C")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4C3")]
[Address(RVA = "0x23594C0", Offset = "0x23584C0", VA = "0x1823594C0", Slot = "11")]
get
{
return "Ed25519ctx";
}
}
// Token: 0x0600B4C4 RID: 46276 RVA: 0x002705C8 File Offset: 0x0026E7C8
[Token(Token = "0x600B4C4")]
[Address(RVA = "0x2359290", Offset = "0x2358290", VA = "0x182359290", 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: 0x0600B4C5 RID: 46277 RVA: 0x00270610 File Offset: 0x0026E810
[Token(Token = "0x600B4C5")]
[Address(RVA = "0xAC4CC0", Offset = "0xAC3CC0", VA = "0x180AC4CC0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B4C6 RID: 46278 RVA: 0x00270630 File Offset: 0x0026E830
[Token(Token = "0x600B4C6")]
[Address(RVA = "0x2358F30", Offset = "0x2357F30", VA = "0x182358F30", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B4C7 RID: 46279 RVA: 0x00270654 File Offset: 0x0026E854
[Token(Token = "0x600B4C7")]
[Address(RVA = "0x2359200", Offset = "0x2358200", VA = "0x182359200", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4C7)
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 1663
*/;
}
// Token: 0x0600B4C8 RID: 46280 RVA: 0x002706A0 File Offset: 0x0026E8A0
[Token(Token = "0x600B4C8")]
[Address(RVA = "0x2359380", Offset = "0x2358380", VA = "0x182359380", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4C8)
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 1663
*/;
}
// Token: 0x0600B4C9 RID: 46281 RVA: 0x002706E4 File Offset: 0x0026E8E4
[Token(Token = "0x600B4C9")]
[Address(RVA = "0x2359360", Offset = "0x2358360", VA = "0x182359360", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x04007265 RID: 29285
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007265")]
private readonly Ed25519ctxSigner.Buffer buffer;
// Token: 0x04007266 RID: 29286
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007266")]
private readonly byte[] context;
// Token: 0x04007267 RID: 29287
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007267")]
private bool forSigning;
// Token: 0x04007268 RID: 29288
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007268")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x04007269 RID: 29289
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007269")]
private Ed25519PublicKeyParameters publicKey;
// Token: 0x02001C89 RID: 7305
[Token(Token = "0x2001C89")]
private class Buffer : MemoryStream
{
// Token: 0x0600B4CA RID: 46282 RVA: 0x00270704 File Offset: 0x0026E904
[Token(Token = "0x600B4CA")]
[Address(RVA = "0x2351890", Offset = "0x2350890", VA = "0x182351890")]
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: 0x0600B4CB RID: 46283 RVA: 0x0027073C File Offset: 0x0026E93C
[Token(Token = "0x600B4CB")]
[Address(RVA = "0x2351CA0", Offset = "0x2350CA0", VA = "0x182351CA0")]
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: 0x0600B4CC RID: 46284 RVA: 0x00270788 File Offset: 0x0026E988
[Token(Token = "0x600B4CC")]
[Address(RVA = "0x2351B00", Offset = "0x2350B00", VA = "0x182351B00")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B4CD RID: 46285 RVA: 0x002707B0 File Offset: 0x0026E9B0
[Token(Token = "0x600B4CD")]
[Address(RVA = "0x495270", Offset = "0x494270", VA = "0x180495270")]
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: 0x02001C8A RID: 7306
[Token(Token = "0x2001C8A")]
public class Ed25519phSigner : ISigner
{
// Token: 0x0600B4CE RID: 46286 RVA: 0x002707C4 File Offset: 0x0026E9C4
[Token(Token = "0x600B4CE")]
[Address(RVA = "0x2359A10", Offset = "0x2358A10", VA = "0x182359A10")]
public Ed25519phSigner(byte[] context)
{
IDigest digest = Ed25519.CreatePrehash();
this.prehash = digest;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001C7D RID: 7293
// (get) Token: 0x0600B4CF RID: 46287 RVA: 0x002707F4 File Offset: 0x0026E9F4
[Token(Token = "0x17001C7D")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4CF")]
[Address(RVA = "0x2359AB0", Offset = "0x2358AB0", VA = "0x182359AB0", Slot = "11")]
get
{
return "Ed25519ph";
}
}
// Token: 0x0600B4D0 RID: 46288 RVA: 0x00270808 File Offset: 0x0026EA08
[Token(Token = "0x600B4D0")]
[Address(RVA = "0x2359790", Offset = "0x2358790", VA = "0x182359790", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4D0)
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 1663
*/;
}
// Token: 0x0600B4D1 RID: 46289 RVA: 0x00270850 File Offset: 0x0026EA50
[Token(Token = "0x600B4D1")]
[Address(RVA = "0x23598D0", Offset = "0x23588D0", VA = "0x1823598D0", Slot = "13")]
public virtual void Update(byte b)
{
IDigest digest = this.prehash;
throw new NullReferenceException();
}
// Token: 0x0600B4D2 RID: 46290 RVA: 0x0027086C File Offset: 0x0026EA6C
[Token(Token = "0x600B4D2")]
[Address(RVA = "0x23594F0", Offset = "0x23584F0", VA = "0x1823594F0", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
IDigest digest = this.prehash;
}
// Token: 0x0600B4D3 RID: 46291 RVA: 0x00270888 File Offset: 0x0026EA88
[Token(Token = "0x600B4D3")]
[Address(RVA = "0x2359570", Offset = "0x2358570", VA = "0x182359570", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4D3)
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 1663
*/;
}
// Token: 0x0600B4D4 RID: 46292 RVA: 0x00270920 File Offset: 0x0026EB20
[Token(Token = "0x600B4D4")]
[Address(RVA = "0x2359930", Offset = "0x2358930", VA = "0x182359930", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4D4)
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 1663
*/;
}
// Token: 0x0600B4D5 RID: 46293 RVA: 0x00270978 File Offset: 0x0026EB78
[Token(Token = "0x600B4D5")]
[Address(RVA = "0x2359880", Offset = "0x2358880", VA = "0x182359880", Slot = "10")]
public void Reset()
{
IDigest digest = this.prehash;
throw new NullReferenceException();
}
// Token: 0x0400726A RID: 29290
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400726A")]
private readonly IDigest prehash;
// Token: 0x0400726B RID: 29291
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400726B")]
private readonly byte[] context;
// Token: 0x0400726C RID: 29292
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400726C")]
private bool forSigning;
// Token: 0x0400726D RID: 29293
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400726D")]
private Ed25519PrivateKeyParameters privateKey;
// Token: 0x0400726E RID: 29294
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400726E")]
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: 0x02001C8B RID: 7307
[Token(Token = "0x2001C8B")]
public class Ed448Signer : ISigner
{
// Token: 0x0600B4D6 RID: 46294 RVA: 0x00270994 File Offset: 0x0026EB94
[Token(Token = "0x600B4D6")]
[Address(RVA = "0x2359D00", Offset = "0x2358D00", VA = "0x182359D00")]
public Ed448Signer(byte[] context)
{
Ed448Signer.Buffer buffer = new Ed448Signer.Buffer();
this.buffer = buffer;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001C7E RID: 7294
// (get) Token: 0x0600B4D7 RID: 46295 RVA: 0x002709C4 File Offset: 0x0026EBC4
[Token(Token = "0x17001C7E")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4D7")]
[Address(RVA = "0x2359DA0", Offset = "0x2358DA0", VA = "0x182359DA0", Slot = "11")]
get
{
return "Ed448";
}
}
// Token: 0x0600B4D8 RID: 46296 RVA: 0x002709D8 File Offset: 0x0026EBD8
[Token(Token = "0x600B4D8")]
[Address(RVA = "0x2359B70", Offset = "0x2358B70", VA = "0x182359B70", 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: 0x0600B4D9 RID: 46297 RVA: 0x00270A20 File Offset: 0x0026EC20
[Token(Token = "0x600B4D9")]
[Address(RVA = "0xAC4CC0", Offset = "0xAC3CC0", VA = "0x180AC4CC0", Slot = "13")]
public virtual void Update(byte b)
{
((IDisposable)this.buffer).Dispose();
}
// Token: 0x0600B4DA RID: 46298 RVA: 0x00270A40 File Offset: 0x0026EC40
[Token(Token = "0x600B4DA")]
[Address(RVA = "0x2358F30", Offset = "0x2357F30", VA = "0x182358F30", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
int num = this.buffer.Read(buf, off, len);
}
// Token: 0x0600B4DB RID: 46299 RVA: 0x00270A64 File Offset: 0x0026EC64
[Token(Token = "0x600B4DB")]
[Address(RVA = "0x2359AE0", Offset = "0x2358AE0", VA = "0x182359AE0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4DB)
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 1663
*/;
}
// Token: 0x0600B4DC RID: 46300 RVA: 0x00270AB0 File Offset: 0x0026ECB0
[Token(Token = "0x600B4DC")]
[Address(RVA = "0x2359C60", Offset = "0x2358C60", VA = "0x182359C60", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4DC)
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 1663
*/;
}
// Token: 0x0600B4DD RID: 46301 RVA: 0x00270AF4 File Offset: 0x0026ECF4
[Token(Token = "0x600B4DD")]
[Address(RVA = "0x2359C40", Offset = "0x2358C40", VA = "0x182359C40", Slot = "17")]
public virtual void Reset()
{
this.buffer.Reset();
}
// Token: 0x0400726F RID: 29295
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400726F")]
private readonly Ed448Signer.Buffer buffer;
// Token: 0x04007270 RID: 29296
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007270")]
private readonly byte[] context;
// Token: 0x04007271 RID: 29297
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007271")]
private bool forSigning;
// Token: 0x04007272 RID: 29298
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007272")]
private Ed448PrivateKeyParameters privateKey;
// Token: 0x04007273 RID: 29299
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007273")]
private Ed448PublicKeyParameters publicKey;
// Token: 0x02001C8C RID: 7308
[Token(Token = "0x2001C8C")]
private class Buffer : MemoryStream
{
// Token: 0x0600B4DE RID: 46302 RVA: 0x00270B14 File Offset: 0x0026ED14
[Token(Token = "0x600B4DE")]
[Address(RVA = "0x2351570", Offset = "0x2350570", VA = "0x182351570")]
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: 0x0600B4DF RID: 46303 RVA: 0x00270B4C File Offset: 0x0026ED4C
[Token(Token = "0x600B4DF")]
[Address(RVA = "0x2351F80", Offset = "0x2350F80", VA = "0x182351F80")]
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: 0x0600B4E0 RID: 46304 RVA: 0x00270B98 File Offset: 0x0026ED98
[Token(Token = "0x600B4E0")]
[Address(RVA = "0x2351A30", Offset = "0x2350A30", VA = "0x182351A30")]
internal void Reset()
{
int num;
do
{
num = 0;
long length = this.Length;
long position = this.Position;
Monitor.Exit(this);
}
while (num != 0);
}
// Token: 0x0600B4E1 RID: 46305 RVA: 0x00270BC0 File Offset: 0x0026EDC0
[Token(Token = "0x600B4E1")]
[Address(RVA = "0x495270", Offset = "0x494270", VA = "0x180495270")]
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: 0x02001C8D RID: 7309
[Token(Token = "0x2001C8D")]
public class Ed448phSigner : ISigner
{
// Token: 0x0600B4E2 RID: 46306 RVA: 0x00270BD4 File Offset: 0x0026EDD4
[Token(Token = "0x600B4E2")]
[Address(RVA = "0x235A360", Offset = "0x2359360", VA = "0x18235A360")]
public Ed448phSigner(byte[] context)
{
IXof xof = Ed448.CreatePrehash();
this.prehash = xof;
base..ctor();
byte[] array = Arrays.Clone(context);
this.context = array;
}
// Token: 0x17001C7F RID: 7295
// (get) Token: 0x0600B4E3 RID: 46307 RVA: 0x00270C04 File Offset: 0x0026EE04
[Token(Token = "0x17001C7F")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4E3")]
[Address(RVA = "0x235A400", Offset = "0x2359400", VA = "0x18235A400", Slot = "11")]
get
{
return "Ed448ph";
}
}
// Token: 0x0600B4E4 RID: 46308 RVA: 0x00270C18 File Offset: 0x0026EE18
[Token(Token = "0x600B4E4")]
[Address(RVA = "0x235A0E0", Offset = "0x23590E0", VA = "0x18235A0E0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4E4)
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 1663
*/;
}
// Token: 0x0600B4E5 RID: 46309 RVA: 0x00270C60 File Offset: 0x0026EE60
[Token(Token = "0x600B4E5")]
[Address(RVA = "0x235A220", Offset = "0x2359220", VA = "0x18235A220", Slot = "13")]
public virtual void Update(byte b)
{
IXof xof = this.prehash;
throw new NullReferenceException();
}
// Token: 0x0600B4E6 RID: 46310 RVA: 0x00270C7C File Offset: 0x0026EE7C
[Token(Token = "0x600B4E6")]
[Address(RVA = "0x2359DD0", Offset = "0x2358DD0", VA = "0x182359DD0", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
IXof xof = this.prehash;
}
// Token: 0x0600B4E7 RID: 46311 RVA: 0x00270C98 File Offset: 0x0026EE98
[Token(Token = "0x600B4E7")]
[Address(RVA = "0x2359E50", Offset = "0x2358E50", VA = "0x182359E50", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4E7)
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 1663
*/;
}
// Token: 0x0600B4E8 RID: 46312 RVA: 0x00270D1C File Offset: 0x0026EF1C
[Token(Token = "0x600B4E8")]
[Address(RVA = "0x235A280", Offset = "0x2359280", VA = "0x18235A280", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4E8)
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 1663
*/;
}
// Token: 0x0600B4E9 RID: 46313 RVA: 0x00270D74 File Offset: 0x0026EF74
[Token(Token = "0x600B4E9")]
[Address(RVA = "0x235A1D0", Offset = "0x23591D0", VA = "0x18235A1D0", Slot = "10")]
public void Reset()
{
IXof xof = this.prehash;
throw new NullReferenceException();
}
// Token: 0x04007274 RID: 29300
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007274")]
private readonly IXof prehash;
// Token: 0x04007275 RID: 29301
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007275")]
private readonly byte[] context;
// Token: 0x04007276 RID: 29302
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007276")]
private bool forSigning;
// Token: 0x04007277 RID: 29303
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007277")]
private Ed448PrivateKeyParameters privateKey;
// Token: 0x04007278 RID: 29304
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007278")]
private Ed448PublicKeyParameters publicKey;
}
}
@@ -0,0 +1,172 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001C90 RID: 7312
[Token(Token = "0x2001C90")]
public class GenericSigner : ISigner
{
// Token: 0x0600B4F8 RID: 46328 RVA: 0x002712D8 File Offset: 0x0026F4D8
[Token(Token = "0x600B4F8")]
[Address(RVA = "0x417DD0", Offset = "0x416DD0", VA = "0x180417DD0")]
public GenericSigner(IAsymmetricBlockCipher engine, IDigest digest)
{
this.engine = engine;
this.digest = digest;
}
// Token: 0x17001C83 RID: 7299
// (get) Token: 0x0600B4F9 RID: 46329 RVA: 0x002712FC File Offset: 0x0026F4FC
[Token(Token = "0x17001C83")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4F9")]
[Address(RVA = "0x235ABC0", Offset = "0x2359BC0", VA = "0x18235ABC0", 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: 0x0600B4FA RID: 46330 RVA: 0x00271390 File Offset: 0x0026F590
[Token(Token = "0x600B4FA")]
[Address(RVA = "0x235A6B0", Offset = "0x23596B0", VA = "0x18235A6B0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4FA)
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 1663
*/;
}
// Token: 0x0600B4FB RID: 46331 RVA: 0x00271400 File Offset: 0x0026F600
[Token(Token = "0x600B4FB")]
[Address(RVA = "0x235A980", Offset = "0x2359980", VA = "0x18235A980", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B4FC RID: 46332 RVA: 0x0027141C File Offset: 0x0026F61C
[Token(Token = "0x600B4FC")]
[Address(RVA = "0x235A530", Offset = "0x2359530", VA = "0x18235A530", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B4FD RID: 46333 RVA: 0x00271438 File Offset: 0x0026F638
[Token(Token = "0x600B4FD")]
[Address(RVA = "0x235A5B0", Offset = "0x23595B0", VA = "0x18235A5B0", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B4FD)
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 1663
*/;
}
// Token: 0x0600B4FE RID: 46334 RVA: 0x00271480 File Offset: 0x0026F680
[Token(Token = "0x600B4FE")]
[Address(RVA = "0x235A9E0", Offset = "0x23599E0", VA = "0x18235A9E0", 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: 0x0600B4FF RID: 46335 RVA: 0x0027150C File Offset: 0x0026F70C
[Token(Token = "0x600B4FF")]
[Address(RVA = "0x235A930", Offset = "0x2359930", VA = "0x18235A930", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0400727E RID: 29310
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400727E")]
private readonly IAsymmetricBlockCipher engine;
// Token: 0x0400727F RID: 29311
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400727F")]
private readonly IDigest digest;
// Token: 0x04007280 RID: 29312
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007280")]
private bool forSigning;
}
}
@@ -0,0 +1,152 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001C8E RID: 7310
[Token(Token = "0x2001C8E")]
public class Gost3410DigestSigner : ISigner
{
// Token: 0x0600B4EA RID: 46314 RVA: 0x00270D90 File Offset: 0x0026EF90
[Token(Token = "0x600B4EA")]
[Address(RVA = "0xE5DFE0", Offset = "0xE5CFE0", VA = "0x180E5DFE0")]
public Gost3410DigestSigner(IDsa signer, IDigest digest)
{
this.dsaSigner = signer;
this.digest = digest;
}
// Token: 0x17001C80 RID: 7296
// (get) Token: 0x0600B4EB RID: 46315 RVA: 0x00270DB4 File Offset: 0x0026EFB4
[Token(Token = "0x17001C80")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4EB")]
[Address(RVA = "0x235B5E0", Offset = "0x235A5E0", VA = "0x18235B5E0", Slot = "11")]
get
{
IDigest digest = this.digest;
IDsa dsa = this.dsaSigner;
string text;
return text;
}
}
// Token: 0x0600B4EC RID: 46316 RVA: 0x00270DD8 File Offset: 0x0026EFD8
[Token(Token = "0x600B4EC")]
[Address(RVA = "0x235B0E0", Offset = "0x235A0E0", VA = "0x18235B0E0", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4EC)
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 1663
*/;
}
// Token: 0x0600B4ED RID: 46317 RVA: 0x00270E48 File Offset: 0x0026F048
[Token(Token = "0x600B4ED")]
[Address(RVA = "0x235B3B0", Offset = "0x235A3B0", VA = "0x18235B3B0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B4EE RID: 46318 RVA: 0x00270E64 File Offset: 0x0026F064
[Token(Token = "0x600B4EE")]
[Address(RVA = "0x235AE10", Offset = "0x2359E10", VA = "0x18235AE10", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B4EF RID: 46319 RVA: 0x00270E80 File Offset: 0x0026F080
[Token(Token = "0x600B4EF")]
[Address(RVA = "0x235AE90", Offset = "0x2359E90", VA = "0x18235AE90", 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: 0x0600B4F0 RID: 46320 RVA: 0x00270F14 File Offset: 0x0026F114
[Token(Token = "0x600B4F0")]
[Address(RVA = "0x235B410", Offset = "0x235A410", VA = "0x18235B410", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B4F0)
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 1663
*/;
}
// Token: 0x0600B4F1 RID: 46321 RVA: 0x00270F64 File Offset: 0x0026F164
[Token(Token = "0x600B4F1")]
[Address(RVA = "0x235B360", Offset = "0x235A360", VA = "0x18235B360", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x04007279 RID: 29305
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007279")]
private readonly IDigest digest;
// Token: 0x0400727A RID: 29306
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400727A")]
private readonly IDsa dsaSigner;
// Token: 0x0400727B RID: 29307
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400727B")]
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: 0x02001C8F RID: 7311
[Token(Token = "0x2001C8F")]
public class Gost3410Signer : IDsaExt, IDsa
{
// Token: 0x17001C81 RID: 7297
// (get) Token: 0x0600B4F2 RID: 46322 RVA: 0x00270F80 File Offset: 0x0026F180
[Token(Token = "0x17001C81")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B4F2")]
[Address(RVA = "0x235BFE0", Offset = "0x235AFE0", VA = "0x18235BFE0", Slot = "9")]
get
{
return "GOST3410";
}
}
// Token: 0x0600B4F3 RID: 46323 RVA: 0x00270F94 File Offset: 0x0026F194
[Token(Token = "0x600B4F3")]
[Address(RVA = "0x235B9C0", Offset = "0x235A9C0", VA = "0x18235B9C0", Slot = "10")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4F3)
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 1663
*/;
}
// Token: 0x17001C82 RID: 7298
// (get) Token: 0x0600B4F4 RID: 46324 RVA: 0x0027100C File Offset: 0x0026F20C
[Token(Token = "0x17001C82")]
public virtual BigInteger Order
{
[Token(Token = "0x600B4F4")]
[Address(RVA = "0x5EF6E0", Offset = "0x5EE6E0", VA = "0x1805EF6E0", Slot = "11")]
get
{
return this.key.parameters.q;
}
}
// Token: 0x0600B4F5 RID: 46325 RVA: 0x00271030 File Offset: 0x0026F230
[Token(Token = "0x600B4F5")]
[Address(RVA = "0x235B660", Offset = "0x235A660", VA = "0x18235B660", 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: 0x0600B4F6 RID: 46326 RVA: 0x00271160 File Offset: 0x0026F360
[Token(Token = "0x600B4F6")]
[Address(RVA = "0x235BC50", Offset = "0x235AC50", VA = "0x18235BC50", 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: 0x0600B4F7 RID: 46327 RVA: 0x002712C4 File Offset: 0x0026F4C4
[Token(Token = "0x600B4F7")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public Gost3410Signer()
{
}
// Token: 0x0400727C RID: 29308
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400727C")]
private Gost3410KeyParameters key;
// Token: 0x0400727D RID: 29309
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400727D")]
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: 0x02001C91 RID: 7313
[Token(Token = "0x2001C91")]
public class HMacDsaKCalculator : IDsaKCalculator
{
// Token: 0x0600B500 RID: 46336 RVA: 0x00271528 File Offset: 0x0026F728
[Token(Token = "0x600B500")]
[Address(RVA = "0x235C910", Offset = "0x235B910", VA = "0x18235C910")]
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: 0x17001C84 RID: 7300
// (get) Token: 0x0600B501 RID: 46337 RVA: 0x00271574 File Offset: 0x0026F774
[Token(Token = "0x17001C84")]
public virtual bool IsDeterministic
{
[Token(Token = "0x600B501")]
[Address(RVA = "0x4246A0", Offset = "0x4236A0", VA = "0x1804246A0", Slot = "8")]
get
{
return true;
}
}
// Token: 0x0600B502 RID: 46338 RVA: 0x00271584 File Offset: 0x0026F784
[Token(Token = "0x600B502")]
[Address(RVA = "0x235C620", Offset = "0x235B620", VA = "0x18235C620", Slot = "9")]
public virtual void Init(BigInteger n, SecureRandom random)
{
/*
An exception occurred when decompiling this method (0600B502)
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 1663
*/;
}
// Token: 0x0600B503 RID: 46339 RVA: 0x0027159C File Offset: 0x0026F79C
[Token(Token = "0x600B503")]
[Address(RVA = "0x235C170", Offset = "0x235B170", VA = "0x18235C170", 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: 0x0600B504 RID: 46340 RVA: 0x00271790 File Offset: 0x0026F990
[Token(Token = "0x600B504")]
[Address(RVA = "0x235C680", Offset = "0x235B680", VA = "0x18235C680", 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: 0x0600B505 RID: 46341 RVA: 0x002718AC File Offset: 0x0026FAAC
[Token(Token = "0x600B505")]
[Address(RVA = "0x235C0B0", Offset = "0x235B0B0", VA = "0x18235C0B0")]
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: 0x04007281 RID: 29313
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007281")]
private readonly HMac hMac;
// Token: 0x04007282 RID: 29314
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007282")]
private readonly byte[] K;
// Token: 0x04007283 RID: 29315
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007283")]
private readonly byte[] V;
// Token: 0x04007284 RID: 29316
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007284")]
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: 0x02001C92 RID: 7314
[Token(Token = "0x2001C92")]
public interface IDsaEncoding
{
// Token: 0x0600B506 RID: 46342
[Token(Token = "0x600B506")]
[Address(Slot = "0")]
BigInteger[] Decode(BigInteger n, byte[] encoding);
// Token: 0x0600B507 RID: 46343
[Token(Token = "0x600B507")]
[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: 0x02001C93 RID: 7315
[Token(Token = "0x2001C93")]
public interface IDsaKCalculator
{
// Token: 0x17001C85 RID: 7301
// (get) Token: 0x0600B508 RID: 46344
[Token(Token = "0x17001C85")]
bool IsDeterministic
{
[Token(Token = "0x600B508")]
[Address(Slot = "0")]
get;
}
// Token: 0x0600B509 RID: 46345
[Token(Token = "0x600B509")]
[Address(Slot = "1")]
void Init(BigInteger n, SecureRandom random);
// Token: 0x0600B50A RID: 46346
[Token(Token = "0x600B50A")]
[Address(Slot = "2")]
void Init(BigInteger n, BigInteger d, byte[] message);
// Token: 0x0600B50B RID: 46347
[Token(Token = "0x600B50B")]
[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: 0x02001C94 RID: 7316
[Token(Token = "0x2001C94")]
public class Iso9796d2PssSigner : ISignerWithRecovery, ISigner
{
// Token: 0x0600B50C RID: 46348 RVA: 0x00271900 File Offset: 0x0026FB00
[Token(Token = "0x600B50C")]
[Address(RVA = "0x417720", Offset = "0x416720", VA = "0x180417720", Slot = "5")]
public byte[] GetRecoveredMessage()
{
return this.recoveredMessage;
}
// Token: 0x0600B50D RID: 46349 RVA: 0x00271914 File Offset: 0x0026FB14
[Token(Token = "0x600B50D")]
[Address(RVA = "0x2360800", Offset = "0x235F800", VA = "0x182360800")]
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B50D)
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 1663
*/;
}
// Token: 0x0600B50E RID: 46350 RVA: 0x00271978 File Offset: 0x0026FB78
[Token(Token = "0x600B50E")]
[Address(RVA = "0x23606E0", Offset = "0x235F6E0", VA = "0x1823606E0")]
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength)
{
/*
An exception occurred when decompiling this method (0600B50E)
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 1663
*/;
}
// Token: 0x17001C86 RID: 7302
// (get) Token: 0x0600B50F RID: 46351 RVA: 0x002719D0 File Offset: 0x0026FBD0
[Token(Token = "0x17001C86")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B50F")]
[Address(RVA = "0x2360930", Offset = "0x235F930", VA = "0x182360930", Slot = "14")]
get
{
IDigest digest = this.digest;
return 0 + "withISO9796-2S2";
}
}
// Token: 0x0600B510 RID: 46352 RVA: 0x002719F8 File Offset: 0x0026FBF8
[Token(Token = "0x600B510")]
[Address(RVA = "0x235F1F0", Offset = "0x235E1F0", VA = "0x18235F1F0", 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: 0x0600B511 RID: 46353 RVA: 0x00271AF0 File Offset: 0x0026FCF0
[Token(Token = "0x600B511")]
[Address(RVA = "0x235F5C0", Offset = "0x235E5C0", VA = "0x18235F5C0")]
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: 0x0600B512 RID: 46354 RVA: 0x00271B24 File Offset: 0x0026FD24
[Token(Token = "0x600B512")]
[Address(RVA = "0x2342160", Offset = "0x2341160", VA = "0x182342160")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B513 RID: 46355 RVA: 0x00271B48 File Offset: 0x0026FD48
[Token(Token = "0x600B513")]
[Address(RVA = "0x235FD00", Offset = "0x235ED00", VA = "0x18235FD00", 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: 0x0600B514 RID: 46356 RVA: 0x00271C78 File Offset: 0x0026FE78
[Token(Token = "0x600B514")]
[Address(RVA = "0x2360110", Offset = "0x235F110", VA = "0x182360110", 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: 0x0600B515 RID: 46357 RVA: 0x00271CC0 File Offset: 0x0026FEC0
[Token(Token = "0x600B515")]
[Address(RVA = "0x235EC20", Offset = "0x235DC20", VA = "0x18235EC20", 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: 0x0600B516 RID: 46358 RVA: 0x00271D04 File Offset: 0x0026FF04
[Token(Token = "0x600B516")]
[Address(RVA = "0x235FC40", Offset = "0x235EC40", VA = "0x18235FC40", 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: 0x0600B517 RID: 46359 RVA: 0x00271DB0 File Offset: 0x0026FFB0
[Token(Token = "0x600B517")]
[Address(RVA = "0x235ED00", Offset = "0x235DD00", VA = "0x18235ED00", 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: 0x0600B518 RID: 46360 RVA: 0x00272018 File Offset: 0x00270218
[Token(Token = "0x600B518")]
[Address(RVA = "0x23601C0", Offset = "0x235F1C0", VA = "0x1823601C0", Slot = "21")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B518)
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 1663
*/;
}
// Token: 0x0600B519 RID: 46361 RVA: 0x00272220 File Offset: 0x00270420
[Token(Token = "0x600B519")]
[Address(RVA = "0x51F220", Offset = "0x51E220", VA = "0x18051F220", Slot = "22")]
public virtual bool HasFullMessage()
{
return this.fullMessage;
}
// Token: 0x0600B51A RID: 46362 RVA: 0x00272234 File Offset: 0x00270434
[Token(Token = "0x600B51A")]
[Address(RVA = "0x235F650", Offset = "0x235E650", VA = "0x18235F650")]
private void ItoOSP(int i, byte[] sp)
{
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
}
// Token: 0x0600B51B RID: 46363 RVA: 0x00272268 File Offset: 0x00270468
[Token(Token = "0x600B51B")]
[Address(RVA = "0x235F6E0", Offset = "0x235E6E0", VA = "0x18235F6E0")]
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: 0x0600B51C RID: 46364 RVA: 0x002722BC File Offset: 0x002704BC
[Token(Token = "0x600B51C")]
[Address(RVA = "0x235F820", Offset = "0x235E820", VA = "0x18235F820")]
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: 0x04007285 RID: 29317
[Token(Token = "0x4007285")]
[Obsolete]
public const int TrailerImplicit = 188;
// Token: 0x04007286 RID: 29318
[Token(Token = "0x4007286")]
[Obsolete]
public const int TrailerRipeMD160 = 12748;
// Token: 0x04007287 RID: 29319
[Token(Token = "0x4007287")]
[Obsolete]
public const int TrailerRipeMD128 = 13004;
// Token: 0x04007288 RID: 29320
[Token(Token = "0x4007288")]
[Obsolete]
public const int TrailerSha1 = 13260;
// Token: 0x04007289 RID: 29321
[Token(Token = "0x4007289")]
[Obsolete]
public const int TrailerSha256 = 13516;
// Token: 0x0400728A RID: 29322
[Token(Token = "0x400728A")]
[Obsolete]
public const int TrailerSha512 = 13772;
// Token: 0x0400728B RID: 29323
[Token(Token = "0x400728B")]
[Obsolete]
public const int TrailerSha384 = 14028;
// Token: 0x0400728C RID: 29324
[Token(Token = "0x400728C")]
[Obsolete]
public const int TrailerWhirlpool = 14284;
// Token: 0x0400728D RID: 29325
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400728D")]
private IDigest digest;
// Token: 0x0400728E RID: 29326
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400728E")]
private IAsymmetricBlockCipher cipher;
// Token: 0x0400728F RID: 29327
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400728F")]
private SecureRandom random;
// Token: 0x04007290 RID: 29328
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007290")]
private byte[] standardSalt;
// Token: 0x04007291 RID: 29329
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007291")]
private int hLen;
// Token: 0x04007292 RID: 29330
[FieldOffset(Offset = "0x34")]
[Token(Token = "0x4007292")]
private int trailer;
// Token: 0x04007293 RID: 29331
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4007293")]
private int keyBits;
// Token: 0x04007294 RID: 29332
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4007294")]
private byte[] block;
// Token: 0x04007295 RID: 29333
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4007295")]
private byte[] mBuf;
// Token: 0x04007296 RID: 29334
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4007296")]
private int messageLength;
// Token: 0x04007297 RID: 29335
[FieldOffset(Offset = "0x54")]
[Token(Token = "0x4007297")]
private readonly int saltLength;
// Token: 0x04007298 RID: 29336
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4007298")]
private bool fullMessage;
// Token: 0x04007299 RID: 29337
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4007299")]
private byte[] recoveredMessage;
// Token: 0x0400729A RID: 29338
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x400729A")]
private byte[] preSig;
// Token: 0x0400729B RID: 29339
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x400729B")]
private byte[] preBlock;
// Token: 0x0400729C RID: 29340
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x400729C")]
private int preMStart;
// Token: 0x0400729D RID: 29341
[FieldOffset(Offset = "0x7C")]
[Token(Token = "0x400729D")]
private int preTLength;
}
}
@@ -0,0 +1,483 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
{
// Token: 0x02001C95 RID: 7317
[Token(Token = "0x2001C95")]
public class Iso9796d2Signer : ISignerWithRecovery, ISigner
{
// Token: 0x0600B51D RID: 46365 RVA: 0x00272404 File Offset: 0x00270604
[Token(Token = "0x600B51D")]
[Address(RVA = "0x417680", Offset = "0x416680", VA = "0x180417680", Slot = "5")]
public byte[] GetRecoveredMessage()
{
return this.recoveredMessage;
}
// Token: 0x0600B51E RID: 46366 RVA: 0x00272418 File Offset: 0x00270618
[Token(Token = "0x600B51E")]
[Address(RVA = "0x2361D60", Offset = "0x2360D60", VA = "0x182361D60")]
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B51E)
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 1663
*/;
}
// Token: 0x0600B51F RID: 46367 RVA: 0x00272474 File Offset: 0x00270674
[Token(Token = "0x600B51F")]
[Address(RVA = "0x2361E60", Offset = "0x2360E60", VA = "0x182361E60")]
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest)
{
/*
An exception occurred when decompiling this method (0600B51F)
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 1663
*/;
}
// Token: 0x17001C87 RID: 7303
// (get) Token: 0x0600B520 RID: 46368 RVA: 0x002724BC File Offset: 0x002706BC
[Token(Token = "0x17001C87")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B520")]
[Address(RVA = "0x2361F50", Offset = "0x2360F50", VA = "0x182361F50", Slot = "14")]
get
{
IDigest digest = this.digest;
return 0 + "withISO9796-2S1";
}
}
// Token: 0x0600B521 RID: 46369 RVA: 0x002724E4 File Offset: 0x002706E4
[Token(Token = "0x600B521")]
[Address(RVA = "0x2360DD0", Offset = "0x235FDD0", VA = "0x182360DD0", 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: 0x0600B522 RID: 46370 RVA: 0x0027258C File Offset: 0x0027078C
[Token(Token = "0x600B522")]
[Address(RVA = "0x2360F60", Offset = "0x235FF60", VA = "0x182360F60")]
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: 0x0600B523 RID: 46371 RVA: 0x002725E0 File Offset: 0x002707E0
[Token(Token = "0x600B523")]
[Address(RVA = "0x2342160", Offset = "0x2341160", VA = "0x182342160")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B524 RID: 46372 RVA: 0x00272604 File Offset: 0x00270804
[Token(Token = "0x600B524")]
[Address(RVA = "0x2361140", Offset = "0x2360140", VA = "0x182361140", 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: 0x0600B525 RID: 46373 RVA: 0x00272718 File Offset: 0x00270918
[Token(Token = "0x600B525")]
[Address(RVA = "0x2361530", Offset = "0x2360530", VA = "0x182361530", 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: 0x0600B526 RID: 46374 RVA: 0x00272758 File Offset: 0x00270958
[Token(Token = "0x600B526")]
[Address(RVA = "0x2360990", Offset = "0x235F990", VA = "0x182360990", 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: 0x0600B527 RID: 46375 RVA: 0x00272790 File Offset: 0x00270990
[Token(Token = "0x600B527")]
[Address(RVA = "0x2361030", Offset = "0x2360030", VA = "0x182361030", 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: 0x0600B528 RID: 46376 RVA: 0x00272838 File Offset: 0x00270A38
[Token(Token = "0x600B528")]
[Address(RVA = "0x2360A70", Offset = "0x235FA70", VA = "0x182360A70", 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: 0x0600B529 RID: 46377 RVA: 0x002729BC File Offset: 0x00270BBC
[Token(Token = "0x600B529")]
[Address(RVA = "0x23615D0", Offset = "0x23605D0", VA = "0x1823615D0", Slot = "21")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B529)
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 1663
*/;
}
// Token: 0x0600B52A RID: 46378 RVA: 0x00272BFC File Offset: 0x00270DFC
[Token(Token = "0x600B52A")]
[Address(RVA = "0x23610F0", Offset = "0x23600F0", VA = "0x1823610F0")]
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: 0x0600B52B RID: 46379 RVA: 0x00272C48 File Offset: 0x00270E48
[Token(Token = "0x600B52B")]
[Address(RVA = "0x5AC5A0", Offset = "0x5AB5A0", VA = "0x1805AC5A0", Slot = "22")]
public virtual bool HasFullMessage()
{
return this.fullMessage;
}
// Token: 0x0400729E RID: 29342
[Token(Token = "0x400729E")]
[Obsolete]
public const int TrailerImplicit = 188;
// Token: 0x0400729F RID: 29343
[Token(Token = "0x400729F")]
[Obsolete]
public const int TrailerRipeMD160 = 12748;
// Token: 0x040072A0 RID: 29344
[Token(Token = "0x40072A0")]
[Obsolete]
public const int TrailerRipeMD128 = 13004;
// Token: 0x040072A1 RID: 29345
[Token(Token = "0x40072A1")]
[Obsolete]
public const int TrailerSha1 = 13260;
// Token: 0x040072A2 RID: 29346
[Token(Token = "0x40072A2")]
[Obsolete]
public const int TrailerSha256 = 13516;
// Token: 0x040072A3 RID: 29347
[Token(Token = "0x40072A3")]
[Obsolete]
public const int TrailerSha512 = 13772;
// Token: 0x040072A4 RID: 29348
[Token(Token = "0x40072A4")]
[Obsolete]
public const int TrailerSha384 = 14028;
// Token: 0x040072A5 RID: 29349
[Token(Token = "0x40072A5")]
[Obsolete]
public const int TrailerWhirlpool = 14284;
// Token: 0x040072A6 RID: 29350
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072A6")]
private IDigest digest;
// Token: 0x040072A7 RID: 29351
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072A7")]
private IAsymmetricBlockCipher cipher;
// Token: 0x040072A8 RID: 29352
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072A8")]
private int trailer;
// Token: 0x040072A9 RID: 29353
[FieldOffset(Offset = "0x24")]
[Token(Token = "0x40072A9")]
private int keyBits;
// Token: 0x040072AA RID: 29354
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072AA")]
private byte[] block;
// Token: 0x040072AB RID: 29355
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40072AB")]
private byte[] mBuf;
// Token: 0x040072AC RID: 29356
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40072AC")]
private int messageLength;
// Token: 0x040072AD RID: 29357
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x40072AD")]
private bool fullMessage;
// Token: 0x040072AE RID: 29358
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40072AE")]
private byte[] recoveredMessage;
// Token: 0x040072AF RID: 29359
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40072AF")]
private byte[] preSig;
// Token: 0x040072B0 RID: 29360
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40072B0")]
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: 0x02001C96 RID: 7318
[Token(Token = "0x2001C96")]
public class IsoTrailers
{
// Token: 0x0600B52C RID: 46380 RVA: 0x00272C5C File Offset: 0x00270E5C
[Token(Token = "0x600B52C")]
[Address(RVA = "0x2361FB0", Offset = "0x2360FB0", VA = "0x182361FB0")]
private static IDictionary CreateTrailerMap()
{
return CollectionUtilities.ReadOnly(Platform.CreateHashtable());
}
// Token: 0x0600B52D RID: 46381 RVA: 0x00272C7C File Offset: 0x00270E7C
[Token(Token = "0x600B52D")]
[Address(RVA = "0x2362260", Offset = "0x2361260", VA = "0x182362260")]
public static int GetTrailer(IDigest digest)
{
throw new NullReferenceException();
}
// Token: 0x0600B52E RID: 46382 RVA: 0x00272C90 File Offset: 0x00270E90
[Token(Token = "0x600B52E")]
[Address(RVA = "0x2362330", Offset = "0x2361330", VA = "0x182362330")]
public static bool NoTrailerAvailable(IDigest digest)
{
int num = 0;
if (num < digest)
{
num += num;
num++;
}
bool flag;
return flag;
}
// Token: 0x0600B52F RID: 46383 RVA: 0x00272CB4 File Offset: 0x00270EB4
[Token(Token = "0x600B52F")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public IsoTrailers()
{
}
// Token: 0x0600B530 RID: 46384 RVA: 0x00272CC8 File Offset: 0x00270EC8
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B530")]
[Address(RVA = "0x2362440", Offset = "0x2361440", VA = "0x182362440")]
static IsoTrailers()
{
IDictionary dictionary = IsoTrailers.CreateTrailerMap();
}
// Token: 0x040072B1 RID: 29361
[Token(Token = "0x40072B1")]
public const int TRAILER_IMPLICIT = 188;
// Token: 0x040072B2 RID: 29362
[Token(Token = "0x40072B2")]
public const int TRAILER_RIPEMD160 = 12748;
// Token: 0x040072B3 RID: 29363
[Token(Token = "0x40072B3")]
public const int TRAILER_RIPEMD128 = 13004;
// Token: 0x040072B4 RID: 29364
[Token(Token = "0x40072B4")]
public const int TRAILER_SHA1 = 13260;
// Token: 0x040072B5 RID: 29365
[Token(Token = "0x40072B5")]
public const int TRAILER_SHA256 = 13516;
// Token: 0x040072B6 RID: 29366
[Token(Token = "0x40072B6")]
public const int TRAILER_SHA512 = 13772;
// Token: 0x040072B7 RID: 29367
[Token(Token = "0x40072B7")]
public const int TRAILER_SHA384 = 14028;
// Token: 0x040072B8 RID: 29368
[Token(Token = "0x40072B8")]
public const int TRAILER_WHIRLPOOL = 14284;
// Token: 0x040072B9 RID: 29369
[Token(Token = "0x40072B9")]
public const int TRAILER_SHA224 = 14540;
// Token: 0x040072BA RID: 29370
[Token(Token = "0x40072BA")]
public const int TRAILER_SHA512_224 = 14796;
// Token: 0x040072BB RID: 29371
[Token(Token = "0x40072BB")]
public const int TRAILER_SHA512_256 = 16588;
// Token: 0x040072BC RID: 29372
[Token(Token = "0x40072BC")]
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: 0x02001C97 RID: 7319
[Token(Token = "0x2001C97")]
public class PlainDsaEncoding : IDsaEncoding
{
// Token: 0x0600B531 RID: 46385 RVA: 0x00272CE0 File Offset: 0x00270EE0
[Token(Token = "0x600B531")]
[Address(RVA = "0x2362A90", Offset = "0x2361A90", VA = "0x182362A90", 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: 0x0600B532 RID: 46386 RVA: 0x00272D24 File Offset: 0x00270F24
[Token(Token = "0x600B532")]
[Address(RVA = "0x2362D70", Offset = "0x2361D70", VA = "0x182362D70", 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: 0x0600B533 RID: 46387 RVA: 0x00272D40 File Offset: 0x00270F40
[Token(Token = "0x600B533")]
[Address(RVA = "0x2362940", Offset = "0x2361940", VA = "0x182362940", Slot = "8")]
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
{
int num = x.CompareTo(n);
return x;
}
// Token: 0x0600B534 RID: 46388 RVA: 0x00272D5C File Offset: 0x00270F5C
[Token(Token = "0x600B534")]
[Address(RVA = "0x23629E0", Offset = "0x23619E0", VA = "0x1823629E0", Slot = "9")]
protected virtual BigInteger DecodeValue(BigInteger n, byte[] buf, int off, int len)
{
BigInteger bigInteger;
return bigInteger;
}
// Token: 0x0600B535 RID: 46389 RVA: 0x00272D6C File Offset: 0x00270F6C
[Token(Token = "0x600B535")]
[Address(RVA = "0x2362C40", Offset = "0x2361C40", VA = "0x182362C40", 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: 0x0600B536 RID: 46390 RVA: 0x00272DA8 File Offset: 0x00270FA8
[Token(Token = "0x600B536")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public PlainDsaEncoding()
{
}
// Token: 0x0600B537 RID: 46391 RVA: 0x00272DBC File Offset: 0x00270FBC
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B537")]
[Address(RVA = "0x2362E50", Offset = "0x2361E50", VA = "0x182362E50")]
static PlainDsaEncoding()
{
PlainDsaEncoding plainDsaEncoding = new PlainDsaEncoding();
}
// Token: 0x040072BD RID: 29373
[Token(Token = "0x40072BD")]
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: 0x02001C98 RID: 7320
[Token(Token = "0x2001C98")]
public class PssSigner : ISigner
{
// Token: 0x0600B538 RID: 46392 RVA: 0x00272DD0 File Offset: 0x00270FD0
[Token(Token = "0x600B538")]
[Address(RVA = "0x2362F30", Offset = "0x2361F30", VA = "0x182362F30")]
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: 0x0600B539 RID: 46393 RVA: 0x00272E4C File Offset: 0x0027104C
[Token(Token = "0x600B539")]
[Address(RVA = "0x2363070", Offset = "0x2362070", VA = "0x182363070")]
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: 0x0600B53A RID: 46394 RVA: 0x00272EC4 File Offset: 0x002710C4
[Token(Token = "0x600B53A")]
[Address(RVA = "0x2364340", Offset = "0x2363340", VA = "0x182364340")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest)
{
}
// Token: 0x0600B53B RID: 46395 RVA: 0x00272ED8 File Offset: 0x002710D8
[Token(Token = "0x600B53B")]
[Address(RVA = "0x2364310", Offset = "0x2363310", VA = "0x182364310")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen)
{
}
// Token: 0x0600B53C RID: 46396 RVA: 0x00272EE8 File Offset: 0x002710E8
[Token(Token = "0x600B53C")]
[Address(RVA = "0x23642A0", Offset = "0x23632A0", VA = "0x1823642A0")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, byte[] salt)
{
int length = salt.Length;
}
// Token: 0x0600B53D RID: 46397 RVA: 0x00272F04 File Offset: 0x00271104
[Token(Token = "0x600B53D")]
[Address(RVA = "0x23642E0", Offset = "0x23632E0", VA = "0x1823642E0")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, int saltLen)
{
}
// Token: 0x0600B53E RID: 46398 RVA: 0x00272F14 File Offset: 0x00271114
[Token(Token = "0x600B53E")]
[Address(RVA = "0x2364250", Offset = "0x2363250", VA = "0x182364250")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, byte[] salt)
{
}
// Token: 0x0600B53F RID: 46399 RVA: 0x00272F28 File Offset: 0x00271128
[Token(Token = "0x600B53F")]
[Address(RVA = "0x2364310", Offset = "0x2363310", VA = "0x182364310")]
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen, byte trailer)
{
}
// Token: 0x0600B540 RID: 46400 RVA: 0x00272F38 File Offset: 0x00271138
[Token(Token = "0x600B540")]
[Address(RVA = "0x2364160", Offset = "0x2363160", VA = "0x182364160")]
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: 0x0600B541 RID: 46401 RVA: 0x00272FA0 File Offset: 0x002711A0
[Token(Token = "0x600B541")]
[Address(RVA = "0x23643D0", Offset = "0x23633D0", VA = "0x1823643D0")]
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: 0x17001C88 RID: 7304
// (get) Token: 0x0600B542 RID: 46402 RVA: 0x00273008 File Offset: 0x00271208
[Token(Token = "0x17001C88")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B542")]
[Address(RVA = "0x23644D0", Offset = "0x23634D0", VA = "0x1823644D0", Slot = "11")]
get
{
IDigest digest = this.mgfDigest;
return 0 + "withRSAandMGF1";
}
}
// Token: 0x0600B543 RID: 46403 RVA: 0x00273030 File Offset: 0x00271230
[Token(Token = "0x600B543")]
[Address(RVA = "0x23634F0", Offset = "0x23624F0", VA = "0x1823634F0", 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: 0x0600B544 RID: 46404 RVA: 0x002730C0 File Offset: 0x002712C0
[Token(Token = "0x600B544")]
[Address(RVA = "0x2342160", Offset = "0x2341160", VA = "0x182342160")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B545 RID: 46405 RVA: 0x002730E4 File Offset: 0x002712E4
[Token(Token = "0x600B545")]
[Address(RVA = "0x2363CB0", Offset = "0x2362CB0", VA = "0x182363CB0", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.contentDigest1;
throw new NullReferenceException();
}
// Token: 0x0600B546 RID: 46406 RVA: 0x00273100 File Offset: 0x00271300
[Token(Token = "0x600B546")]
[Address(RVA = "0x2362EB0", Offset = "0x2361EB0", VA = "0x182362EB0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.contentDigest1;
}
// Token: 0x0600B547 RID: 46407 RVA: 0x0027311C File Offset: 0x0027131C
[Token(Token = "0x600B547")]
[Address(RVA = "0x2363C60", Offset = "0x2362C60", VA = "0x182363C60", Slot = "15")]
public virtual void Reset()
{
IDigest digest = this.contentDigest1;
throw new NullReferenceException();
}
// Token: 0x0600B548 RID: 46408 RVA: 0x00273138 File Offset: 0x00271338
[Token(Token = "0x600B548")]
[Address(RVA = "0x23631B0", Offset = "0x23621B0", VA = "0x1823631B0", 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: 0x0600B549 RID: 46409 RVA: 0x00273298 File Offset: 0x00271498
[Token(Token = "0x600B549")]
[Address(RVA = "0x2363D10", Offset = "0x2362D10", VA = "0x182363D10", 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: 0x0600B54A RID: 46410 RVA: 0x002733EC File Offset: 0x002715EC
[Token(Token = "0x600B54A")]
[Address(RVA = "0x235F650", Offset = "0x235E650", VA = "0x18235F650")]
private void ItoOSP(int i, byte[] sp)
{
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
sp[0] = (byte)i;
}
// Token: 0x0600B54B RID: 46411 RVA: 0x00273420 File Offset: 0x00271620
[Token(Token = "0x600B54B")]
[Address(RVA = "0x23637C0", Offset = "0x23627C0", VA = "0x1823637C0")]
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: 0x040072BE RID: 29374
[Token(Token = "0x40072BE")]
public const byte TrailerImplicit = 188;
// Token: 0x040072BF RID: 29375
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072BF")]
private readonly IDigest contentDigest1;
// Token: 0x040072C0 RID: 29376
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072C0")]
private readonly IDigest contentDigest2;
// Token: 0x040072C1 RID: 29377
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072C1")]
private readonly IDigest mgfDigest;
// Token: 0x040072C2 RID: 29378
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072C2")]
private readonly IAsymmetricBlockCipher cipher;
// Token: 0x040072C3 RID: 29379
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40072C3")]
private SecureRandom random;
// Token: 0x040072C4 RID: 29380
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40072C4")]
private int hLen;
// Token: 0x040072C5 RID: 29381
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x40072C5")]
private int mgfhLen;
// Token: 0x040072C6 RID: 29382
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40072C6")]
private int sLen;
// Token: 0x040072C7 RID: 29383
[FieldOffset(Offset = "0x44")]
[Token(Token = "0x40072C7")]
private bool sSet;
// Token: 0x040072C8 RID: 29384
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40072C8")]
private int emBits;
// Token: 0x040072C9 RID: 29385
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x40072C9")]
private byte[] salt;
// Token: 0x040072CA RID: 29386
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40072CA")]
private byte[] mDash;
// Token: 0x040072CB RID: 29387
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40072CB")]
private byte[] block;
// Token: 0x040072CC RID: 29388
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x40072CC")]
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: 0x02001C99 RID: 7321
[Token(Token = "0x2001C99")]
public class RandomDsaKCalculator : IDsaKCalculator
{
// Token: 0x17001C89 RID: 7305
// (get) Token: 0x0600B54C RID: 46412 RVA: 0x0027356C File Offset: 0x0027176C
[Token(Token = "0x17001C89")]
public virtual bool IsDeterministic
{
[Token(Token = "0x600B54C")]
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "8")]
get
{
}
}
// Token: 0x0600B54D RID: 46413 RVA: 0x0027357C File Offset: 0x0027177C
[Token(Token = "0x600B54D")]
[Address(RVA = "0xD224F0", Offset = "0xD214F0", VA = "0x180D224F0", Slot = "9")]
public virtual void Init(BigInteger n, SecureRandom random)
{
this.q = n;
this.random = random;
}
// Token: 0x0600B54E RID: 46414 RVA: 0x00273598 File Offset: 0x00271798
[Token(Token = "0x600B54E")]
[Address(RVA = "0x2364530", Offset = "0x2363530", VA = "0x182364530", Slot = "10")]
public virtual void Init(BigInteger n, BigInteger d, byte[] message)
{
/*
An exception occurred when decompiling this method (0600B54E)
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 1663
*/;
}
// Token: 0x0600B54F RID: 46415 RVA: 0x002735B0 File Offset: 0x002717B0
[Token(Token = "0x600B54F")]
[Address(RVA = "0x2364590", Offset = "0x2363590", VA = "0x182364590", 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: 0x0600B550 RID: 46416 RVA: 0x002735F0 File Offset: 0x002717F0
[Token(Token = "0x600B550")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public RandomDsaKCalculator()
{
}
// Token: 0x040072CD RID: 29389
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072CD")]
private BigInteger q;
// Token: 0x040072CE RID: 29390
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072CE")]
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: 0x02001C9A RID: 7322
[Token(Token = "0x2001C9A")]
public class RsaDigestSigner : ISigner
{
// Token: 0x0600B551 RID: 46417 RVA: 0x00273604 File Offset: 0x00271804
[Token(Token = "0x600B551")]
[Address(RVA = "0x2365360", Offset = "0x2364360", VA = "0x182365360")]
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: 0x0600B552 RID: 46418 RVA: 0x002736BC File Offset: 0x002718BC
[Token(Token = "0x600B552")]
[Address(RVA = "0x2365A30", Offset = "0x2364A30", VA = "0x182365A30")]
public RsaDigestSigner(IDigest digest)
{
IDictionary dictionary = RsaDigestSigner.oidMap;
IDictionary dictionary2 = RsaDigestSigner.oidMap;
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B553 RID: 46419 RVA: 0x002736E8 File Offset: 0x002718E8
[Token(Token = "0x600B553")]
[Address(RVA = "0x2365C10", Offset = "0x2364C10", VA = "0x182365C10")]
public RsaDigestSigner(IDigest digest, DerObjectIdentifier digestOid)
{
DerNull instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B554 RID: 46420 RVA: 0x0027370C File Offset: 0x0027190C
[Token(Token = "0x600B554")]
[Address(RVA = "0x2365810", Offset = "0x2364810", VA = "0x182365810")]
public RsaDigestSigner(IDigest digest, AlgorithmIdentifier algId)
{
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
}
// Token: 0x0600B555 RID: 46421 RVA: 0x00273720 File Offset: 0x00271920
[Token(Token = "0x600B555")]
[Address(RVA = "0x2365960", Offset = "0x2364960", VA = "0x182365960")]
public RsaDigestSigner(IRsa rsa, IDigest digest, DerObjectIdentifier digestOid)
{
DerNull instance = DerNull.Instance;
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
}
// Token: 0x0600B556 RID: 46422 RVA: 0x0027373C File Offset: 0x0027193C
[Token(Token = "0x600B556")]
[Address(RVA = "0x2365890", Offset = "0x2364890", VA = "0x182365890")]
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: 0x0600B557 RID: 46423 RVA: 0x0027377C File Offset: 0x0027197C
[Token(Token = "0x600B557")]
[Address(RVA = "0x2365780", Offset = "0x2364780", VA = "0x182365780")]
public RsaDigestSigner(IAsymmetricBlockCipher rsaEngine, IDigest digest, AlgorithmIdentifier algId)
{
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(rsaEngine);
this.rsaEngine = pkcs1Encoding;
this.digest = digest;
this.algId = algId;
}
// Token: 0x17001C8A RID: 7306
// (get) Token: 0x0600B558 RID: 46424 RVA: 0x002737AC File Offset: 0x002719AC
[Token(Token = "0x17001C8A")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B558")]
[Address(RVA = "0x2365D10", Offset = "0x2364D10", VA = "0x182365D10", Slot = "11")]
get
{
IDigest digest = this.digest;
return 0 + "withRSA";
}
}
// Token: 0x0600B559 RID: 46425 RVA: 0x002737D4 File Offset: 0x002719D4
[Token(Token = "0x600B559")]
[Address(RVA = "0x2364D40", Offset = "0x2363D40", VA = "0x182364D40", Slot = "12")]
public virtual void Init(bool forSigning, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B559)
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 1663
*/;
}
// Token: 0x0600B55A RID: 46426 RVA: 0x00273844 File Offset: 0x00271A44
[Token(Token = "0x600B55A")]
[Address(RVA = "0x2365010", Offset = "0x2364010", VA = "0x182365010", Slot = "13")]
public virtual void Update(byte input)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B55B RID: 46427 RVA: 0x00273860 File Offset: 0x00271A60
[Token(Token = "0x600B55B")]
[Address(RVA = "0x2364B20", Offset = "0x2363B20", VA = "0x182364B20", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int inOff, int length)
{
IDigest digest = this.digest;
}
// Token: 0x0600B55C RID: 46428 RVA: 0x0027387C File Offset: 0x00271A7C
[Token(Token = "0x600B55C")]
[Address(RVA = "0x2364C30", Offset = "0x2363C30", VA = "0x182364C30", Slot = "15")]
public virtual byte[] GenerateSignature()
{
/*
An exception occurred when decompiling this method (0600B55C)
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 1663
*/;
}
// Token: 0x0600B55D RID: 46429 RVA: 0x002738D0 File Offset: 0x00271AD0
[Token(Token = "0x600B55D")]
[Address(RVA = "0x2365070", Offset = "0x2364070", VA = "0x182365070", Slot = "16")]
public virtual bool VerifySignature(byte[] signature)
{
/*
An exception occurred when decompiling this method (0600B55D)
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 1663
*/;
}
// Token: 0x0600B55E RID: 46430 RVA: 0x00273954 File Offset: 0x00271B54
[Token(Token = "0x600B55E")]
[Address(RVA = "0x2364FC0", Offset = "0x2363FC0", VA = "0x182364FC0", Slot = "17")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B55F RID: 46431 RVA: 0x00273970 File Offset: 0x00271B70
[Token(Token = "0x600B55F")]
[Address(RVA = "0x2364BA0", Offset = "0x2363BA0", VA = "0x182364BA0")]
private byte[] DerEncode(byte[] hash)
{
AlgorithmIdentifier algorithmIdentifier = this.algId;
if (algorithmIdentifier != 0)
{
return new DigestInfo(algorithmIdentifier, hash).GetDerEncoded();
}
return hash;
}
// Token: 0x040072CF RID: 29391
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072CF")]
private readonly IAsymmetricBlockCipher rsaEngine;
// Token: 0x040072D0 RID: 29392
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072D0")]
private readonly AlgorithmIdentifier algId;
// Token: 0x040072D1 RID: 29393
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072D1")]
private readonly IDigest digest;
// Token: 0x040072D2 RID: 29394
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072D2")]
private bool forSigning;
// Token: 0x040072D3 RID: 29395
[Token(Token = "0x40072D3")]
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: 0x02001C9B RID: 7323
[Token(Token = "0x2001C9B")]
public class SM2Signer : ISigner
{
// Token: 0x0600B560 RID: 46432 RVA: 0x0027399C File Offset: 0x00271B9C
[Token(Token = "0x600B560")]
[Address(RVA = "0x2367170", Offset = "0x2366170", VA = "0x182367170")]
public SM2Signer()
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
SM3Digest sm3Digest = new SM3Digest();
this.digest = sm3Digest;
base..ctor();
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
}
// Token: 0x0600B561 RID: 46433 RVA: 0x002739D4 File Offset: 0x00271BD4
[Token(Token = "0x600B561")]
[Address(RVA = "0x2367220", Offset = "0x2366220", VA = "0x182367220")]
public SM2Signer(IDsaEncoding encoding)
{
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
this.kCalculator = randomDsaKCalculator;
SM3Digest sm3Digest = new SM3Digest();
this.digest = sm3Digest;
base..ctor();
this.encoding = encoding;
}
// Token: 0x17001C8B RID: 7307
// (get) Token: 0x0600B562 RID: 46434 RVA: 0x00273A08 File Offset: 0x00271C08
[Token(Token = "0x17001C8B")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B562")]
[Address(RVA = "0x23672B0", Offset = "0x23662B0", VA = "0x1823672B0", Slot = "11")]
get
{
return "SM2Sign";
}
}
// Token: 0x0600B563 RID: 46435 RVA: 0x00273A1C File Offset: 0x00271C1C
[Token(Token = "0x600B563")]
[Address(RVA = "0x2366760", Offset = "0x2365760", VA = "0x182366760", 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: 0x0600B564 RID: 46436 RVA: 0x00273B48 File Offset: 0x00271D48
[Token(Token = "0x600B564")]
[Address(RVA = "0x2366DA0", Offset = "0x2365DA0", VA = "0x182366DA0", Slot = "13")]
public virtual void Update(byte b)
{
this.digest.Update(b);
}
// Token: 0x0600B565 RID: 46437 RVA: 0x00273B68 File Offset: 0x00271D68
[Token(Token = "0x600B565")]
[Address(RVA = "0x2365EB0", Offset = "0x2364EB0", VA = "0x182365EB0", Slot = "14")]
public virtual void BlockUpdate(byte[] buf, int off, int len)
{
this.digest.BlockUpdate(buf, off, len);
}
// Token: 0x0600B566 RID: 46438 RVA: 0x00273B8C File Offset: 0x00271D8C
[Token(Token = "0x600B566")]
[Address(RVA = "0x2366DC0", Offset = "0x2365DC0", VA = "0x182366DC0", Slot = "15")]
public virtual bool VerifySignature(byte[] signature)
{
IDsaEncoding dsaEncoding = this.encoding;
byte[] seed = this.ecParams.seed;
bool flag;
return flag;
}
// Token: 0x0600B567 RID: 46439 RVA: 0x00273BD0 File Offset: 0x00271DD0
[Token(Token = "0x600B567")]
[Address(RVA = "0x2366D40", Offset = "0x2365D40", VA = "0x182366D40", 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: 0x0600B568 RID: 46440 RVA: 0x00273C18 File Offset: 0x00271E18
[Token(Token = "0x600B568")]
[Address(RVA = "0x2365F90", Offset = "0x2364F90", VA = "0x182365F90", 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: 0x0600B569 RID: 46441 RVA: 0x00273D2C File Offset: 0x00271F2C
[Token(Token = "0x600B569")]
[Address(RVA = "0x2366EB0", Offset = "0x2365EB0", VA = "0x182366EB0")]
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: 0x0600B56A RID: 46442 RVA: 0x00273DE4 File Offset: 0x00271FE4
[Token(Token = "0x600B56A")]
[Address(RVA = "0x23664F0", Offset = "0x23654F0", VA = "0x1823664F0")]
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: 0x0600B56B RID: 46443 RVA: 0x00273EB4 File Offset: 0x002720B4
[Token(Token = "0x600B56B")]
[Address(RVA = "0x2365E00", Offset = "0x2364E00", VA = "0x182365E00")]
private void AddUserID(IDigest digest, byte[] userID)
{
int length = userID.Length;
}
// Token: 0x0600B56C RID: 46444 RVA: 0x00273ED0 File Offset: 0x002720D0
[Token(Token = "0x600B56C")]
[Address(RVA = "0x2365D70", Offset = "0x2364D70", VA = "0x182365D70")]
private void AddFieldElement(IDigest digest, ECFieldElement v)
{
}
// Token: 0x0600B56D RID: 46445 RVA: 0x00273EE4 File Offset: 0x002720E4
[Token(Token = "0x600B56D")]
[Address(RVA = "0x2365EE0", Offset = "0x2364EE0", VA = "0x182365EE0", Slot = "18")]
protected virtual BigInteger CalculateE(byte[] message)
{
return new BigInteger(1, message);
}
// Token: 0x0600B56E RID: 46446 RVA: 0x00273EF8 File Offset: 0x002720F8
[Token(Token = "0x600B56E")]
[Address(RVA = "0x2365F40", Offset = "0x2364F40", VA = "0x182365F40", Slot = "19")]
protected virtual ECMultiplier CreateBasePointMultiplier()
{
/*
An exception occurred when decompiling this method (0600B56E)
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 1663
*/;
}
// Token: 0x040072D4 RID: 29396
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072D4")]
private readonly IDsaKCalculator kCalculator;
// Token: 0x040072D5 RID: 29397
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072D5")]
private readonly SM3Digest digest;
// Token: 0x040072D6 RID: 29398
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072D6")]
private readonly IDsaEncoding encoding;
// Token: 0x040072D7 RID: 29399
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072D7")]
private ECDomainParameters ecParams;
// Token: 0x040072D8 RID: 29400
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40072D8")]
private ECPoint pubPoint;
// Token: 0x040072D9 RID: 29401
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40072D9")]
private ECKeyParameters ecKey;
// Token: 0x040072DA RID: 29402
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40072DA")]
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: 0x02001C9C RID: 7324
[Token(Token = "0x2001C9C")]
public class StandardDsaEncoding : IDsaEncoding
{
// Token: 0x0600B56F RID: 46447 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B56F")]
[Address(RVA = "0x23417F0", Offset = "0x23407F0", VA = "0x1823417F0", Slot = "6")]
public virtual BigInteger[] Decode(BigInteger n, byte[] encoding)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B570 RID: 46448 RVA: 0x00273F0C File Offset: 0x0027210C
[Token(Token = "0x600B570")]
[Address(RVA = "0x2341AD0", Offset = "0x2340AD0", VA = "0x182341AD0", 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: 0x0600B571 RID: 46449 RVA: 0x00273F50 File Offset: 0x00272150
[Token(Token = "0x600B571")]
[Address(RVA = "0x2341630", Offset = "0x2340630", VA = "0x182341630", Slot = "8")]
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
{
if (n != 0)
{
int num = x.CompareTo(n);
}
return x;
}
// Token: 0x0600B572 RID: 46450 RVA: 0x00273F70 File Offset: 0x00272170
[Token(Token = "0x600B572")]
[Address(RVA = "0x23416D0", Offset = "0x23406D0", VA = "0x1823416D0", 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: 0x0600B573 RID: 46451 RVA: 0x00273F98 File Offset: 0x00272198
[Token(Token = "0x600B573")]
[Address(RVA = "0x2341A50", Offset = "0x2340A50", VA = "0x182341A50", Slot = "10")]
protected virtual DerInteger EncodeValue(BigInteger n, BigInteger x)
{
DerInteger derInteger;
return derInteger;
}
// Token: 0x0600B574 RID: 46452 RVA: 0x00273FA8 File Offset: 0x002721A8
[Token(Token = "0x600B574")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public StandardDsaEncoding()
{
}
// Token: 0x0600B575 RID: 46453 RVA: 0x00273FBC File Offset: 0x002721BC
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B575")]
[Address(RVA = "0x2341C60", Offset = "0x2340C60", VA = "0x182341C60")]
static StandardDsaEncoding()
{
StandardDsaEncoding standardDsaEncoding = new StandardDsaEncoding();
}
// Token: 0x040072DB RID: 29403
[Token(Token = "0x40072DB")]
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: 0x02001C9D RID: 7325
[Token(Token = "0x2001C9D")]
public class X931Signer : ISigner
{
// Token: 0x0600B576 RID: 46454 RVA: 0x00273FD0 File Offset: 0x002721D0
[Token(Token = "0x600B576")]
[Address(RVA = "0x2342960", Offset = "0x2341960", VA = "0x182342960")]
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
{
/*
An exception occurred when decompiling this method (0600B576)
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 1663
*/;
}
// Token: 0x17001C8C RID: 7308
// (get) Token: 0x0600B577 RID: 46455 RVA: 0x0027402C File Offset: 0x0027222C
[Token(Token = "0x17001C8C")]
public virtual string AlgorithmName
{
[Token(Token = "0x600B577")]
[Address(RVA = "0x2342A60", Offset = "0x2341A60", VA = "0x182342A60", Slot = "11")]
get
{
IDigest digest = this.digest;
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
string text;
return text;
}
}
// Token: 0x0600B578 RID: 46456 RVA: 0x00274054 File Offset: 0x00272254
[Token(Token = "0x600B578")]
[Address(RVA = "0x2342870", Offset = "0x2341870", VA = "0x182342870")]
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest)
{
/*
An exception occurred when decompiling this method (0600B578)
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 1663
*/;
}
// Token: 0x0600B579 RID: 46457 RVA: 0x0027409C File Offset: 0x0027229C
[Token(Token = "0x600B579")]
[Address(RVA = "0x23424B0", Offset = "0x23414B0", VA = "0x1823424B0", 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: 0x0600B57A RID: 46458 RVA: 0x00274104 File Offset: 0x00272304
[Token(Token = "0x600B57A")]
[Address(RVA = "0x2342160", Offset = "0x2341160", VA = "0x182342160")]
private void ClearBlock(byte[] block)
{
int length = block.Length;
int num = 0;
Array.Clear(block, num, length);
}
// Token: 0x0600B57B RID: 46459 RVA: 0x00274128 File Offset: 0x00272328
[Token(Token = "0x600B57B")]
[Address(RVA = "0x2342610", Offset = "0x2341610", VA = "0x182342610", Slot = "13")]
public virtual void Update(byte b)
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B57C RID: 46460 RVA: 0x00274144 File Offset: 0x00272344
[Token(Token = "0x600B57C")]
[Address(RVA = "0x23420E0", Offset = "0x23410E0", VA = "0x1823420E0", Slot = "14")]
public virtual void BlockUpdate(byte[] input, int off, int len)
{
IDigest digest = this.digest;
}
// Token: 0x0600B57D RID: 46461 RVA: 0x00274160 File Offset: 0x00272360
[Token(Token = "0x600B57D")]
[Address(RVA = "0x23425C0", Offset = "0x23415C0", VA = "0x1823425C0", Slot = "15")]
public virtual void Reset()
{
IDigest digest = this.digest;
throw new NullReferenceException();
}
// Token: 0x0600B57E RID: 46462 RVA: 0x0027417C File Offset: 0x0027237C
[Token(Token = "0x600B57E")]
[Address(RVA = "0x2342390", Offset = "0x2341390", VA = "0x182342390", 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: 0x0600B57F RID: 46463 RVA: 0x00274200 File Offset: 0x00272400
[Token(Token = "0x600B57F")]
[Address(RVA = "0x2342190", Offset = "0x2341190", VA = "0x182342190")]
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: 0x0600B580 RID: 46464 RVA: 0x002742B8 File Offset: 0x002724B8
[Token(Token = "0x600B580")]
[Address(RVA = "0x2342670", Offset = "0x2341670", VA = "0x182342670", 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: 0x040072DC RID: 29404
[Token(Token = "0x40072DC")]
[Obsolete]
public const int TRAILER_IMPLICIT = 188;
// Token: 0x040072DD RID: 29405
[Token(Token = "0x40072DD")]
[Obsolete]
public const int TRAILER_RIPEMD160 = 12748;
// Token: 0x040072DE RID: 29406
[Token(Token = "0x40072DE")]
[Obsolete]
public const int TRAILER_RIPEMD128 = 13004;
// Token: 0x040072DF RID: 29407
[Token(Token = "0x40072DF")]
[Obsolete]
public const int TRAILER_SHA1 = 13260;
// Token: 0x040072E0 RID: 29408
[Token(Token = "0x40072E0")]
[Obsolete]
public const int TRAILER_SHA256 = 13516;
// Token: 0x040072E1 RID: 29409
[Token(Token = "0x40072E1")]
[Obsolete]
public const int TRAILER_SHA512 = 13772;
// Token: 0x040072E2 RID: 29410
[Token(Token = "0x40072E2")]
[Obsolete]
public const int TRAILER_SHA384 = 14028;
// Token: 0x040072E3 RID: 29411
[Token(Token = "0x40072E3")]
[Obsolete]
public const int TRAILER_WHIRLPOOL = 14284;
// Token: 0x040072E4 RID: 29412
[Token(Token = "0x40072E4")]
[Obsolete]
public const int TRAILER_SHA224 = 14540;
// Token: 0x040072E5 RID: 29413
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072E5")]
private IDigest digest;
// Token: 0x040072E6 RID: 29414
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072E6")]
private IAsymmetricBlockCipher cipher;
// Token: 0x040072E7 RID: 29415
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072E7")]
private RsaKeyParameters kParam;
// Token: 0x040072E8 RID: 29416
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072E8")]
private int trailer;
// Token: 0x040072E9 RID: 29417
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x40072E9")]
private int keyBits;
// Token: 0x040072EA RID: 29418
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40072EA")]
private byte[] block;
}
}