scripts
This commit is contained in:
+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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user