scripts
This commit is contained in:
+190
@@ -0,0 +1,190 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015C4 RID: 5572
|
||||
[Token(Token = "0x20015C4")]
|
||||
[StructLayout(3)]
|
||||
public class DsaDigestSigner : ISigner
|
||||
{
|
||||
// Token: 0x060094E2 RID: 38114 RVA: 0x0020ED78 File Offset: 0x0020CF78
|
||||
[Token(Token = "0x60094E2")]
|
||||
[Address(RVA = "0x1E3ACB0", Offset = "0x1E396B0", VA = "0x181E3ACB0")]
|
||||
public DsaDigestSigner(IDsa dsa, IDigest digest)
|
||||
{
|
||||
this.dsa = dsa;
|
||||
this.digest = digest;
|
||||
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
|
||||
}
|
||||
|
||||
// Token: 0x060094E3 RID: 38115 RVA: 0x0020EDA4 File Offset: 0x0020CFA4
|
||||
[Token(Token = "0x60094E3")]
|
||||
[Address(RVA = "0x74BD80", Offset = "0x74A780", VA = "0x18074BD80")]
|
||||
public DsaDigestSigner(IDsaExt dsa, IDigest digest, IDsaEncoding encoding)
|
||||
{
|
||||
this.dsa = dsa;
|
||||
this.digest = digest;
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
// Token: 0x170017D4 RID: 6100
|
||||
// (get) Token: 0x060094E4 RID: 38116 RVA: 0x0020EDCC File Offset: 0x0020CFCC
|
||||
[Token(Token = "0x170017D4")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60094E4")]
|
||||
[Address(RVA = "0x1E3AD40", Offset = "0x1E39740", VA = "0x181E3AD40", Slot = "11")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
IDsa dsa = this.dsa;
|
||||
string text;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060094E5 RID: 38117 RVA: 0x0020EDF0 File Offset: 0x0020CFF0
|
||||
[Token(Token = "0x60094E5")]
|
||||
[Address(RVA = "0x1E3A7B0", Offset = "0x1E391B0", VA = "0x181E3A7B0", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060094E5)
|
||||
|
||||
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: 0x060094E6 RID: 38118 RVA: 0x0020EE60 File Offset: 0x0020D060
|
||||
[Token(Token = "0x60094E6")]
|
||||
[Address(RVA = "0x1E3AA80", Offset = "0x1E39480", VA = "0x181E3AA80", Slot = "13")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060094E7 RID: 38119 RVA: 0x0020EE7C File Offset: 0x0020D07C
|
||||
[Token(Token = "0x60094E7")]
|
||||
[Address(RVA = "0x1E3A490", Offset = "0x1E38E90", VA = "0x181E3A490", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int inOff, int length)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
}
|
||||
|
||||
// Token: 0x060094E8 RID: 38120 RVA: 0x0020EE98 File Offset: 0x0020D098
|
||||
[Token(Token = "0x60094E8")]
|
||||
[Address(RVA = "0x1E3A510", Offset = "0x1E38F10", VA = "0x181E3A510", 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: 0x060094E9 RID: 38121 RVA: 0x0020EF24 File Offset: 0x0020D124
|
||||
[Token(Token = "0x60094E9")]
|
||||
[Address(RVA = "0x1E3AAE0", Offset = "0x1E394E0", VA = "0x181E3AAE0", 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: 0x060094EA RID: 38122 RVA: 0x0020EF9C File Offset: 0x0020D19C
|
||||
[Token(Token = "0x60094EA")]
|
||||
[Address(RVA = "0x1E3AA30", Offset = "0x1E39430", VA = "0x181E3AA30", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060094EB RID: 38123 RVA: 0x0020EFB8 File Offset: 0x0020D1B8
|
||||
[Token(Token = "0x60094EB")]
|
||||
[Address(RVA = "0x1E3A6F0", Offset = "0x1E390F0", VA = "0x181E3A6F0", Slot = "18")]
|
||||
protected virtual BigInteger GetOrder()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060094EB)
|
||||
|
||||
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: 0x04006255 RID: 25173
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006255")]
|
||||
private readonly IDsa dsa;
|
||||
|
||||
// Token: 0x04006256 RID: 25174
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006256")]
|
||||
private readonly IDigest digest;
|
||||
|
||||
// Token: 0x04006257 RID: 25175
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006257")]
|
||||
private readonly IDsaEncoding encoding;
|
||||
|
||||
// Token: 0x04006258 RID: 25176
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006258")]
|
||||
private bool forSigning;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015C5 RID: 5573
|
||||
[Token(Token = "0x20015C5")]
|
||||
[StructLayout(3)]
|
||||
public class DsaSigner : IDsaExt, IDsa
|
||||
{
|
||||
// Token: 0x060094EC RID: 38124 RVA: 0x0020EFCC File Offset: 0x0020D1CC
|
||||
[Token(Token = "0x60094EC")]
|
||||
[Address(RVA = "0x1E3B720", Offset = "0x1E3A120", VA = "0x181E3B720")]
|
||||
public DsaSigner()
|
||||
{
|
||||
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
|
||||
this.kCalculator = randomDsaKCalculator;
|
||||
}
|
||||
|
||||
// Token: 0x060094ED RID: 38125 RVA: 0x0020EFEC File Offset: 0x0020D1EC
|
||||
[Token(Token = "0x60094ED")]
|
||||
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
|
||||
public DsaSigner(IDsaKCalculator kCalculator)
|
||||
{
|
||||
this.kCalculator = kCalculator;
|
||||
}
|
||||
|
||||
// Token: 0x170017D5 RID: 6101
|
||||
// (get) Token: 0x060094EE RID: 38126 RVA: 0x0020F008 File Offset: 0x0020D208
|
||||
[Token(Token = "0x170017D5")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60094EE")]
|
||||
[Address(RVA = "0x1E3B780", Offset = "0x1E3A180", VA = "0x181E3B780", Slot = "9")]
|
||||
get
|
||||
{
|
||||
return "DSA";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060094EF RID: 38127 RVA: 0x0020F01C File Offset: 0x0020D21C
|
||||
[Token(Token = "0x60094EF")]
|
||||
[Address(RVA = "0x1E3B210", Offset = "0x1E39C10", VA = "0x181E3B210", Slot = "10")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060094EF)
|
||||
|
||||
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: 0x170017D6 RID: 6102
|
||||
// (get) Token: 0x060094F0 RID: 38128 RVA: 0x0020F094 File Offset: 0x0020D294
|
||||
[Token(Token = "0x170017D6")]
|
||||
public virtual BigInteger Order
|
||||
{
|
||||
[Token(Token = "0x60094F0")]
|
||||
[Address(RVA = "0x1E3B7B0", Offset = "0x1E3A1B0", VA = "0x181E3B7B0", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return this.key.parameters.q;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060094F1 RID: 38129 RVA: 0x0020F0B8 File Offset: 0x0020D2B8
|
||||
[Token(Token = "0x60094F1")]
|
||||
[Address(RVA = "0x1E3AE90", Offset = "0x1E39890", VA = "0x181E3AE90", 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: 0x060094F2 RID: 38130 RVA: 0x0020F164 File Offset: 0x0020D364
|
||||
[Token(Token = "0x60094F2")]
|
||||
[Address(RVA = "0x1E3B4F0", Offset = "0x1E39EF0", VA = "0x181E3B4F0", 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: 0x060094F3 RID: 38131 RVA: 0x0020F214 File Offset: 0x0020D414
|
||||
[Token(Token = "0x60094F3")]
|
||||
[Address(RVA = "0x1E3ADC0", Offset = "0x1E397C0", VA = "0x181E3ADC0", 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: 0x060094F4 RID: 38132 RVA: 0x0020F254 File Offset: 0x0020D454
|
||||
[Token(Token = "0x60094F4")]
|
||||
[Address(RVA = "0x1E3B1A0", Offset = "0x1E39BA0", VA = "0x181E3B1A0", Slot = "15")]
|
||||
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (!needed)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (provided != 0);
|
||||
return new SecureRandom();
|
||||
}
|
||||
|
||||
// Token: 0x04006259 RID: 25177
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006259")]
|
||||
protected readonly IDsaKCalculator kCalculator;
|
||||
|
||||
// Token: 0x0400625A RID: 25178
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400625A")]
|
||||
protected DsaKeyParameters key;
|
||||
|
||||
// Token: 0x0400625B RID: 25179
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400625B")]
|
||||
protected SecureRandom random;
|
||||
}
|
||||
}
|
||||
+278
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015C6 RID: 5574
|
||||
[Token(Token = "0x20015C6")]
|
||||
[StructLayout(3)]
|
||||
public class ECDsaSigner : IDsaExt, IDsa
|
||||
{
|
||||
// Token: 0x060094F5 RID: 38133 RVA: 0x0020F270 File Offset: 0x0020D470
|
||||
[Token(Token = "0x60094F5")]
|
||||
[Address(RVA = "0x1E3C5E0", Offset = "0x1E3AFE0", VA = "0x181E3C5E0")]
|
||||
public ECDsaSigner()
|
||||
{
|
||||
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
|
||||
this.kCalculator = randomDsaKCalculator;
|
||||
}
|
||||
|
||||
// Token: 0x060094F6 RID: 38134 RVA: 0x0020F290 File Offset: 0x0020D490
|
||||
[Token(Token = "0x60094F6")]
|
||||
[Address(RVA = "0x3C3A30", Offset = "0x3C2430", VA = "0x1803C3A30")]
|
||||
public ECDsaSigner(IDsaKCalculator kCalculator)
|
||||
{
|
||||
this.kCalculator = kCalculator;
|
||||
}
|
||||
|
||||
// Token: 0x170017D7 RID: 6103
|
||||
// (get) Token: 0x060094F7 RID: 38135 RVA: 0x0020F2AC File Offset: 0x0020D4AC
|
||||
[Token(Token = "0x170017D7")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60094F7")]
|
||||
[Address(RVA = "0x1E3C640", Offset = "0x1E3B040", VA = "0x181E3C640", Slot = "9")]
|
||||
get
|
||||
{
|
||||
return "ECDSA";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060094F8 RID: 38136 RVA: 0x0020F2C0 File Offset: 0x0020D4C0
|
||||
[Token(Token = "0x60094F8")]
|
||||
[Address(RVA = "0x1E3BEB0", Offset = "0x1E3A8B0", VA = "0x181E3BEB0", Slot = "10")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060094F8)
|
||||
|
||||
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: 0x170017D8 RID: 6104
|
||||
// (get) Token: 0x060094F9 RID: 38137 RVA: 0x0020F350 File Offset: 0x0020D550
|
||||
[Token(Token = "0x170017D8")]
|
||||
public virtual BigInteger Order
|
||||
{
|
||||
[Token(Token = "0x60094F9")]
|
||||
[Address(RVA = "0x1E3C670", Offset = "0x1E3B070", VA = "0x181E3C670", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return this.key.parameters.n;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060094FA RID: 38138 RVA: 0x0020F374 File Offset: 0x0020D574
|
||||
[Token(Token = "0x60094FA")]
|
||||
[Address(RVA = "0x1E3B8F0", Offset = "0x1E3A2F0", VA = "0x181E3B8F0", 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: 0x060094FB RID: 38139 RVA: 0x0020F448 File Offset: 0x0020D648
|
||||
[Token(Token = "0x60094FB")]
|
||||
[Address(RVA = "0x1E3C190", Offset = "0x1E3AB90", VA = "0x181E3C190", 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: 0x060094FC RID: 38140 RVA: 0x0020F538 File Offset: 0x0020D738
|
||||
[Token(Token = "0x60094FC")]
|
||||
[Address(RVA = "0x1E3B7E0", Offset = "0x1E3A1E0", VA = "0x181E3B7E0", 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: 0x060094FD RID: 38141 RVA: 0x0020F578 File Offset: 0x0020D778
|
||||
[Token(Token = "0x60094FD")]
|
||||
[Address(RVA = "0x1E3B8A0", Offset = "0x1E3A2A0", VA = "0x181E3B8A0", Slot = "15")]
|
||||
protected virtual ECMultiplier CreateBasePointMultiplier()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060094FD)
|
||||
|
||||
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: 0x060094FE RID: 38142 RVA: 0x0020F58C File Offset: 0x0020D78C
|
||||
[Token(Token = "0x60094FE")]
|
||||
[Address(RVA = "0x1E3BD90", Offset = "0x1E3A790", VA = "0x181E3BD90", 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: 0x060094FF RID: 38143 RVA: 0x0020F5B8 File Offset: 0x0020D7B8
|
||||
[Token(Token = "0x60094FF")]
|
||||
[Address(RVA = "0x1E3BE40", Offset = "0x1E3A840", VA = "0x181E3BE40", Slot = "17")]
|
||||
protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (!needed)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (provided != 0);
|
||||
return new SecureRandom();
|
||||
}
|
||||
|
||||
// Token: 0x06009500 RID: 38144 RVA: 0x0020F5D4 File Offset: 0x0020D7D4
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x6009500")]
|
||||
[Address(RVA = "0x1E3C580", Offset = "0x1E3AF80", VA = "0x181E3C580")]
|
||||
static ECDsaSigner()
|
||||
{
|
||||
BigInteger bigInteger;
|
||||
ECDsaSigner.Eight = bigInteger;
|
||||
}
|
||||
|
||||
// Token: 0x0400625C RID: 25180
|
||||
[Token(Token = "0x400625C")]
|
||||
private static readonly BigInteger Eight;
|
||||
|
||||
// Token: 0x0400625D RID: 25181
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400625D")]
|
||||
protected readonly IDsaKCalculator kCalculator;
|
||||
|
||||
// Token: 0x0400625E RID: 25182
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400625E")]
|
||||
protected ECKeyParameters key;
|
||||
|
||||
// Token: 0x0400625F RID: 25183
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400625F")]
|
||||
protected SecureRandom random;
|
||||
}
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015C7 RID: 5575
|
||||
[Token(Token = "0x20015C7")]
|
||||
[StructLayout(3)]
|
||||
public class ECGost3410Signer : IDsaExt, IDsa
|
||||
{
|
||||
// Token: 0x170017D9 RID: 6105
|
||||
// (get) Token: 0x06009501 RID: 38145 RVA: 0x0020F5E8 File Offset: 0x0020D7E8
|
||||
[Token(Token = "0x170017D9")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009501")]
|
||||
[Address(RVA = "0x1E3D1C0", Offset = "0x1E3BBC0", VA = "0x181E3D1C0", Slot = "9")]
|
||||
get
|
||||
{
|
||||
return "ECGOST3410";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009502 RID: 38146 RVA: 0x0020F5FC File Offset: 0x0020D7FC
|
||||
[Token(Token = "0x6009502")]
|
||||
[Address(RVA = "0x1E3CB50", Offset = "0x1E3B550", VA = "0x181E3CB50", Slot = "10")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009502)
|
||||
|
||||
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: 0x170017DA RID: 6106
|
||||
// (get) Token: 0x06009503 RID: 38147 RVA: 0x0020F674 File Offset: 0x0020D874
|
||||
[Token(Token = "0x170017DA")]
|
||||
public virtual BigInteger Order
|
||||
{
|
||||
[Token(Token = "0x6009503")]
|
||||
[Address(RVA = "0x1E3D1F0", Offset = "0x1E3BBF0", VA = "0x181E3D1F0", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return this.key.parameters.n;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009504 RID: 38148 RVA: 0x0020F698 File Offset: 0x0020D898
|
||||
[Token(Token = "0x6009504")]
|
||||
[Address(RVA = "0x1E3C6F0", Offset = "0x1E3B0F0", VA = "0x181E3C6F0", 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: 0x06009505 RID: 38149 RVA: 0x0020F78C File Offset: 0x0020D98C
|
||||
[Token(Token = "0x6009505")]
|
||||
[Address(RVA = "0x1E3CDE0", Offset = "0x1E3B7E0", VA = "0x181E3CDE0", 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: 0x06009506 RID: 38150 RVA: 0x0020F890 File Offset: 0x0020DA90
|
||||
[Token(Token = "0x6009506")]
|
||||
[Address(RVA = "0x1E3C6A0", Offset = "0x1E3B0A0", VA = "0x181E3C6A0", Slot = "14")]
|
||||
protected virtual ECMultiplier CreateBasePointMultiplier()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009506)
|
||||
|
||||
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: 0x06009507 RID: 38151 RVA: 0x0020F8A4 File Offset: 0x0020DAA4
|
||||
[Token(Token = "0x6009507")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public ECGost3410Signer()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04006260 RID: 25184
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006260")]
|
||||
private ECKeyParameters key;
|
||||
|
||||
// Token: 0x04006261 RID: 25185
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006261")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015C8 RID: 5576
|
||||
[Token(Token = "0x20015C8")]
|
||||
[StructLayout(3)]
|
||||
public class ECNRSigner : IDsaExt, IDsa
|
||||
{
|
||||
// Token: 0x170017DB RID: 6107
|
||||
// (get) Token: 0x06009508 RID: 38152 RVA: 0x0020F8B8 File Offset: 0x0020DAB8
|
||||
[Token(Token = "0x170017DB")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009508")]
|
||||
[Address(RVA = "0x1E3DCC0", Offset = "0x1E3C6C0", VA = "0x181E3DCC0", Slot = "9")]
|
||||
get
|
||||
{
|
||||
return "ECNR";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009509 RID: 38153 RVA: 0x0020F8CC File Offset: 0x0020DACC
|
||||
[Token(Token = "0x6009509")]
|
||||
[Address(RVA = "0x1E3D6F0", Offset = "0x1E3C0F0", VA = "0x181E3D6F0", Slot = "10")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009509)
|
||||
|
||||
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: 0x170017DC RID: 6108
|
||||
// (get) Token: 0x0600950A RID: 38154 RVA: 0x0020F94C File Offset: 0x0020DB4C
|
||||
[Token(Token = "0x170017DC")]
|
||||
public virtual BigInteger Order
|
||||
{
|
||||
[Token(Token = "0x600950A")]
|
||||
[Address(RVA = "0x1E3C670", Offset = "0x1E3B070", VA = "0x181E3C670", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return this.key.parameters.n;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600950B RID: 38155 RVA: 0x0020F970 File Offset: 0x0020DB70
|
||||
[Token(Token = "0x600950B")]
|
||||
[Address(RVA = "0x1E3D220", Offset = "0x1E3BC20", VA = "0x181E3D220", Slot = "12")]
|
||||
public virtual BigInteger[] GenerateSignature(byte[] message)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600950B)
|
||||
|
||||
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: 0x0600950C RID: 38156 RVA: 0x0020FA58 File Offset: 0x0020DC58
|
||||
[Token(Token = "0x600950C")]
|
||||
[Address(RVA = "0x1E3D980", Offset = "0x1E3C380", VA = "0x181E3D980", Slot = "13")]
|
||||
public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600950C)
|
||||
|
||||
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: 0x0600950D RID: 38157 RVA: 0x0020FB14 File Offset: 0x0020DD14
|
||||
[Token(Token = "0x600950D")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public ECNRSigner()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04006262 RID: 25186
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006262")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x04006263 RID: 25187
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006263")]
|
||||
private ECKeyParameters key;
|
||||
|
||||
// Token: 0x04006264 RID: 25188
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006264")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015C9 RID: 5577
|
||||
[Token(Token = "0x20015C9")]
|
||||
[StructLayout(3)]
|
||||
public class Ed25519Signer : ISigner
|
||||
{
|
||||
// Token: 0x0600950E RID: 38158 RVA: 0x0020FB28 File Offset: 0x0020DD28
|
||||
[Token(Token = "0x600950E")]
|
||||
[Address(RVA = "0x1E3DF00", Offset = "0x1E3C900", VA = "0x181E3DF00")]
|
||||
public Ed25519Signer()
|
||||
{
|
||||
Ed25519Signer.Buffer buffer = new Ed25519Signer.Buffer();
|
||||
this.buffer = buffer;
|
||||
base..ctor();
|
||||
}
|
||||
|
||||
// Token: 0x170017DD RID: 6109
|
||||
// (get) Token: 0x0600950F RID: 38159 RVA: 0x0020FB48 File Offset: 0x0020DD48
|
||||
[Token(Token = "0x170017DD")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600950F")]
|
||||
[Address(RVA = "0x1E3DF60", Offset = "0x1E3C960", VA = "0x181E3DF60", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "Ed25519";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009510 RID: 38160 RVA: 0x0020FB5C File Offset: 0x0020DD5C
|
||||
[Token(Token = "0x6009510")]
|
||||
[Address(RVA = "0x1E3DD80", Offset = "0x1E3C780", VA = "0x181E3DD80", 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: 0x06009511 RID: 38161 RVA: 0x0020FBA4 File Offset: 0x0020DDA4
|
||||
[Token(Token = "0x6009511")]
|
||||
[Address(RVA = "0xA20E50", Offset = "0xA1F850", VA = "0x180A20E50", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
((IDisposable)this.buffer).Dispose();
|
||||
}
|
||||
|
||||
// Token: 0x06009512 RID: 38162 RVA: 0x0020FBC4 File Offset: 0x0020DDC4
|
||||
[Token(Token = "0x6009512")]
|
||||
[Address(RVA = "0xA20FC0", Offset = "0xA1F9C0", VA = "0x180A20FC0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
int num = this.buffer.Read(buf, off, len);
|
||||
}
|
||||
|
||||
// Token: 0x06009513 RID: 38163 RVA: 0x0020FBE8 File Offset: 0x0020DDE8
|
||||
[Token(Token = "0x6009513")]
|
||||
[Address(RVA = "0x1E3DCF0", Offset = "0x1E3C6F0", VA = "0x181E3DCF0", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009513)
|
||||
|
||||
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: 0x06009514 RID: 38164 RVA: 0x0020FC2C File Offset: 0x0020DE2C
|
||||
[Token(Token = "0x6009514")]
|
||||
[Address(RVA = "0x1E3DE70", Offset = "0x1E3C870", VA = "0x181E3DE70", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009514)
|
||||
|
||||
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: 0x06009515 RID: 38165 RVA: 0x0020FC68 File Offset: 0x0020DE68
|
||||
[Token(Token = "0x6009515")]
|
||||
[Address(RVA = "0x1E3DE50", Offset = "0x1E3C850", VA = "0x181E3DE50", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
this.buffer.Reset();
|
||||
}
|
||||
|
||||
// Token: 0x04006265 RID: 25189
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006265")]
|
||||
private readonly Ed25519Signer.Buffer buffer;
|
||||
|
||||
// Token: 0x04006266 RID: 25190
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006266")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x04006267 RID: 25191
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006267")]
|
||||
private Ed25519PrivateKeyParameters privateKey;
|
||||
|
||||
// Token: 0x04006268 RID: 25192
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006268")]
|
||||
private Ed25519PublicKeyParameters publicKey;
|
||||
|
||||
// Token: 0x020015CA RID: 5578
|
||||
[Token(Token = "0x20015CA")]
|
||||
private class Buffer : MemoryStream
|
||||
{
|
||||
// Token: 0x06009516 RID: 38166 RVA: 0x0020FC88 File Offset: 0x0020DE88
|
||||
[Token(Token = "0x6009516")]
|
||||
[Address(RVA = "0x1E38E30", Offset = "0x1E37830", VA = "0x181E38E30")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x06009517 RID: 38167 RVA: 0x0020FCC4 File Offset: 0x0020DEC4
|
||||
[Token(Token = "0x6009517")]
|
||||
[Address(RVA = "0x1E39650", Offset = "0x1E38050", VA = "0x181E39650")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
bool flag;
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06009518 RID: 38168 RVA: 0x0020FCFC File Offset: 0x0020DEFC
|
||||
[Token(Token = "0x6009518")]
|
||||
[Address(RVA = "0x1E393B0", Offset = "0x1E37DB0", VA = "0x181E393B0")]
|
||||
internal void Reset()
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
long length = this.Length;
|
||||
long position = this.Position;
|
||||
Monitor.Exit(this);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x06009519 RID: 38169 RVA: 0x0020FD28 File Offset: 0x0020DF28
|
||||
[Token(Token = "0x6009519")]
|
||||
[Address(RVA = "0x1E39980", Offset = "0x1E38380", VA = "0x181E39980")]
|
||||
public Buffer()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015CB RID: 5579
|
||||
[Token(Token = "0x20015CB")]
|
||||
[StructLayout(3)]
|
||||
public class Ed25519ctxSigner : ISigner
|
||||
{
|
||||
// Token: 0x0600951A RID: 38170 RVA: 0x0020FD3C File Offset: 0x0020DF3C
|
||||
[Token(Token = "0x600951A")]
|
||||
[Address(RVA = "0x1E3E1B0", Offset = "0x1E3CBB0", VA = "0x181E3E1B0")]
|
||||
public Ed25519ctxSigner(byte[] context)
|
||||
{
|
||||
Ed25519ctxSigner.Buffer buffer = new Ed25519ctxSigner.Buffer();
|
||||
this.buffer = buffer;
|
||||
base..ctor();
|
||||
byte[] array = Arrays.Clone(context);
|
||||
this.context = array;
|
||||
}
|
||||
|
||||
// Token: 0x170017DE RID: 6110
|
||||
// (get) Token: 0x0600951B RID: 38171 RVA: 0x0020FD6C File Offset: 0x0020DF6C
|
||||
[Token(Token = "0x170017DE")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600951B")]
|
||||
[Address(RVA = "0x1E3E250", Offset = "0x1E3CC50", VA = "0x181E3E250", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "Ed25519ctx";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600951C RID: 38172 RVA: 0x0020FD80 File Offset: 0x0020DF80
|
||||
[Token(Token = "0x600951C")]
|
||||
[Address(RVA = "0x1E3E020", Offset = "0x1E3CA20", VA = "0x181E3E020", 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: 0x0600951D RID: 38173 RVA: 0x0020FDC8 File Offset: 0x0020DFC8
|
||||
[Token(Token = "0x600951D")]
|
||||
[Address(RVA = "0xA20E50", Offset = "0xA1F850", VA = "0x180A20E50", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
((IDisposable)this.buffer).Dispose();
|
||||
}
|
||||
|
||||
// Token: 0x0600951E RID: 38174 RVA: 0x0020FDE8 File Offset: 0x0020DFE8
|
||||
[Token(Token = "0x600951E")]
|
||||
[Address(RVA = "0xA20FC0", Offset = "0xA1F9C0", VA = "0x180A20FC0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
int num = this.buffer.Read(buf, off, len);
|
||||
}
|
||||
|
||||
// Token: 0x0600951F RID: 38175 RVA: 0x0020FE0C File Offset: 0x0020E00C
|
||||
[Token(Token = "0x600951F")]
|
||||
[Address(RVA = "0x1E3DF90", Offset = "0x1E3C990", VA = "0x181E3DF90", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600951F)
|
||||
|
||||
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: 0x06009520 RID: 38176 RVA: 0x0020FE58 File Offset: 0x0020E058
|
||||
[Token(Token = "0x6009520")]
|
||||
[Address(RVA = "0x1E3E110", Offset = "0x1E3CB10", VA = "0x181E3E110", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009520)
|
||||
|
||||
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: 0x06009521 RID: 38177 RVA: 0x0020FE9C File Offset: 0x0020E09C
|
||||
[Token(Token = "0x6009521")]
|
||||
[Address(RVA = "0x1E3E0F0", Offset = "0x1E3CAF0", VA = "0x181E3E0F0", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
this.buffer.Reset();
|
||||
}
|
||||
|
||||
// Token: 0x04006269 RID: 25193
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006269")]
|
||||
private readonly Ed25519ctxSigner.Buffer buffer;
|
||||
|
||||
// Token: 0x0400626A RID: 25194
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400626A")]
|
||||
private readonly byte[] context;
|
||||
|
||||
// Token: 0x0400626B RID: 25195
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400626B")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x0400626C RID: 25196
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x400626C")]
|
||||
private Ed25519PrivateKeyParameters privateKey;
|
||||
|
||||
// Token: 0x0400626D RID: 25197
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x400626D")]
|
||||
private Ed25519PublicKeyParameters publicKey;
|
||||
|
||||
// Token: 0x020015CC RID: 5580
|
||||
[Token(Token = "0x20015CC")]
|
||||
private class Buffer : MemoryStream
|
||||
{
|
||||
// Token: 0x06009522 RID: 38178 RVA: 0x0020FEBC File Offset: 0x0020E0BC
|
||||
[Token(Token = "0x6009522")]
|
||||
[Address(RVA = "0x1E38FE0", Offset = "0x1E379E0", VA = "0x181E38FE0")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x06009523 RID: 38179 RVA: 0x0020FEF8 File Offset: 0x0020E0F8
|
||||
[Token(Token = "0x6009523")]
|
||||
[Address(RVA = "0x1E394B0", Offset = "0x1E37EB0", VA = "0x181E394B0")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06009524 RID: 38180 RVA: 0x0020FF48 File Offset: 0x0020E148
|
||||
[Token(Token = "0x6009524")]
|
||||
[Address(RVA = "0x1E392B0", Offset = "0x1E37CB0", VA = "0x181E392B0")]
|
||||
internal void Reset()
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
long length = this.Length;
|
||||
long position = this.Position;
|
||||
Monitor.Exit(this);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x06009525 RID: 38181 RVA: 0x0020FF74 File Offset: 0x0020E174
|
||||
[Token(Token = "0x6009525")]
|
||||
[Address(RVA = "0x1E39980", Offset = "0x1E38380", VA = "0x181E39980")]
|
||||
public Buffer()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015CD RID: 5581
|
||||
[Token(Token = "0x20015CD")]
|
||||
[StructLayout(3)]
|
||||
public class Ed25519phSigner : ISigner
|
||||
{
|
||||
// Token: 0x06009526 RID: 38182 RVA: 0x0020FF88 File Offset: 0x0020E188
|
||||
[Token(Token = "0x6009526")]
|
||||
[Address(RVA = "0x1E3E7A0", Offset = "0x1E3D1A0", VA = "0x181E3E7A0")]
|
||||
public Ed25519phSigner(byte[] context)
|
||||
{
|
||||
IDigest digest = Ed25519.CreatePrehash();
|
||||
this.prehash = digest;
|
||||
base..ctor();
|
||||
byte[] array = Arrays.Clone(context);
|
||||
this.context = array;
|
||||
}
|
||||
|
||||
// Token: 0x170017DF RID: 6111
|
||||
// (get) Token: 0x06009527 RID: 38183 RVA: 0x0020FFB8 File Offset: 0x0020E1B8
|
||||
[Token(Token = "0x170017DF")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009527")]
|
||||
[Address(RVA = "0x1E3E840", Offset = "0x1E3D240", VA = "0x181E3E840", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "Ed25519ph";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009528 RID: 38184 RVA: 0x0020FFCC File Offset: 0x0020E1CC
|
||||
[Token(Token = "0x6009528")]
|
||||
[Address(RVA = "0x1E3E520", Offset = "0x1E3CF20", VA = "0x181E3E520", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009528)
|
||||
|
||||
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: 0x06009529 RID: 38185 RVA: 0x00210014 File Offset: 0x0020E214
|
||||
[Token(Token = "0x6009529")]
|
||||
[Address(RVA = "0x1E3E660", Offset = "0x1E3D060", VA = "0x181E3E660", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
IDigest digest = this.prehash;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600952A RID: 38186 RVA: 0x00210030 File Offset: 0x0020E230
|
||||
[Token(Token = "0x600952A")]
|
||||
[Address(RVA = "0x1E3E280", Offset = "0x1E3CC80", VA = "0x181E3E280", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
IDigest digest = this.prehash;
|
||||
}
|
||||
|
||||
// Token: 0x0600952B RID: 38187 RVA: 0x0021004C File Offset: 0x0020E24C
|
||||
[Token(Token = "0x600952B")]
|
||||
[Address(RVA = "0x1E3E300", Offset = "0x1E3CD00", VA = "0x181E3E300", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600952B)
|
||||
|
||||
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: 0x0600952C RID: 38188 RVA: 0x002100E4 File Offset: 0x0020E2E4
|
||||
[Token(Token = "0x600952C")]
|
||||
[Address(RVA = "0x1E3E6C0", Offset = "0x1E3D0C0", VA = "0x181E3E6C0", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600952C)
|
||||
|
||||
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: 0x0600952D RID: 38189 RVA: 0x0021013C File Offset: 0x0020E33C
|
||||
[Token(Token = "0x600952D")]
|
||||
[Address(RVA = "0x1E3E610", Offset = "0x1E3D010", VA = "0x181E3E610", Slot = "10")]
|
||||
public void Reset()
|
||||
{
|
||||
IDigest digest = this.prehash;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0400626E RID: 25198
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400626E")]
|
||||
private readonly IDigest prehash;
|
||||
|
||||
// Token: 0x0400626F RID: 25199
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400626F")]
|
||||
private readonly byte[] context;
|
||||
|
||||
// Token: 0x04006270 RID: 25200
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006270")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x04006271 RID: 25201
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006271")]
|
||||
private Ed25519PrivateKeyParameters privateKey;
|
||||
|
||||
// Token: 0x04006272 RID: 25202
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4006272")]
|
||||
private Ed25519PublicKeyParameters publicKey;
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015CE RID: 5582
|
||||
[Token(Token = "0x20015CE")]
|
||||
[StructLayout(3)]
|
||||
public class Ed448Signer : ISigner
|
||||
{
|
||||
// Token: 0x0600952E RID: 38190 RVA: 0x00210158 File Offset: 0x0020E358
|
||||
[Token(Token = "0x600952E")]
|
||||
[Address(RVA = "0x1E3EA90", Offset = "0x1E3D490", VA = "0x181E3EA90")]
|
||||
public Ed448Signer(byte[] context)
|
||||
{
|
||||
Ed448Signer.Buffer buffer = new Ed448Signer.Buffer();
|
||||
this.buffer = buffer;
|
||||
base..ctor();
|
||||
byte[] array = Arrays.Clone(context);
|
||||
this.context = array;
|
||||
}
|
||||
|
||||
// Token: 0x170017E0 RID: 6112
|
||||
// (get) Token: 0x0600952F RID: 38191 RVA: 0x00210188 File Offset: 0x0020E388
|
||||
[Token(Token = "0x170017E0")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600952F")]
|
||||
[Address(RVA = "0x1E3EB30", Offset = "0x1E3D530", VA = "0x181E3EB30", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "Ed448";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009530 RID: 38192 RVA: 0x0021019C File Offset: 0x0020E39C
|
||||
[Token(Token = "0x6009530")]
|
||||
[Address(RVA = "0x1E3E900", Offset = "0x1E3D300", VA = "0x181E3E900", 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: 0x06009531 RID: 38193 RVA: 0x002101E4 File Offset: 0x0020E3E4
|
||||
[Token(Token = "0x6009531")]
|
||||
[Address(RVA = "0xA20E50", Offset = "0xA1F850", VA = "0x180A20E50", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
((IDisposable)this.buffer).Dispose();
|
||||
}
|
||||
|
||||
// Token: 0x06009532 RID: 38194 RVA: 0x00210204 File Offset: 0x0020E404
|
||||
[Token(Token = "0x6009532")]
|
||||
[Address(RVA = "0xA20FC0", Offset = "0xA1F9C0", VA = "0x180A20FC0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
int num = this.buffer.Read(buf, off, len);
|
||||
}
|
||||
|
||||
// Token: 0x06009533 RID: 38195 RVA: 0x00210228 File Offset: 0x0020E428
|
||||
[Token(Token = "0x6009533")]
|
||||
[Address(RVA = "0x1E3E870", Offset = "0x1E3D270", VA = "0x181E3E870", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009533)
|
||||
|
||||
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: 0x06009534 RID: 38196 RVA: 0x00210274 File Offset: 0x0020E474
|
||||
[Token(Token = "0x6009534")]
|
||||
[Address(RVA = "0x1E3E9F0", Offset = "0x1E3D3F0", VA = "0x181E3E9F0", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009534)
|
||||
|
||||
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: 0x06009535 RID: 38197 RVA: 0x002102B8 File Offset: 0x0020E4B8
|
||||
[Token(Token = "0x6009535")]
|
||||
[Address(RVA = "0x1E3E9D0", Offset = "0x1E3D3D0", VA = "0x181E3E9D0", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
this.buffer.Reset();
|
||||
}
|
||||
|
||||
// Token: 0x04006273 RID: 25203
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006273")]
|
||||
private readonly Ed448Signer.Buffer buffer;
|
||||
|
||||
// Token: 0x04006274 RID: 25204
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006274")]
|
||||
private readonly byte[] context;
|
||||
|
||||
// Token: 0x04006275 RID: 25205
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006275")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x04006276 RID: 25206
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006276")]
|
||||
private Ed448PrivateKeyParameters privateKey;
|
||||
|
||||
// Token: 0x04006277 RID: 25207
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4006277")]
|
||||
private Ed448PublicKeyParameters publicKey;
|
||||
|
||||
// Token: 0x020015CF RID: 5583
|
||||
[Token(Token = "0x20015CF")]
|
||||
private class Buffer : MemoryStream
|
||||
{
|
||||
// Token: 0x06009536 RID: 38198 RVA: 0x002102D8 File Offset: 0x0020E4D8
|
||||
[Token(Token = "0x6009536")]
|
||||
[Address(RVA = "0x1E38C70", Offset = "0x1E37670", VA = "0x181E38C70")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x06009537 RID: 38199 RVA: 0x00210314 File Offset: 0x0020E514
|
||||
[Token(Token = "0x6009537")]
|
||||
[Address(RVA = "0x1E397E0", Offset = "0x1E381E0", VA = "0x181E397E0")]
|
||||
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);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06009538 RID: 38200 RVA: 0x00210364 File Offset: 0x0020E564
|
||||
[Token(Token = "0x6009538")]
|
||||
[Address(RVA = "0x1E391B0", Offset = "0x1E37BB0", VA = "0x181E391B0")]
|
||||
internal void Reset()
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
long length = this.Length;
|
||||
long position = this.Position;
|
||||
Monitor.Exit(this);
|
||||
if (num != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x06009539 RID: 38201 RVA: 0x00210390 File Offset: 0x0020E590
|
||||
[Token(Token = "0x6009539")]
|
||||
[Address(RVA = "0x1E39980", Offset = "0x1E38380", VA = "0x181E39980")]
|
||||
public Buffer()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015D0 RID: 5584
|
||||
[Token(Token = "0x20015D0")]
|
||||
[StructLayout(3)]
|
||||
public class Ed448phSigner : ISigner
|
||||
{
|
||||
// Token: 0x0600953A RID: 38202 RVA: 0x002103A4 File Offset: 0x0020E5A4
|
||||
[Token(Token = "0x600953A")]
|
||||
[Address(RVA = "0x1E3F0F0", Offset = "0x1E3DAF0", VA = "0x181E3F0F0")]
|
||||
public Ed448phSigner(byte[] context)
|
||||
{
|
||||
IXof xof = Ed448.CreatePrehash();
|
||||
this.prehash = xof;
|
||||
base..ctor();
|
||||
byte[] array = Arrays.Clone(context);
|
||||
this.context = array;
|
||||
}
|
||||
|
||||
// Token: 0x170017E1 RID: 6113
|
||||
// (get) Token: 0x0600953B RID: 38203 RVA: 0x002103D4 File Offset: 0x0020E5D4
|
||||
[Token(Token = "0x170017E1")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600953B")]
|
||||
[Address(RVA = "0x1E3F190", Offset = "0x1E3DB90", VA = "0x181E3F190", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "Ed448ph";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600953C RID: 38204 RVA: 0x002103E8 File Offset: 0x0020E5E8
|
||||
[Token(Token = "0x600953C")]
|
||||
[Address(RVA = "0x1E3EE70", Offset = "0x1E3D870", VA = "0x181E3EE70", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600953C)
|
||||
|
||||
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: 0x0600953D RID: 38205 RVA: 0x00210430 File Offset: 0x0020E630
|
||||
[Token(Token = "0x600953D")]
|
||||
[Address(RVA = "0x1E3EFB0", Offset = "0x1E3D9B0", VA = "0x181E3EFB0", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
IXof xof = this.prehash;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600953E RID: 38206 RVA: 0x0021044C File Offset: 0x0020E64C
|
||||
[Token(Token = "0x600953E")]
|
||||
[Address(RVA = "0x1E3EB60", Offset = "0x1E3D560", VA = "0x181E3EB60", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
IXof xof = this.prehash;
|
||||
}
|
||||
|
||||
// Token: 0x0600953F RID: 38207 RVA: 0x00210468 File Offset: 0x0020E668
|
||||
[Token(Token = "0x600953F")]
|
||||
[Address(RVA = "0x1E3EBE0", Offset = "0x1E3D5E0", VA = "0x181E3EBE0", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600953F)
|
||||
|
||||
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: 0x06009540 RID: 38208 RVA: 0x002104EC File Offset: 0x0020E6EC
|
||||
[Token(Token = "0x6009540")]
|
||||
[Address(RVA = "0x1E3F010", Offset = "0x1E3DA10", VA = "0x181E3F010", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009540)
|
||||
|
||||
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: 0x06009541 RID: 38209 RVA: 0x00210544 File Offset: 0x0020E744
|
||||
[Token(Token = "0x6009541")]
|
||||
[Address(RVA = "0x1E3EF60", Offset = "0x1E3D960", VA = "0x181E3EF60", Slot = "10")]
|
||||
public void Reset()
|
||||
{
|
||||
IXof xof = this.prehash;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x04006278 RID: 25208
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006278")]
|
||||
private readonly IXof prehash;
|
||||
|
||||
// Token: 0x04006279 RID: 25209
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006279")]
|
||||
private readonly byte[] context;
|
||||
|
||||
// Token: 0x0400627A RID: 25210
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400627A")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x0400627B RID: 25211
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x400627B")]
|
||||
private Ed448PrivateKeyParameters privateKey;
|
||||
|
||||
// Token: 0x0400627C RID: 25212
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x400627C")]
|
||||
private Ed448PublicKeyParameters publicKey;
|
||||
}
|
||||
}
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D3 RID: 5587
|
||||
[Token(Token = "0x20015D3")]
|
||||
[StructLayout(3)]
|
||||
public class GenericSigner : ISigner
|
||||
{
|
||||
// Token: 0x06009550 RID: 38224 RVA: 0x00210AA8 File Offset: 0x0020ECA8
|
||||
[Token(Token = "0x6009550")]
|
||||
[Address(RVA = "0x3C39C0", Offset = "0x3C23C0", VA = "0x1803C39C0")]
|
||||
public GenericSigner(IAsymmetricBlockCipher engine, IDigest digest)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x170017E5 RID: 6117
|
||||
// (get) Token: 0x06009551 RID: 38225 RVA: 0x00210ACC File Offset: 0x0020ECCC
|
||||
[Token(Token = "0x170017E5")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009551")]
|
||||
[Address(RVA = "0x1E3F950", Offset = "0x1E3E350", VA = "0x181E3F950", 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: 0x06009552 RID: 38226 RVA: 0x00210B60 File Offset: 0x0020ED60
|
||||
[Token(Token = "0x6009552")]
|
||||
[Address(RVA = "0x1E3F440", Offset = "0x1E3DE40", VA = "0x181E3F440", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009552)
|
||||
|
||||
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: 0x06009553 RID: 38227 RVA: 0x00210BD0 File Offset: 0x0020EDD0
|
||||
[Token(Token = "0x6009553")]
|
||||
[Address(RVA = "0x1E3F710", Offset = "0x1E3E110", VA = "0x181E3F710", Slot = "13")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009554 RID: 38228 RVA: 0x00210BEC File Offset: 0x0020EDEC
|
||||
[Token(Token = "0x6009554")]
|
||||
[Address(RVA = "0x1E3F2C0", Offset = "0x1E3DCC0", VA = "0x181E3F2C0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int inOff, int length)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
}
|
||||
|
||||
// Token: 0x06009555 RID: 38229 RVA: 0x00210C08 File Offset: 0x0020EE08
|
||||
[Token(Token = "0x6009555")]
|
||||
[Address(RVA = "0x1E3F340", Offset = "0x1E3DD40", VA = "0x181E3F340", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009555)
|
||||
|
||||
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: 0x06009556 RID: 38230 RVA: 0x00210C50 File Offset: 0x0020EE50
|
||||
[Token(Token = "0x6009556")]
|
||||
[Address(RVA = "0x1E3F770", Offset = "0x1E3E170", VA = "0x181E3F770", 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: 0x06009557 RID: 38231 RVA: 0x00210CDC File Offset: 0x0020EEDC
|
||||
[Token(Token = "0x6009557")]
|
||||
[Address(RVA = "0x1E3F6C0", Offset = "0x1E3E0C0", VA = "0x181E3F6C0", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x04006282 RID: 25218
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006282")]
|
||||
private readonly IAsymmetricBlockCipher engine;
|
||||
|
||||
// Token: 0x04006283 RID: 25219
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006283")]
|
||||
private readonly IDigest digest;
|
||||
|
||||
// Token: 0x04006284 RID: 25220
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006284")]
|
||||
private bool forSigning;
|
||||
}
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D1 RID: 5585
|
||||
[Token(Token = "0x20015D1")]
|
||||
[StructLayout(3)]
|
||||
public class Gost3410DigestSigner : ISigner
|
||||
{
|
||||
// Token: 0x06009542 RID: 38210 RVA: 0x00210560 File Offset: 0x0020E760
|
||||
[Token(Token = "0x6009542")]
|
||||
[Address(RVA = "0x641430", Offset = "0x63FE30", VA = "0x180641430")]
|
||||
public Gost3410DigestSigner(IDsa signer, IDigest digest)
|
||||
{
|
||||
this.dsaSigner = signer;
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
// Token: 0x170017E2 RID: 6114
|
||||
// (get) Token: 0x06009543 RID: 38211 RVA: 0x00210584 File Offset: 0x0020E784
|
||||
[Token(Token = "0x170017E2")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009543")]
|
||||
[Address(RVA = "0x1E40370", Offset = "0x1E3ED70", VA = "0x181E40370", Slot = "11")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
IDsa dsa = this.dsaSigner;
|
||||
string text;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009544 RID: 38212 RVA: 0x002105A8 File Offset: 0x0020E7A8
|
||||
[Token(Token = "0x6009544")]
|
||||
[Address(RVA = "0x1E3FE70", Offset = "0x1E3E870", VA = "0x181E3FE70", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009544)
|
||||
|
||||
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: 0x06009545 RID: 38213 RVA: 0x00210618 File Offset: 0x0020E818
|
||||
[Token(Token = "0x6009545")]
|
||||
[Address(RVA = "0x1E40140", Offset = "0x1E3EB40", VA = "0x181E40140", Slot = "13")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009546 RID: 38214 RVA: 0x00210634 File Offset: 0x0020E834
|
||||
[Token(Token = "0x6009546")]
|
||||
[Address(RVA = "0x1E3FBA0", Offset = "0x1E3E5A0", VA = "0x181E3FBA0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int inOff, int length)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
}
|
||||
|
||||
// Token: 0x06009547 RID: 38215 RVA: 0x00210650 File Offset: 0x0020E850
|
||||
[Token(Token = "0x6009547")]
|
||||
[Address(RVA = "0x1E3FC20", Offset = "0x1E3E620", VA = "0x181E3FC20", 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: 0x06009548 RID: 38216 RVA: 0x002106E4 File Offset: 0x0020E8E4
|
||||
[Token(Token = "0x6009548")]
|
||||
[Address(RVA = "0x1E401A0", Offset = "0x1E3EBA0", VA = "0x181E401A0", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009548)
|
||||
|
||||
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: 0x06009549 RID: 38217 RVA: 0x00210734 File Offset: 0x0020E934
|
||||
[Token(Token = "0x6009549")]
|
||||
[Address(RVA = "0x1E400F0", Offset = "0x1E3EAF0", VA = "0x181E400F0", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0400627D RID: 25213
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x400627D")]
|
||||
private readonly IDigest digest;
|
||||
|
||||
// Token: 0x0400627E RID: 25214
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x400627E")]
|
||||
private readonly IDsa dsaSigner;
|
||||
|
||||
// Token: 0x0400627F RID: 25215
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400627F")]
|
||||
private bool forSigning;
|
||||
}
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015D2 RID: 5586
|
||||
[Token(Token = "0x20015D2")]
|
||||
[StructLayout(3)]
|
||||
public class Gost3410Signer : IDsaExt, IDsa
|
||||
{
|
||||
// Token: 0x170017E3 RID: 6115
|
||||
// (get) Token: 0x0600954A RID: 38218 RVA: 0x00210750 File Offset: 0x0020E950
|
||||
[Token(Token = "0x170017E3")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600954A")]
|
||||
[Address(RVA = "0x1E40D70", Offset = "0x1E3F770", VA = "0x181E40D70", Slot = "9")]
|
||||
get
|
||||
{
|
||||
return "GOST3410";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600954B RID: 38219 RVA: 0x00210764 File Offset: 0x0020E964
|
||||
[Token(Token = "0x600954B")]
|
||||
[Address(RVA = "0x1E40750", Offset = "0x1E3F150", VA = "0x181E40750", Slot = "10")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600954B)
|
||||
|
||||
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: 0x170017E4 RID: 6116
|
||||
// (get) Token: 0x0600954C RID: 38220 RVA: 0x002107DC File Offset: 0x0020E9DC
|
||||
[Token(Token = "0x170017E4")]
|
||||
public virtual BigInteger Order
|
||||
{
|
||||
[Token(Token = "0x600954C")]
|
||||
[Address(RVA = "0x1C69900", Offset = "0x1C68300", VA = "0x181C69900", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return this.key.parameters.q;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600954D RID: 38221 RVA: 0x00210800 File Offset: 0x0020EA00
|
||||
[Token(Token = "0x600954D")]
|
||||
[Address(RVA = "0x1E403F0", Offset = "0x1E3EDF0", VA = "0x181E403F0", 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: 0x0600954E RID: 38222 RVA: 0x00210930 File Offset: 0x0020EB30
|
||||
[Token(Token = "0x600954E")]
|
||||
[Address(RVA = "0x1E409E0", Offset = "0x1E3F3E0", VA = "0x181E409E0", 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: 0x0600954F RID: 38223 RVA: 0x00210A94 File Offset: 0x0020EC94
|
||||
[Token(Token = "0x600954F")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public Gost3410Signer()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04006280 RID: 25216
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006280")]
|
||||
private Gost3410KeyParameters key;
|
||||
|
||||
// Token: 0x04006281 RID: 25217
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006281")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015D4 RID: 5588
|
||||
[Token(Token = "0x20015D4")]
|
||||
[StructLayout(3)]
|
||||
public class HMacDsaKCalculator : IDsaKCalculator
|
||||
{
|
||||
// Token: 0x06009558 RID: 38232 RVA: 0x00210CF8 File Offset: 0x0020EEF8
|
||||
[Token(Token = "0x6009558")]
|
||||
[Address(RVA = "0x1E416A0", Offset = "0x1E400A0", VA = "0x181E416A0")]
|
||||
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: 0x170017E6 RID: 6118
|
||||
// (get) Token: 0x06009559 RID: 38233 RVA: 0x00210D44 File Offset: 0x0020EF44
|
||||
[Token(Token = "0x170017E6")]
|
||||
public virtual bool IsDeterministic
|
||||
{
|
||||
[Token(Token = "0x6009559")]
|
||||
[Address(RVA = "0x4405A0", Offset = "0x43EFA0", VA = "0x1804405A0", Slot = "8")]
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600955A RID: 38234 RVA: 0x00210D54 File Offset: 0x0020EF54
|
||||
[Token(Token = "0x600955A")]
|
||||
[Address(RVA = "0x1E413B0", Offset = "0x1E3FDB0", VA = "0x181E413B0", Slot = "9")]
|
||||
public virtual void Init(BigInteger n, SecureRandom random)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600955A)
|
||||
|
||||
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: 0x0600955B RID: 38235 RVA: 0x00210D6C File Offset: 0x0020EF6C
|
||||
[Token(Token = "0x600955B")]
|
||||
[Address(RVA = "0x1E40F00", Offset = "0x1E3F900", VA = "0x181E40F00", 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: 0x0600955C RID: 38236 RVA: 0x00210F60 File Offset: 0x0020F160
|
||||
[Token(Token = "0x600955C")]
|
||||
[Address(RVA = "0x1E41410", Offset = "0x1E3FE10", VA = "0x181E41410", 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: 0x0600955D RID: 38237 RVA: 0x0021107C File Offset: 0x0020F27C
|
||||
[Token(Token = "0x600955D")]
|
||||
[Address(RVA = "0x1E40E40", Offset = "0x1E3F840", VA = "0x181E40E40")]
|
||||
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: 0x04006285 RID: 25221
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006285")]
|
||||
private readonly HMac hMac;
|
||||
|
||||
// Token: 0x04006286 RID: 25222
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006286")]
|
||||
private readonly byte[] K;
|
||||
|
||||
// Token: 0x04006287 RID: 25223
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006287")]
|
||||
private readonly byte[] V;
|
||||
|
||||
// Token: 0x04006288 RID: 25224
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006288")]
|
||||
private BigInteger n;
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D5 RID: 5589
|
||||
[Token(Token = "0x20015D5")]
|
||||
[StructLayout(3)]
|
||||
public interface IDsaEncoding
|
||||
{
|
||||
// Token: 0x0600955E RID: 38238
|
||||
[Token(Token = "0x600955E")]
|
||||
[Address(Slot = "0")]
|
||||
BigInteger[] Decode(BigInteger n, byte[] encoding);
|
||||
|
||||
// Token: 0x0600955F RID: 38239
|
||||
[Token(Token = "0x600955F")]
|
||||
[Address(Slot = "1")]
|
||||
byte[] Encode(BigInteger n, BigInteger r, BigInteger s);
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D6 RID: 5590
|
||||
[Token(Token = "0x20015D6")]
|
||||
[StructLayout(3)]
|
||||
public interface IDsaKCalculator
|
||||
{
|
||||
// Token: 0x170017E7 RID: 6119
|
||||
// (get) Token: 0x06009560 RID: 38240
|
||||
[Token(Token = "0x170017E7")]
|
||||
bool IsDeterministic
|
||||
{
|
||||
[Token(Token = "0x6009560")]
|
||||
[Address(Slot = "0")]
|
||||
get;
|
||||
}
|
||||
|
||||
// Token: 0x06009561 RID: 38241
|
||||
[Token(Token = "0x6009561")]
|
||||
[Address(Slot = "1")]
|
||||
void Init(BigInteger n, SecureRandom random);
|
||||
|
||||
// Token: 0x06009562 RID: 38242
|
||||
[Token(Token = "0x6009562")]
|
||||
[Address(Slot = "2")]
|
||||
void Init(BigInteger n, BigInteger d, byte[] message);
|
||||
|
||||
// Token: 0x06009563 RID: 38243
|
||||
[Token(Token = "0x6009563")]
|
||||
[Address(Slot = "3")]
|
||||
BigInteger NextK();
|
||||
}
|
||||
}
|
||||
+647
@@ -0,0 +1,647 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D7 RID: 5591
|
||||
[Token(Token = "0x20015D7")]
|
||||
[StructLayout(3)]
|
||||
public class Iso9796d2PssSigner : ISignerWithRecovery, ISigner
|
||||
{
|
||||
// Token: 0x06009564 RID: 38244 RVA: 0x002110D0 File Offset: 0x0020F2D0
|
||||
[Token(Token = "0x6009564")]
|
||||
[Address(RVA = "0x3EDE90", Offset = "0x3EC890", VA = "0x1803EDE90", Slot = "5")]
|
||||
public byte[] GetRecoveredMessage()
|
||||
{
|
||||
return this.recoveredMessage;
|
||||
}
|
||||
|
||||
// Token: 0x06009565 RID: 38245 RVA: 0x002110E4 File Offset: 0x0020F2E4
|
||||
[Token(Token = "0x6009565")]
|
||||
[Address(RVA = "0x1E455C0", Offset = "0x1E43FC0", VA = "0x181E455C0")]
|
||||
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength, bool isImplicit)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009565)
|
||||
|
||||
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: 0x06009566 RID: 38246 RVA: 0x00211148 File Offset: 0x0020F348
|
||||
[Token(Token = "0x6009566")]
|
||||
[Address(RVA = "0x1E454A0", Offset = "0x1E43EA0", VA = "0x181E454A0")]
|
||||
public Iso9796d2PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLength)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009566)
|
||||
|
||||
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: 0x170017E8 RID: 6120
|
||||
// (get) Token: 0x06009567 RID: 38247 RVA: 0x002111A0 File Offset: 0x0020F3A0
|
||||
[Token(Token = "0x170017E8")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009567")]
|
||||
[Address(RVA = "0x1E456F0", Offset = "0x1E440F0", VA = "0x181E456F0", Slot = "14")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
return 0 + "withISO9796-2S2";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009568 RID: 38248 RVA: 0x002111C8 File Offset: 0x0020F3C8
|
||||
[Token(Token = "0x6009568")]
|
||||
[Address(RVA = "0x1E43FB0", Offset = "0x1E429B0", VA = "0x181E43FB0", 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: 0x06009569 RID: 38249 RVA: 0x002112C0 File Offset: 0x0020F4C0
|
||||
[Token(Token = "0x6009569")]
|
||||
[Address(RVA = "0x1E44380", Offset = "0x1E42D80", VA = "0x181E44380")]
|
||||
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: 0x0600956A RID: 38250 RVA: 0x002112F4 File Offset: 0x0020F4F4
|
||||
[Token(Token = "0x600956A")]
|
||||
[Address(RVA = "0x1E43A90", Offset = "0x1E42490", VA = "0x181E43A90")]
|
||||
private void ClearBlock(byte[] block)
|
||||
{
|
||||
int length = block.Length;
|
||||
int num = 0;
|
||||
Array.Clear(block, num, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600956B RID: 38251 RVA: 0x00211318 File Offset: 0x0020F518
|
||||
[Token(Token = "0x600956B")]
|
||||
[Address(RVA = "0x1E44AC0", Offset = "0x1E434C0", VA = "0x181E44AC0", 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: 0x0600956C RID: 38252 RVA: 0x00211448 File Offset: 0x0020F648
|
||||
[Token(Token = "0x600956C")]
|
||||
[Address(RVA = "0x1E44ED0", Offset = "0x1E438D0", VA = "0x181E44ED0", 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: 0x0600956D RID: 38253 RVA: 0x00211490 File Offset: 0x0020F690
|
||||
[Token(Token = "0x600956D")]
|
||||
[Address(RVA = "0x1E439B0", Offset = "0x1E423B0", VA = "0x181E439B0", 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: 0x0600956E RID: 38254 RVA: 0x002114D4 File Offset: 0x0020F6D4
|
||||
[Token(Token = "0x600956E")]
|
||||
[Address(RVA = "0x1E44A00", Offset = "0x1E43400", VA = "0x181E44A00", 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: 0x0600956F RID: 38255 RVA: 0x00211580 File Offset: 0x0020F780
|
||||
[Token(Token = "0x600956F")]
|
||||
[Address(RVA = "0x1E43AC0", Offset = "0x1E424C0", VA = "0x181E43AC0", 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: 0x06009570 RID: 38256 RVA: 0x002117E8 File Offset: 0x0020F9E8
|
||||
[Token(Token = "0x6009570")]
|
||||
[Address(RVA = "0x1E44F80", Offset = "0x1E43980", VA = "0x181E44F80", Slot = "21")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009570)
|
||||
|
||||
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: 0x06009571 RID: 38257 RVA: 0x002119F0 File Offset: 0x0020FBF0
|
||||
[Token(Token = "0x6009571")]
|
||||
[Address(RVA = "0x566D70", Offset = "0x565770", VA = "0x180566D70", Slot = "22")]
|
||||
public virtual bool HasFullMessage()
|
||||
{
|
||||
return this.fullMessage;
|
||||
}
|
||||
|
||||
// Token: 0x06009572 RID: 38258 RVA: 0x00211A04 File Offset: 0x0020FC04
|
||||
[Token(Token = "0x6009572")]
|
||||
[Address(RVA = "0x1E44410", Offset = "0x1E42E10", VA = "0x181E44410")]
|
||||
private void ItoOSP(int i, byte[] sp)
|
||||
{
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
}
|
||||
|
||||
// Token: 0x06009573 RID: 38259 RVA: 0x00211A38 File Offset: 0x0020FC38
|
||||
[Token(Token = "0x6009573")]
|
||||
[Address(RVA = "0x1E444A0", Offset = "0x1E42EA0", VA = "0x181E444A0")]
|
||||
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: 0x06009574 RID: 38260 RVA: 0x00211A8C File Offset: 0x0020FC8C
|
||||
[Token(Token = "0x6009574")]
|
||||
[Address(RVA = "0x1E445E0", Offset = "0x1E42FE0", VA = "0x181E445E0")]
|
||||
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: 0x04006289 RID: 25225
|
||||
[Token(Token = "0x4006289")]
|
||||
[Obsolete]
|
||||
public const int TrailerImplicit = 188;
|
||||
|
||||
// Token: 0x0400628A RID: 25226
|
||||
[Token(Token = "0x400628A")]
|
||||
[Obsolete]
|
||||
public const int TrailerRipeMD160 = 12748;
|
||||
|
||||
// Token: 0x0400628B RID: 25227
|
||||
[Token(Token = "0x400628B")]
|
||||
[Obsolete]
|
||||
public const int TrailerRipeMD128 = 13004;
|
||||
|
||||
// Token: 0x0400628C RID: 25228
|
||||
[Token(Token = "0x400628C")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha1 = 13260;
|
||||
|
||||
// Token: 0x0400628D RID: 25229
|
||||
[Token(Token = "0x400628D")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha256 = 13516;
|
||||
|
||||
// Token: 0x0400628E RID: 25230
|
||||
[Token(Token = "0x400628E")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha512 = 13772;
|
||||
|
||||
// Token: 0x0400628F RID: 25231
|
||||
[Token(Token = "0x400628F")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha384 = 14028;
|
||||
|
||||
// Token: 0x04006290 RID: 25232
|
||||
[Token(Token = "0x4006290")]
|
||||
[Obsolete]
|
||||
public const int TrailerWhirlpool = 14284;
|
||||
|
||||
// Token: 0x04006291 RID: 25233
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006291")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x04006292 RID: 25234
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006292")]
|
||||
private IAsymmetricBlockCipher cipher;
|
||||
|
||||
// Token: 0x04006293 RID: 25235
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x4006293")]
|
||||
private SecureRandom random;
|
||||
|
||||
// Token: 0x04006294 RID: 25236
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x4006294")]
|
||||
private byte[] standardSalt;
|
||||
|
||||
// Token: 0x04006295 RID: 25237
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4006295")]
|
||||
private int hLen;
|
||||
|
||||
// Token: 0x04006296 RID: 25238
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
|
||||
[Token(Token = "0x4006296")]
|
||||
private int trailer;
|
||||
|
||||
// Token: 0x04006297 RID: 25239
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x4006297")]
|
||||
private int keyBits;
|
||||
|
||||
// Token: 0x04006298 RID: 25240
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x4006298")]
|
||||
private byte[] block;
|
||||
|
||||
// Token: 0x04006299 RID: 25241
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
||||
[Token(Token = "0x4006299")]
|
||||
private byte[] mBuf;
|
||||
|
||||
// Token: 0x0400629A RID: 25242
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
||||
[Token(Token = "0x400629A")]
|
||||
private int messageLength;
|
||||
|
||||
// Token: 0x0400629B RID: 25243
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x54")]
|
||||
[Token(Token = "0x400629B")]
|
||||
private readonly int saltLength;
|
||||
|
||||
// Token: 0x0400629C RID: 25244
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
||||
[Token(Token = "0x400629C")]
|
||||
private bool fullMessage;
|
||||
|
||||
// Token: 0x0400629D RID: 25245
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
|
||||
[Token(Token = "0x400629D")]
|
||||
private byte[] recoveredMessage;
|
||||
|
||||
// Token: 0x0400629E RID: 25246
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
|
||||
[Token(Token = "0x400629E")]
|
||||
private byte[] preSig;
|
||||
|
||||
// Token: 0x0400629F RID: 25247
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x70")]
|
||||
[Token(Token = "0x400629F")]
|
||||
private byte[] preBlock;
|
||||
|
||||
// Token: 0x040062A0 RID: 25248
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x78")]
|
||||
[Token(Token = "0x40062A0")]
|
||||
private int preMStart;
|
||||
|
||||
// Token: 0x040062A1 RID: 25249
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x7C")]
|
||||
[Token(Token = "0x40062A1")]
|
||||
private int preTLength;
|
||||
}
|
||||
}
|
||||
+485
@@ -0,0 +1,485 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D8 RID: 5592
|
||||
[Token(Token = "0x20015D8")]
|
||||
[StructLayout(3)]
|
||||
public class Iso9796d2Signer : ISignerWithRecovery, ISigner
|
||||
{
|
||||
// Token: 0x06009575 RID: 38261 RVA: 0x00211BD4 File Offset: 0x0020FDD4
|
||||
[Token(Token = "0x6009575")]
|
||||
[Address(RVA = "0x3D32F0", Offset = "0x3D1CF0", VA = "0x1803D32F0", Slot = "5")]
|
||||
public byte[] GetRecoveredMessage()
|
||||
{
|
||||
return this.recoveredMessage;
|
||||
}
|
||||
|
||||
// Token: 0x06009576 RID: 38262 RVA: 0x00211BE8 File Offset: 0x0020FDE8
|
||||
[Token(Token = "0x6009576")]
|
||||
[Address(RVA = "0x1E46B20", Offset = "0x1E45520", VA = "0x181E46B20")]
|
||||
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009576)
|
||||
|
||||
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: 0x06009577 RID: 38263 RVA: 0x00211C44 File Offset: 0x0020FE44
|
||||
[Token(Token = "0x6009577")]
|
||||
[Address(RVA = "0x1E46C20", Offset = "0x1E45620", VA = "0x181E46C20")]
|
||||
public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009577)
|
||||
|
||||
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: 0x170017E9 RID: 6121
|
||||
// (get) Token: 0x06009578 RID: 38264 RVA: 0x00211C8C File Offset: 0x0020FE8C
|
||||
[Token(Token = "0x170017E9")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009578")]
|
||||
[Address(RVA = "0x1E46D10", Offset = "0x1E45710", VA = "0x181E46D10", Slot = "14")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
return 0 + "withISO9796-2S1";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009579 RID: 38265 RVA: 0x00211CB4 File Offset: 0x0020FEB4
|
||||
[Token(Token = "0x6009579")]
|
||||
[Address(RVA = "0x1E45B90", Offset = "0x1E44590", VA = "0x181E45B90", 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: 0x0600957A RID: 38266 RVA: 0x00211D5C File Offset: 0x0020FF5C
|
||||
[Token(Token = "0x600957A")]
|
||||
[Address(RVA = "0x1E45D20", Offset = "0x1E44720", VA = "0x181E45D20")]
|
||||
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: 0x0600957B RID: 38267 RVA: 0x00211DB0 File Offset: 0x0020FFB0
|
||||
[Token(Token = "0x600957B")]
|
||||
[Address(RVA = "0x1E43A90", Offset = "0x1E42490", VA = "0x181E43A90")]
|
||||
private void ClearBlock(byte[] block)
|
||||
{
|
||||
int length = block.Length;
|
||||
int num = 0;
|
||||
Array.Clear(block, num, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600957C RID: 38268 RVA: 0x00211DD4 File Offset: 0x0020FFD4
|
||||
[Token(Token = "0x600957C")]
|
||||
[Address(RVA = "0x1E45F00", Offset = "0x1E44900", VA = "0x181E45F00", 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: 0x0600957D RID: 38269 RVA: 0x00211EE8 File Offset: 0x002100E8
|
||||
[Token(Token = "0x600957D")]
|
||||
[Address(RVA = "0x1E462F0", Offset = "0x1E44CF0", VA = "0x181E462F0", 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: 0x0600957E RID: 38270 RVA: 0x00211F28 File Offset: 0x00210128
|
||||
[Token(Token = "0x600957E")]
|
||||
[Address(RVA = "0x1E45750", Offset = "0x1E44150", VA = "0x181E45750", 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: 0x0600957F RID: 38271 RVA: 0x00211F60 File Offset: 0x00210160
|
||||
[Token(Token = "0x600957F")]
|
||||
[Address(RVA = "0x1E45DF0", Offset = "0x1E447F0", VA = "0x181E45DF0", 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: 0x06009580 RID: 38272 RVA: 0x00212008 File Offset: 0x00210208
|
||||
[Token(Token = "0x6009580")]
|
||||
[Address(RVA = "0x1E45830", Offset = "0x1E44230", VA = "0x181E45830", 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: 0x06009581 RID: 38273 RVA: 0x0021218C File Offset: 0x0021038C
|
||||
[Token(Token = "0x6009581")]
|
||||
[Address(RVA = "0x1E46390", Offset = "0x1E44D90", VA = "0x181E46390", Slot = "21")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009581)
|
||||
|
||||
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: 0x06009582 RID: 38274 RVA: 0x002123CC File Offset: 0x002105CC
|
||||
[Token(Token = "0x6009582")]
|
||||
[Address(RVA = "0x1E45EB0", Offset = "0x1E448B0", VA = "0x181E45EB0")]
|
||||
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: 0x06009583 RID: 38275 RVA: 0x00212418 File Offset: 0x00210618
|
||||
[Token(Token = "0x6009583")]
|
||||
[Address(RVA = "0x3C1C60", Offset = "0x3C0660", VA = "0x1803C1C60", Slot = "22")]
|
||||
public virtual bool HasFullMessage()
|
||||
{
|
||||
return this.fullMessage;
|
||||
}
|
||||
|
||||
// Token: 0x040062A2 RID: 25250
|
||||
[Token(Token = "0x40062A2")]
|
||||
[Obsolete]
|
||||
public const int TrailerImplicit = 188;
|
||||
|
||||
// Token: 0x040062A3 RID: 25251
|
||||
[Token(Token = "0x40062A3")]
|
||||
[Obsolete]
|
||||
public const int TrailerRipeMD160 = 12748;
|
||||
|
||||
// Token: 0x040062A4 RID: 25252
|
||||
[Token(Token = "0x40062A4")]
|
||||
[Obsolete]
|
||||
public const int TrailerRipeMD128 = 13004;
|
||||
|
||||
// Token: 0x040062A5 RID: 25253
|
||||
[Token(Token = "0x40062A5")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha1 = 13260;
|
||||
|
||||
// Token: 0x040062A6 RID: 25254
|
||||
[Token(Token = "0x40062A6")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha256 = 13516;
|
||||
|
||||
// Token: 0x040062A7 RID: 25255
|
||||
[Token(Token = "0x40062A7")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha512 = 13772;
|
||||
|
||||
// Token: 0x040062A8 RID: 25256
|
||||
[Token(Token = "0x40062A8")]
|
||||
[Obsolete]
|
||||
public const int TrailerSha384 = 14028;
|
||||
|
||||
// Token: 0x040062A9 RID: 25257
|
||||
[Token(Token = "0x40062A9")]
|
||||
[Obsolete]
|
||||
public const int TrailerWhirlpool = 14284;
|
||||
|
||||
// Token: 0x040062AA RID: 25258
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062AA")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x040062AB RID: 25259
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062AB")]
|
||||
private IAsymmetricBlockCipher cipher;
|
||||
|
||||
// Token: 0x040062AC RID: 25260
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40062AC")]
|
||||
private int trailer;
|
||||
|
||||
// Token: 0x040062AD RID: 25261
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x24")]
|
||||
[Token(Token = "0x40062AD")]
|
||||
private int keyBits;
|
||||
|
||||
// Token: 0x040062AE RID: 25262
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40062AE")]
|
||||
private byte[] block;
|
||||
|
||||
// Token: 0x040062AF RID: 25263
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40062AF")]
|
||||
private byte[] mBuf;
|
||||
|
||||
// Token: 0x040062B0 RID: 25264
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x40062B0")]
|
||||
private int messageLength;
|
||||
|
||||
// Token: 0x040062B1 RID: 25265
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x3C")]
|
||||
[Token(Token = "0x40062B1")]
|
||||
private bool fullMessage;
|
||||
|
||||
// Token: 0x040062B2 RID: 25266
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x40062B2")]
|
||||
private byte[] recoveredMessage;
|
||||
|
||||
// Token: 0x040062B3 RID: 25267
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
||||
[Token(Token = "0x40062B3")]
|
||||
private byte[] preSig;
|
||||
|
||||
// Token: 0x040062B4 RID: 25268
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
||||
[Token(Token = "0x40062B4")]
|
||||
private byte[] preBlock;
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015D9 RID: 5593
|
||||
[Token(Token = "0x20015D9")]
|
||||
[StructLayout(3)]
|
||||
public class IsoTrailers
|
||||
{
|
||||
// Token: 0x06009584 RID: 38276 RVA: 0x0021242C File Offset: 0x0021062C
|
||||
[Token(Token = "0x6009584")]
|
||||
[Address(RVA = "0x1E46D70", Offset = "0x1E45770", VA = "0x181E46D70")]
|
||||
private static IDictionary CreateTrailerMap()
|
||||
{
|
||||
return CollectionUtilities.ReadOnly(Platform.CreateHashtable());
|
||||
}
|
||||
|
||||
// Token: 0x06009585 RID: 38277 RVA: 0x0021244C File Offset: 0x0021064C
|
||||
[Token(Token = "0x6009585")]
|
||||
[Address(RVA = "0x1E47020", Offset = "0x1E45A20", VA = "0x181E47020")]
|
||||
public static int GetTrailer(IDigest digest)
|
||||
{
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009586 RID: 38278 RVA: 0x00212460 File Offset: 0x00210660
|
||||
[Token(Token = "0x6009586")]
|
||||
[Address(RVA = "0x1E470F0", Offset = "0x1E45AF0", VA = "0x181E470F0")]
|
||||
public static bool NoTrailerAvailable(IDigest digest)
|
||||
{
|
||||
int num = 0;
|
||||
if (num < digest)
|
||||
{
|
||||
num += num;
|
||||
num++;
|
||||
}
|
||||
bool flag;
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06009587 RID: 38279 RVA: 0x00212484 File Offset: 0x00210684
|
||||
[Token(Token = "0x6009587")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public IsoTrailers()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009588 RID: 38280 RVA: 0x00212498 File Offset: 0x00210698
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x6009588")]
|
||||
[Address(RVA = "0x1E47200", Offset = "0x1E45C00", VA = "0x181E47200")]
|
||||
static IsoTrailers()
|
||||
{
|
||||
IDictionary dictionary = IsoTrailers.CreateTrailerMap();
|
||||
}
|
||||
|
||||
// Token: 0x040062B5 RID: 25269
|
||||
[Token(Token = "0x40062B5")]
|
||||
public const int TRAILER_IMPLICIT = 188;
|
||||
|
||||
// Token: 0x040062B6 RID: 25270
|
||||
[Token(Token = "0x40062B6")]
|
||||
public const int TRAILER_RIPEMD160 = 12748;
|
||||
|
||||
// Token: 0x040062B7 RID: 25271
|
||||
[Token(Token = "0x40062B7")]
|
||||
public const int TRAILER_RIPEMD128 = 13004;
|
||||
|
||||
// Token: 0x040062B8 RID: 25272
|
||||
[Token(Token = "0x40062B8")]
|
||||
public const int TRAILER_SHA1 = 13260;
|
||||
|
||||
// Token: 0x040062B9 RID: 25273
|
||||
[Token(Token = "0x40062B9")]
|
||||
public const int TRAILER_SHA256 = 13516;
|
||||
|
||||
// Token: 0x040062BA RID: 25274
|
||||
[Token(Token = "0x40062BA")]
|
||||
public const int TRAILER_SHA512 = 13772;
|
||||
|
||||
// Token: 0x040062BB RID: 25275
|
||||
[Token(Token = "0x40062BB")]
|
||||
public const int TRAILER_SHA384 = 14028;
|
||||
|
||||
// Token: 0x040062BC RID: 25276
|
||||
[Token(Token = "0x40062BC")]
|
||||
public const int TRAILER_WHIRLPOOL = 14284;
|
||||
|
||||
// Token: 0x040062BD RID: 25277
|
||||
[Token(Token = "0x40062BD")]
|
||||
public const int TRAILER_SHA224 = 14540;
|
||||
|
||||
// Token: 0x040062BE RID: 25278
|
||||
[Token(Token = "0x40062BE")]
|
||||
public const int TRAILER_SHA512_224 = 14796;
|
||||
|
||||
// Token: 0x040062BF RID: 25279
|
||||
[Token(Token = "0x40062BF")]
|
||||
public const int TRAILER_SHA512_256 = 16588;
|
||||
|
||||
// Token: 0x040062C0 RID: 25280
|
||||
[Token(Token = "0x40062C0")]
|
||||
private static readonly IDictionary trailerMap;
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015DA RID: 5594
|
||||
[Token(Token = "0x20015DA")]
|
||||
[StructLayout(3)]
|
||||
public class PlainDsaEncoding : IDsaEncoding
|
||||
{
|
||||
// Token: 0x06009589 RID: 38281 RVA: 0x002124B0 File Offset: 0x002106B0
|
||||
[Token(Token = "0x6009589")]
|
||||
[Address(RVA = "0x1E47390", Offset = "0x1E45D90", VA = "0x181E47390", 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: 0x0600958A RID: 38282 RVA: 0x002124F4 File Offset: 0x002106F4
|
||||
[Token(Token = "0x600958A")]
|
||||
[Address(RVA = "0x1E47670", Offset = "0x1E46070", VA = "0x181E47670", 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: 0x0600958B RID: 38283 RVA: 0x00212510 File Offset: 0x00210710
|
||||
[Token(Token = "0x600958B")]
|
||||
[Address(RVA = "0x1E47240", Offset = "0x1E45C40", VA = "0x181E47240", Slot = "8")]
|
||||
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
|
||||
{
|
||||
int num = x.CompareTo(n);
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x0600958C RID: 38284 RVA: 0x0021252C File Offset: 0x0021072C
|
||||
[Token(Token = "0x600958C")]
|
||||
[Address(RVA = "0x1E472E0", Offset = "0x1E45CE0", VA = "0x181E472E0", Slot = "9")]
|
||||
protected virtual BigInteger DecodeValue(BigInteger n, byte[] buf, int off, int len)
|
||||
{
|
||||
BigInteger bigInteger;
|
||||
return bigInteger;
|
||||
}
|
||||
|
||||
// Token: 0x0600958D RID: 38285 RVA: 0x0021253C File Offset: 0x0021073C
|
||||
[Token(Token = "0x600958D")]
|
||||
[Address(RVA = "0x1E47540", Offset = "0x1E45F40", VA = "0x181E47540", 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: 0x0600958E RID: 38286 RVA: 0x00212578 File Offset: 0x00210778
|
||||
[Token(Token = "0x600958E")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public PlainDsaEncoding()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600958F RID: 38287 RVA: 0x0021258C File Offset: 0x0021078C
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x600958F")]
|
||||
[Address(RVA = "0x1E47750", Offset = "0x1E46150", VA = "0x181E47750")]
|
||||
static PlainDsaEncoding()
|
||||
{
|
||||
PlainDsaEncoding plainDsaEncoding = new PlainDsaEncoding();
|
||||
}
|
||||
|
||||
// Token: 0x040062C1 RID: 25281
|
||||
[Token(Token = "0x40062C1")]
|
||||
public static readonly PlainDsaEncoding Instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,471 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015DB RID: 5595
|
||||
[Token(Token = "0x20015DB")]
|
||||
[StructLayout(3)]
|
||||
public class PssSigner : ISigner
|
||||
{
|
||||
// Token: 0x06009590 RID: 38288 RVA: 0x002125A0 File Offset: 0x002107A0
|
||||
[Token(Token = "0x6009590")]
|
||||
[Address(RVA = "0x1E47830", Offset = "0x1E46230", VA = "0x181E47830")]
|
||||
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: 0x06009591 RID: 38289 RVA: 0x0021261C File Offset: 0x0021081C
|
||||
[Token(Token = "0x6009591")]
|
||||
[Address(RVA = "0x1E47970", Offset = "0x1E46370", VA = "0x181E47970")]
|
||||
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: 0x06009592 RID: 38290 RVA: 0x00212694 File Offset: 0x00210894
|
||||
[Token(Token = "0x6009592")]
|
||||
[Address(RVA = "0x1E48C40", Offset = "0x1E47640", VA = "0x181E48C40")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009593 RID: 38291 RVA: 0x002126A8 File Offset: 0x002108A8
|
||||
[Token(Token = "0x6009593")]
|
||||
[Address(RVA = "0x1E48C10", Offset = "0x1E47610", VA = "0x181E48C10")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009594 RID: 38292 RVA: 0x002126B8 File Offset: 0x002108B8
|
||||
[Token(Token = "0x6009594")]
|
||||
[Address(RVA = "0x1E48BA0", Offset = "0x1E475A0", VA = "0x181E48BA0")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, byte[] salt)
|
||||
{
|
||||
int length = salt.Length;
|
||||
}
|
||||
|
||||
// Token: 0x06009595 RID: 38293 RVA: 0x002126D4 File Offset: 0x002108D4
|
||||
[Token(Token = "0x6009595")]
|
||||
[Address(RVA = "0x1E48BE0", Offset = "0x1E475E0", VA = "0x181E48BE0")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, int saltLen)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009596 RID: 38294 RVA: 0x002126E4 File Offset: 0x002108E4
|
||||
[Token(Token = "0x6009596")]
|
||||
[Address(RVA = "0x1E48B50", Offset = "0x1E47550", VA = "0x181E48B50")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest, IDigest mgfDigest, byte[] salt)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009597 RID: 38295 RVA: 0x002126F8 File Offset: 0x002108F8
|
||||
[Token(Token = "0x6009597")]
|
||||
[Address(RVA = "0x1E48C10", Offset = "0x1E47610", VA = "0x181E48C10")]
|
||||
public PssSigner(IAsymmetricBlockCipher cipher, IDigest digest, int saltLen, byte trailer)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06009598 RID: 38296 RVA: 0x00212708 File Offset: 0x00210908
|
||||
[Token(Token = "0x6009598")]
|
||||
[Address(RVA = "0x1E48A60", Offset = "0x1E47460", VA = "0x181E48A60")]
|
||||
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: 0x06009599 RID: 38297 RVA: 0x00212770 File Offset: 0x00210970
|
||||
[Token(Token = "0x6009599")]
|
||||
[Address(RVA = "0x1E48CD0", Offset = "0x1E476D0", VA = "0x181E48CD0")]
|
||||
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: 0x170017EA RID: 6122
|
||||
// (get) Token: 0x0600959A RID: 38298 RVA: 0x002127D8 File Offset: 0x002109D8
|
||||
[Token(Token = "0x170017EA")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600959A")]
|
||||
[Address(RVA = "0x1E48DD0", Offset = "0x1E477D0", VA = "0x181E48DD0", Slot = "11")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.mgfDigest;
|
||||
return 0 + "withRSAandMGF1";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600959B RID: 38299 RVA: 0x00212800 File Offset: 0x00210A00
|
||||
[Token(Token = "0x600959B")]
|
||||
[Address(RVA = "0x1E47DF0", Offset = "0x1E467F0", VA = "0x181E47DF0", 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: 0x0600959C RID: 38300 RVA: 0x00212890 File Offset: 0x00210A90
|
||||
[Token(Token = "0x600959C")]
|
||||
[Address(RVA = "0x1E43A90", Offset = "0x1E42490", VA = "0x181E43A90")]
|
||||
private void ClearBlock(byte[] block)
|
||||
{
|
||||
int length = block.Length;
|
||||
int num = 0;
|
||||
Array.Clear(block, num, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600959D RID: 38301 RVA: 0x002128B4 File Offset: 0x00210AB4
|
||||
[Token(Token = "0x600959D")]
|
||||
[Address(RVA = "0x1E485B0", Offset = "0x1E46FB0", VA = "0x181E485B0", Slot = "13")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
IDigest digest = this.contentDigest1;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600959E RID: 38302 RVA: 0x002128D0 File Offset: 0x00210AD0
|
||||
[Token(Token = "0x600959E")]
|
||||
[Address(RVA = "0x1E477B0", Offset = "0x1E461B0", VA = "0x181E477B0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int inOff, int length)
|
||||
{
|
||||
IDigest digest = this.contentDigest1;
|
||||
}
|
||||
|
||||
// Token: 0x0600959F RID: 38303 RVA: 0x002128EC File Offset: 0x00210AEC
|
||||
[Token(Token = "0x600959F")]
|
||||
[Address(RVA = "0x1E48560", Offset = "0x1E46F60", VA = "0x181E48560", Slot = "15")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.contentDigest1;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060095A0 RID: 38304 RVA: 0x00212908 File Offset: 0x00210B08
|
||||
[Token(Token = "0x60095A0")]
|
||||
[Address(RVA = "0x1E47AB0", Offset = "0x1E464B0", VA = "0x181E47AB0", 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: 0x060095A1 RID: 38305 RVA: 0x00212A68 File Offset: 0x00210C68
|
||||
[Token(Token = "0x60095A1")]
|
||||
[Address(RVA = "0x1E48610", Offset = "0x1E47010", VA = "0x181E48610", 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: 0x060095A2 RID: 38306 RVA: 0x00212BBC File Offset: 0x00210DBC
|
||||
[Token(Token = "0x60095A2")]
|
||||
[Address(RVA = "0x1E44410", Offset = "0x1E42E10", VA = "0x181E44410")]
|
||||
private void ItoOSP(int i, byte[] sp)
|
||||
{
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
sp[0] = (byte)i;
|
||||
}
|
||||
|
||||
// Token: 0x060095A3 RID: 38307 RVA: 0x00212BF0 File Offset: 0x00210DF0
|
||||
[Token(Token = "0x60095A3")]
|
||||
[Address(RVA = "0x1E480C0", Offset = "0x1E46AC0", VA = "0x181E480C0")]
|
||||
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: 0x040062C2 RID: 25282
|
||||
[Token(Token = "0x40062C2")]
|
||||
public const byte TrailerImplicit = 188;
|
||||
|
||||
// Token: 0x040062C3 RID: 25283
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062C3")]
|
||||
private readonly IDigest contentDigest1;
|
||||
|
||||
// Token: 0x040062C4 RID: 25284
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062C4")]
|
||||
private readonly IDigest contentDigest2;
|
||||
|
||||
// Token: 0x040062C5 RID: 25285
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40062C5")]
|
||||
private readonly IDigest mgfDigest;
|
||||
|
||||
// Token: 0x040062C6 RID: 25286
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40062C6")]
|
||||
private readonly IAsymmetricBlockCipher cipher;
|
||||
|
||||
// Token: 0x040062C7 RID: 25287
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40062C7")]
|
||||
private SecureRandom random;
|
||||
|
||||
// Token: 0x040062C8 RID: 25288
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x40062C8")]
|
||||
private int hLen;
|
||||
|
||||
// Token: 0x040062C9 RID: 25289
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x3C")]
|
||||
[Token(Token = "0x40062C9")]
|
||||
private int mgfhLen;
|
||||
|
||||
// Token: 0x040062CA RID: 25290
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x40062CA")]
|
||||
private int sLen;
|
||||
|
||||
// Token: 0x040062CB RID: 25291
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x44")]
|
||||
[Token(Token = "0x40062CB")]
|
||||
private bool sSet;
|
||||
|
||||
// Token: 0x040062CC RID: 25292
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
||||
[Token(Token = "0x40062CC")]
|
||||
private int emBits;
|
||||
|
||||
// Token: 0x040062CD RID: 25293
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
|
||||
[Token(Token = "0x40062CD")]
|
||||
private byte[] salt;
|
||||
|
||||
// Token: 0x040062CE RID: 25294
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x58")]
|
||||
[Token(Token = "0x40062CE")]
|
||||
private byte[] mDash;
|
||||
|
||||
// Token: 0x040062CF RID: 25295
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x60")]
|
||||
[Token(Token = "0x40062CF")]
|
||||
private byte[] block;
|
||||
|
||||
// Token: 0x040062D0 RID: 25296
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x68")]
|
||||
[Token(Token = "0x40062D0")]
|
||||
private byte trailer;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015DC RID: 5596
|
||||
[Token(Token = "0x20015DC")]
|
||||
[StructLayout(3)]
|
||||
public class RandomDsaKCalculator : IDsaKCalculator
|
||||
{
|
||||
// Token: 0x170017EB RID: 6123
|
||||
// (get) Token: 0x060095A4 RID: 38308 RVA: 0x00212D3C File Offset: 0x00210F3C
|
||||
[Token(Token = "0x170017EB")]
|
||||
public virtual bool IsDeterministic
|
||||
{
|
||||
[Token(Token = "0x60095A4")]
|
||||
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "8")]
|
||||
get
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060095A5 RID: 38309 RVA: 0x00212D4C File Offset: 0x00210F4C
|
||||
[Token(Token = "0x60095A5")]
|
||||
[Address(RVA = "0xB90BA0", Offset = "0xB8F5A0", VA = "0x180B90BA0", Slot = "9")]
|
||||
public virtual void Init(BigInteger n, SecureRandom random)
|
||||
{
|
||||
this.q = n;
|
||||
this.random = random;
|
||||
}
|
||||
|
||||
// Token: 0x060095A6 RID: 38310 RVA: 0x00212D68 File Offset: 0x00210F68
|
||||
[Token(Token = "0x60095A6")]
|
||||
[Address(RVA = "0x1E48E30", Offset = "0x1E47830", VA = "0x181E48E30", Slot = "10")]
|
||||
public virtual void Init(BigInteger n, BigInteger d, byte[] message)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095A6)
|
||||
|
||||
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: 0x060095A7 RID: 38311 RVA: 0x00212D80 File Offset: 0x00210F80
|
||||
[Token(Token = "0x60095A7")]
|
||||
[Address(RVA = "0x1E48E90", Offset = "0x1E47890", VA = "0x181E48E90", 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: 0x060095A8 RID: 38312 RVA: 0x00212DC0 File Offset: 0x00210FC0
|
||||
[Token(Token = "0x60095A8")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public RandomDsaKCalculator()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040062D1 RID: 25297
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062D1")]
|
||||
private BigInteger q;
|
||||
|
||||
// Token: 0x040062D2 RID: 25298
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062D2")]
|
||||
private SecureRandom random;
|
||||
}
|
||||
}
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015DD RID: 5597
|
||||
[Token(Token = "0x20015DD")]
|
||||
[StructLayout(3)]
|
||||
public class RsaDigestSigner : ISigner
|
||||
{
|
||||
// Token: 0x060095A9 RID: 38313 RVA: 0x00212DD4 File Offset: 0x00210FD4
|
||||
[Token(Token = "0x60095A9")]
|
||||
[Address(RVA = "0x1E49CC0", Offset = "0x1E486C0", VA = "0x181E49CC0")]
|
||||
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: 0x060095AA RID: 38314 RVA: 0x00212E8C File Offset: 0x0021108C
|
||||
[Token(Token = "0x60095AA")]
|
||||
[Address(RVA = "0x1E4A390", Offset = "0x1E48D90", VA = "0x181E4A390")]
|
||||
public RsaDigestSigner(IDigest digest)
|
||||
{
|
||||
IDictionary dictionary = RsaDigestSigner.oidMap;
|
||||
IDictionary dictionary2 = RsaDigestSigner.oidMap;
|
||||
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
|
||||
}
|
||||
|
||||
// Token: 0x060095AB RID: 38315 RVA: 0x00212EB8 File Offset: 0x002110B8
|
||||
[Token(Token = "0x60095AB")]
|
||||
[Address(RVA = "0x1E4A570", Offset = "0x1E48F70", VA = "0x181E4A570")]
|
||||
public RsaDigestSigner(IDigest digest, DerObjectIdentifier digestOid)
|
||||
{
|
||||
DerNull instance = DerNull.Instance;
|
||||
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
|
||||
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
|
||||
}
|
||||
|
||||
// Token: 0x060095AC RID: 38316 RVA: 0x00212EDC File Offset: 0x002110DC
|
||||
[Token(Token = "0x60095AC")]
|
||||
[Address(RVA = "0x1E4A170", Offset = "0x1E48B70", VA = "0x181E4A170")]
|
||||
public RsaDigestSigner(IDigest digest, AlgorithmIdentifier algId)
|
||||
{
|
||||
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
|
||||
}
|
||||
|
||||
// Token: 0x060095AD RID: 38317 RVA: 0x00212EF0 File Offset: 0x002110F0
|
||||
[Token(Token = "0x60095AD")]
|
||||
[Address(RVA = "0x1E4A2C0", Offset = "0x1E48CC0", VA = "0x181E4A2C0")]
|
||||
public RsaDigestSigner(IRsa rsa, IDigest digest, DerObjectIdentifier digestOid)
|
||||
{
|
||||
DerNull instance = DerNull.Instance;
|
||||
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(digestOid, instance);
|
||||
}
|
||||
|
||||
// Token: 0x060095AE RID: 38318 RVA: 0x00212F0C File Offset: 0x0021110C
|
||||
[Token(Token = "0x60095AE")]
|
||||
[Address(RVA = "0x1E4A1F0", Offset = "0x1E48BF0", VA = "0x181E4A1F0")]
|
||||
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: 0x060095AF RID: 38319 RVA: 0x00212F4C File Offset: 0x0021114C
|
||||
[Token(Token = "0x60095AF")]
|
||||
[Address(RVA = "0x1E4A0E0", Offset = "0x1E48AE0", VA = "0x181E4A0E0")]
|
||||
public RsaDigestSigner(IAsymmetricBlockCipher rsaEngine, IDigest digest, AlgorithmIdentifier algId)
|
||||
{
|
||||
Pkcs1Encoding pkcs1Encoding = new Pkcs1Encoding(rsaEngine);
|
||||
this.rsaEngine = pkcs1Encoding;
|
||||
this.digest = digest;
|
||||
this.algId = algId;
|
||||
}
|
||||
|
||||
// Token: 0x170017EC RID: 6124
|
||||
// (get) Token: 0x060095B0 RID: 38320 RVA: 0x00212F7C File Offset: 0x0021117C
|
||||
[Token(Token = "0x170017EC")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60095B0")]
|
||||
[Address(RVA = "0x1E4A670", Offset = "0x1E49070", VA = "0x181E4A670", Slot = "11")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
return 0 + "withRSA";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060095B1 RID: 38321 RVA: 0x00212FA4 File Offset: 0x002111A4
|
||||
[Token(Token = "0x60095B1")]
|
||||
[Address(RVA = "0x1E496A0", Offset = "0x1E480A0", VA = "0x181E496A0", Slot = "12")]
|
||||
public virtual void Init(bool forSigning, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095B1)
|
||||
|
||||
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: 0x060095B2 RID: 38322 RVA: 0x00213014 File Offset: 0x00211214
|
||||
[Token(Token = "0x60095B2")]
|
||||
[Address(RVA = "0x1E49970", Offset = "0x1E48370", VA = "0x181E49970", Slot = "13")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060095B3 RID: 38323 RVA: 0x00213030 File Offset: 0x00211230
|
||||
[Token(Token = "0x60095B3")]
|
||||
[Address(RVA = "0x1E49480", Offset = "0x1E47E80", VA = "0x181E49480", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int inOff, int length)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
}
|
||||
|
||||
// Token: 0x060095B4 RID: 38324 RVA: 0x0021304C File Offset: 0x0021124C
|
||||
[Token(Token = "0x60095B4")]
|
||||
[Address(RVA = "0x1E49590", Offset = "0x1E47F90", VA = "0x181E49590", Slot = "15")]
|
||||
public virtual byte[] GenerateSignature()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095B4)
|
||||
|
||||
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: 0x060095B5 RID: 38325 RVA: 0x002130A0 File Offset: 0x002112A0
|
||||
[Token(Token = "0x60095B5")]
|
||||
[Address(RVA = "0x1E499D0", Offset = "0x1E483D0", VA = "0x181E499D0", Slot = "16")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095B5)
|
||||
|
||||
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: 0x060095B6 RID: 38326 RVA: 0x00213124 File Offset: 0x00211324
|
||||
[Token(Token = "0x60095B6")]
|
||||
[Address(RVA = "0x1E49920", Offset = "0x1E48320", VA = "0x181E49920", Slot = "17")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060095B7 RID: 38327 RVA: 0x00213140 File Offset: 0x00211340
|
||||
[Token(Token = "0x60095B7")]
|
||||
[Address(RVA = "0x1E49500", Offset = "0x1E47F00", VA = "0x181E49500")]
|
||||
private byte[] DerEncode(byte[] hash)
|
||||
{
|
||||
AlgorithmIdentifier algorithmIdentifier = this.algId;
|
||||
if (algorithmIdentifier != 0)
|
||||
{
|
||||
return new DigestInfo(algorithmIdentifier, hash).GetDerEncoded();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
// Token: 0x040062D3 RID: 25299
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062D3")]
|
||||
private readonly IAsymmetricBlockCipher rsaEngine;
|
||||
|
||||
// Token: 0x040062D4 RID: 25300
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062D4")]
|
||||
private readonly AlgorithmIdentifier algId;
|
||||
|
||||
// Token: 0x040062D5 RID: 25301
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40062D5")]
|
||||
private readonly IDigest digest;
|
||||
|
||||
// Token: 0x040062D6 RID: 25302
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40062D6")]
|
||||
private bool forSigning;
|
||||
|
||||
// Token: 0x040062D7 RID: 25303
|
||||
[Token(Token = "0x40062D7")]
|
||||
private static readonly IDictionary oidMap = Platform.CreateHashtable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015DE RID: 5598
|
||||
[Token(Token = "0x20015DE")]
|
||||
[StructLayout(3)]
|
||||
public class SM2Signer : ISigner
|
||||
{
|
||||
// Token: 0x060095B8 RID: 38328 RVA: 0x0021316C File Offset: 0x0021136C
|
||||
[Token(Token = "0x60095B8")]
|
||||
[Address(RVA = "0x1E4BAD0", Offset = "0x1E4A4D0", VA = "0x181E4BAD0")]
|
||||
public SM2Signer()
|
||||
{
|
||||
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
|
||||
this.kCalculator = randomDsaKCalculator;
|
||||
SM3Digest sm3Digest = new SM3Digest();
|
||||
this.digest = sm3Digest;
|
||||
base..ctor();
|
||||
this.encoding = typeof(StandardDsaEncoding).TypeHandle;
|
||||
}
|
||||
|
||||
// Token: 0x060095B9 RID: 38329 RVA: 0x002131A4 File Offset: 0x002113A4
|
||||
[Token(Token = "0x60095B9")]
|
||||
[Address(RVA = "0x1E4BB80", Offset = "0x1E4A580", VA = "0x181E4BB80")]
|
||||
public SM2Signer(IDsaEncoding encoding)
|
||||
{
|
||||
RandomDsaKCalculator randomDsaKCalculator = new RandomDsaKCalculator();
|
||||
this.kCalculator = randomDsaKCalculator;
|
||||
SM3Digest sm3Digest = new SM3Digest();
|
||||
this.digest = sm3Digest;
|
||||
base..ctor();
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
// Token: 0x170017ED RID: 6125
|
||||
// (get) Token: 0x060095BA RID: 38330 RVA: 0x002131D8 File Offset: 0x002113D8
|
||||
[Token(Token = "0x170017ED")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60095BA")]
|
||||
[Address(RVA = "0x1E4BC10", Offset = "0x1E4A610", VA = "0x181E4BC10", Slot = "11")]
|
||||
get
|
||||
{
|
||||
return "SM2Sign";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060095BB RID: 38331 RVA: 0x002131EC File Offset: 0x002113EC
|
||||
[Token(Token = "0x60095BB")]
|
||||
[Address(RVA = "0x1E4B0C0", Offset = "0x1E49AC0", VA = "0x181E4B0C0", 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: 0x060095BC RID: 38332 RVA: 0x00213318 File Offset: 0x00211518
|
||||
[Token(Token = "0x60095BC")]
|
||||
[Address(RVA = "0x1E4B700", Offset = "0x1E4A100", VA = "0x181E4B700", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
this.digest.Update(b);
|
||||
}
|
||||
|
||||
// Token: 0x060095BD RID: 38333 RVA: 0x00213338 File Offset: 0x00211538
|
||||
[Token(Token = "0x60095BD")]
|
||||
[Address(RVA = "0x1E4A810", Offset = "0x1E49210", VA = "0x181E4A810", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] buf, int off, int len)
|
||||
{
|
||||
this.digest.BlockUpdate(buf, off, len);
|
||||
}
|
||||
|
||||
// Token: 0x060095BE RID: 38334 RVA: 0x0021335C File Offset: 0x0021155C
|
||||
[Token(Token = "0x60095BE")]
|
||||
[Address(RVA = "0x1E4B720", Offset = "0x1E4A120", VA = "0x181E4B720", Slot = "15")]
|
||||
public virtual bool VerifySignature(byte[] signature)
|
||||
{
|
||||
IDsaEncoding dsaEncoding = this.encoding;
|
||||
byte[] seed = this.ecParams.seed;
|
||||
bool flag;
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060095BF RID: 38335 RVA: 0x002133A0 File Offset: 0x002115A0
|
||||
[Token(Token = "0x60095BF")]
|
||||
[Address(RVA = "0x1E4B6A0", Offset = "0x1E4A0A0", VA = "0x181E4B6A0", 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: 0x060095C0 RID: 38336 RVA: 0x002133E8 File Offset: 0x002115E8
|
||||
[Token(Token = "0x60095C0")]
|
||||
[Address(RVA = "0x1E4A8F0", Offset = "0x1E492F0", VA = "0x181E4A8F0", 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: 0x060095C1 RID: 38337 RVA: 0x002134FC File Offset: 0x002116FC
|
||||
[Token(Token = "0x60095C1")]
|
||||
[Address(RVA = "0x1E4B810", Offset = "0x1E4A210", VA = "0x181E4B810")]
|
||||
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: 0x060095C2 RID: 38338 RVA: 0x002135B4 File Offset: 0x002117B4
|
||||
[Token(Token = "0x60095C2")]
|
||||
[Address(RVA = "0x1E4AE50", Offset = "0x1E49850", VA = "0x181E4AE50")]
|
||||
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: 0x060095C3 RID: 38339 RVA: 0x00213684 File Offset: 0x00211884
|
||||
[Token(Token = "0x60095C3")]
|
||||
[Address(RVA = "0x1E4A760", Offset = "0x1E49160", VA = "0x181E4A760")]
|
||||
private void AddUserID(IDigest digest, byte[] userID)
|
||||
{
|
||||
int length = userID.Length;
|
||||
}
|
||||
|
||||
// Token: 0x060095C4 RID: 38340 RVA: 0x002136A0 File Offset: 0x002118A0
|
||||
[Token(Token = "0x60095C4")]
|
||||
[Address(RVA = "0x1E4A6D0", Offset = "0x1E490D0", VA = "0x181E4A6D0")]
|
||||
private void AddFieldElement(IDigest digest, ECFieldElement v)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060095C5 RID: 38341 RVA: 0x002136B4 File Offset: 0x002118B4
|
||||
[Token(Token = "0x60095C5")]
|
||||
[Address(RVA = "0x1E4A840", Offset = "0x1E49240", VA = "0x181E4A840", Slot = "18")]
|
||||
protected virtual BigInteger CalculateE(byte[] message)
|
||||
{
|
||||
return new BigInteger(1, message);
|
||||
}
|
||||
|
||||
// Token: 0x060095C6 RID: 38342 RVA: 0x002136C8 File Offset: 0x002118C8
|
||||
[Token(Token = "0x60095C6")]
|
||||
[Address(RVA = "0x1E4A8A0", Offset = "0x1E492A0", VA = "0x181E4A8A0", Slot = "19")]
|
||||
protected virtual ECMultiplier CreateBasePointMultiplier()
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095C6)
|
||||
|
||||
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: 0x040062D8 RID: 25304
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062D8")]
|
||||
private readonly IDsaKCalculator kCalculator;
|
||||
|
||||
// Token: 0x040062D9 RID: 25305
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062D9")]
|
||||
private readonly SM3Digest digest;
|
||||
|
||||
// Token: 0x040062DA RID: 25306
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40062DA")]
|
||||
private readonly IDsaEncoding encoding;
|
||||
|
||||
// Token: 0x040062DB RID: 25307
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40062DB")]
|
||||
private ECDomainParameters ecParams;
|
||||
|
||||
// Token: 0x040062DC RID: 25308
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40062DC")]
|
||||
private ECPoint pubPoint;
|
||||
|
||||
// Token: 0x040062DD RID: 25309
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x40062DD")]
|
||||
private ECKeyParameters ecKey;
|
||||
|
||||
// Token: 0x040062DE RID: 25310
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x40062DE")]
|
||||
private byte[] z;
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers
|
||||
{
|
||||
// Token: 0x020015DF RID: 5599
|
||||
[Token(Token = "0x20015DF")]
|
||||
[StructLayout(3)]
|
||||
public class StandardDsaEncoding : IDsaEncoding
|
||||
{
|
||||
// Token: 0x060095C7 RID: 38343 RVA: 0x0000220F File Offset: 0x0000040F
|
||||
[Token(Token = "0x60095C7")]
|
||||
[Address(RVA = "0x1E4CB70", Offset = "0x1E4B570", VA = "0x181E4CB70", Slot = "6")]
|
||||
public virtual BigInteger[] Decode(BigInteger n, byte[] encoding)
|
||||
{
|
||||
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
||||
}
|
||||
|
||||
// Token: 0x060095C8 RID: 38344 RVA: 0x002136DC File Offset: 0x002118DC
|
||||
[Token(Token = "0x60095C8")]
|
||||
[Address(RVA = "0x1E4CE50", Offset = "0x1E4B850", VA = "0x181E4CE50", 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: 0x060095C9 RID: 38345 RVA: 0x00213720 File Offset: 0x00211920
|
||||
[Token(Token = "0x60095C9")]
|
||||
[Address(RVA = "0x1E4C9B0", Offset = "0x1E4B3B0", VA = "0x181E4C9B0", Slot = "8")]
|
||||
protected virtual BigInteger CheckValue(BigInteger n, BigInteger x)
|
||||
{
|
||||
if (n != 0)
|
||||
{
|
||||
int num = x.CompareTo(n);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x060095CA RID: 38346 RVA: 0x00213740 File Offset: 0x00211940
|
||||
[Token(Token = "0x60095CA")]
|
||||
[Address(RVA = "0x1E4CA50", Offset = "0x1E4B450", VA = "0x181E4CA50", 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: 0x060095CB RID: 38347 RVA: 0x00213768 File Offset: 0x00211968
|
||||
[Token(Token = "0x60095CB")]
|
||||
[Address(RVA = "0x1E4CDD0", Offset = "0x1E4B7D0", VA = "0x181E4CDD0", Slot = "10")]
|
||||
protected virtual DerInteger EncodeValue(BigInteger n, BigInteger x)
|
||||
{
|
||||
DerInteger derInteger;
|
||||
return derInteger;
|
||||
}
|
||||
|
||||
// Token: 0x060095CC RID: 38348 RVA: 0x00213778 File Offset: 0x00211978
|
||||
[Token(Token = "0x60095CC")]
|
||||
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
|
||||
public StandardDsaEncoding()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060095CD RID: 38349 RVA: 0x0021378C File Offset: 0x0021198C
|
||||
// Note: this type is marked as 'beforefieldinit'.
|
||||
[Token(Token = "0x60095CD")]
|
||||
[Address(RVA = "0x1E4CFE0", Offset = "0x1E4B9E0", VA = "0x181E4CFE0")]
|
||||
static StandardDsaEncoding()
|
||||
{
|
||||
StandardDsaEncoding standardDsaEncoding = new StandardDsaEncoding();
|
||||
}
|
||||
|
||||
// Token: 0x040062DF RID: 25311
|
||||
[Token(Token = "0x40062DF")]
|
||||
public static readonly StandardDsaEncoding Instance;
|
||||
}
|
||||
}
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
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: 0x020015E0 RID: 5600
|
||||
[Token(Token = "0x20015E0")]
|
||||
[StructLayout(3)]
|
||||
public class X931Signer : ISigner
|
||||
{
|
||||
// Token: 0x060095CE RID: 38350 RVA: 0x002137A0 File Offset: 0x002119A0
|
||||
[Token(Token = "0x60095CE")]
|
||||
[Address(RVA = "0x1E4F330", Offset = "0x1E4DD30", VA = "0x181E4F330")]
|
||||
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095CE)
|
||||
|
||||
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: 0x170017EE RID: 6126
|
||||
// (get) Token: 0x060095CF RID: 38351 RVA: 0x002137FC File Offset: 0x002119FC
|
||||
[Token(Token = "0x170017EE")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x60095CF")]
|
||||
[Address(RVA = "0x1E4F430", Offset = "0x1E4DE30", VA = "0x181E4F430", Slot = "11")]
|
||||
get
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
IAsymmetricBlockCipher asymmetricBlockCipher = this.cipher;
|
||||
string text;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060095D0 RID: 38352 RVA: 0x00213824 File Offset: 0x00211A24
|
||||
[Token(Token = "0x60095D0")]
|
||||
[Address(RVA = "0x1E4F240", Offset = "0x1E4DC40", VA = "0x181E4F240")]
|
||||
public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (060095D0)
|
||||
|
||||
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: 0x060095D1 RID: 38353 RVA: 0x0021386C File Offset: 0x00211A6C
|
||||
[Token(Token = "0x60095D1")]
|
||||
[Address(RVA = "0x1E4EE80", Offset = "0x1E4D880", VA = "0x181E4EE80", 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: 0x060095D2 RID: 38354 RVA: 0x002138D4 File Offset: 0x00211AD4
|
||||
[Token(Token = "0x60095D2")]
|
||||
[Address(RVA = "0x1E43A90", Offset = "0x1E42490", VA = "0x181E43A90")]
|
||||
private void ClearBlock(byte[] block)
|
||||
{
|
||||
int length = block.Length;
|
||||
int num = 0;
|
||||
Array.Clear(block, num, length);
|
||||
}
|
||||
|
||||
// Token: 0x060095D3 RID: 38355 RVA: 0x002138F8 File Offset: 0x00211AF8
|
||||
[Token(Token = "0x60095D3")]
|
||||
[Address(RVA = "0x1E4EFE0", Offset = "0x1E4D9E0", VA = "0x181E4EFE0", Slot = "13")]
|
||||
public virtual void Update(byte b)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060095D4 RID: 38356 RVA: 0x00213914 File Offset: 0x00211B14
|
||||
[Token(Token = "0x60095D4")]
|
||||
[Address(RVA = "0x1E4EAE0", Offset = "0x1E4D4E0", VA = "0x181E4EAE0", Slot = "14")]
|
||||
public virtual void BlockUpdate(byte[] input, int off, int len)
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
}
|
||||
|
||||
// Token: 0x060095D5 RID: 38357 RVA: 0x00213930 File Offset: 0x00211B30
|
||||
[Token(Token = "0x60095D5")]
|
||||
[Address(RVA = "0x1E4EF90", Offset = "0x1E4D990", VA = "0x181E4EF90", Slot = "15")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
IDigest digest = this.digest;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x060095D6 RID: 38358 RVA: 0x0021394C File Offset: 0x00211B4C
|
||||
[Token(Token = "0x60095D6")]
|
||||
[Address(RVA = "0x1E4ED60", Offset = "0x1E4D760", VA = "0x181E4ED60", 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: 0x060095D7 RID: 38359 RVA: 0x002139D0 File Offset: 0x00211BD0
|
||||
[Token(Token = "0x60095D7")]
|
||||
[Address(RVA = "0x1E4EB60", Offset = "0x1E4D560", VA = "0x181E4EB60")]
|
||||
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: 0x060095D8 RID: 38360 RVA: 0x00213A88 File Offset: 0x00211C88
|
||||
[Token(Token = "0x60095D8")]
|
||||
[Address(RVA = "0x1E4F040", Offset = "0x1E4DA40", VA = "0x181E4F040", 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: 0x040062E0 RID: 25312
|
||||
[Token(Token = "0x40062E0")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_IMPLICIT = 188;
|
||||
|
||||
// Token: 0x040062E1 RID: 25313
|
||||
[Token(Token = "0x40062E1")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_RIPEMD160 = 12748;
|
||||
|
||||
// Token: 0x040062E2 RID: 25314
|
||||
[Token(Token = "0x40062E2")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_RIPEMD128 = 13004;
|
||||
|
||||
// Token: 0x040062E3 RID: 25315
|
||||
[Token(Token = "0x40062E3")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_SHA1 = 13260;
|
||||
|
||||
// Token: 0x040062E4 RID: 25316
|
||||
[Token(Token = "0x40062E4")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_SHA256 = 13516;
|
||||
|
||||
// Token: 0x040062E5 RID: 25317
|
||||
[Token(Token = "0x40062E5")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_SHA512 = 13772;
|
||||
|
||||
// Token: 0x040062E6 RID: 25318
|
||||
[Token(Token = "0x40062E6")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_SHA384 = 14028;
|
||||
|
||||
// Token: 0x040062E7 RID: 25319
|
||||
[Token(Token = "0x40062E7")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_WHIRLPOOL = 14284;
|
||||
|
||||
// Token: 0x040062E8 RID: 25320
|
||||
[Token(Token = "0x40062E8")]
|
||||
[Obsolete]
|
||||
public const int TRAILER_SHA224 = 14540;
|
||||
|
||||
// Token: 0x040062E9 RID: 25321
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40062E9")]
|
||||
private IDigest digest;
|
||||
|
||||
// Token: 0x040062EA RID: 25322
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40062EA")]
|
||||
private IAsymmetricBlockCipher cipher;
|
||||
|
||||
// Token: 0x040062EB RID: 25323
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40062EB")]
|
||||
private RsaKeyParameters kParam;
|
||||
|
||||
// Token: 0x040062EC RID: 25324
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40062EC")]
|
||||
private int trailer;
|
||||
|
||||
// Token: 0x040062ED RID: 25325
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x2C")]
|
||||
[Token(Token = "0x40062ED")]
|
||||
private int keyBits;
|
||||
|
||||
// Token: 0x040062EE RID: 25326
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40062EE")]
|
||||
private byte[] block;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user