139 lines
5.8 KiB
C#
139 lines
5.8 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
|
|
{
|
|
// Token: 0x02001D83 RID: 7555
|
|
[Token(Token = "0x2001D83")]
|
|
public class RsaBlindedEngine : IAsymmetricBlockCipher
|
|
{
|
|
// Token: 0x0600BC2E RID: 48174 RVA: 0x00298D14 File Offset: 0x00296F14
|
|
[Token(Token = "0x600BC2E")]
|
|
[Address(RVA = "0x27364D0", Offset = "0x27354D0", VA = "0x1827364D0")]
|
|
public RsaBlindedEngine()
|
|
{
|
|
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
|
|
base..ctor();
|
|
this.core = rsaCoreEngine;
|
|
}
|
|
|
|
// Token: 0x0600BC2F RID: 48175 RVA: 0x00298D34 File Offset: 0x00296F34
|
|
[Token(Token = "0x600BC2F")]
|
|
[Address(RVA = "0x493D90", Offset = "0x492D90", VA = "0x180493D90")]
|
|
public RsaBlindedEngine(IRsa rsa)
|
|
{
|
|
this.core = rsa;
|
|
}
|
|
|
|
// Token: 0x17001D84 RID: 7556
|
|
// (get) Token: 0x0600BC30 RID: 48176 RVA: 0x00298D50 File Offset: 0x00296F50
|
|
[Token(Token = "0x17001D84")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BC30")]
|
|
[Address(RVA = "0x2736530", Offset = "0x2735530", VA = "0x182736530", Slot = "9")]
|
|
get
|
|
{
|
|
return "RSA";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BC31 RID: 48177 RVA: 0x00298D64 File Offset: 0x00296F64
|
|
[Token(Token = "0x600BC31")]
|
|
[Address(RVA = "0x2735FB0", Offset = "0x2734FB0", VA = "0x182735FB0", Slot = "10")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters param)
|
|
{
|
|
int num;
|
|
for (;;)
|
|
{
|
|
IRsa rsa = this.core;
|
|
if (param == 0)
|
|
{
|
|
goto IL_44;
|
|
}
|
|
if ((param != 0 || param != 0) && param != 0)
|
|
{
|
|
if (typeof(ParametersWithRandom).TypeHandle == 0)
|
|
{
|
|
break;
|
|
}
|
|
num = 0;
|
|
if (typeof(ParametersWithRandom).TypeHandle != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
this.key = typeof(ParametersWithRandom).TypeHandle;
|
|
this.random = num;
|
|
return;
|
|
IL_44:
|
|
int num2 = 0;
|
|
this.key = num2;
|
|
SecureRandom secureRandom = new SecureRandom();
|
|
this.random = secureRandom;
|
|
}
|
|
|
|
// Token: 0x0600BC32 RID: 48178 RVA: 0x00298DD8 File Offset: 0x00296FD8
|
|
[Token(Token = "0x600BC32")]
|
|
[Address(RVA = "0x2735F10", Offset = "0x2734F10", VA = "0x182735F10", Slot = "11")]
|
|
public virtual int GetInputBlockSize()
|
|
{
|
|
IRsa rsa = this.core;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BC33 RID: 48179 RVA: 0x00298DF4 File Offset: 0x00296FF4
|
|
[Token(Token = "0x600BC33")]
|
|
[Address(RVA = "0x2735F60", Offset = "0x2734F60", VA = "0x182735F60", Slot = "12")]
|
|
public virtual int GetOutputBlockSize()
|
|
{
|
|
IRsa rsa = this.core;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BC34 RID: 48180 RVA: 0x00298E10 File Offset: 0x00297010
|
|
[Token(Token = "0x600BC34")]
|
|
[Address(RVA = "0x2736190", Offset = "0x2735190", VA = "0x182736190", Slot = "13")]
|
|
public virtual byte[] ProcessBlock(byte[] inBuf, int inOff, int inLen)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BC34)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.RsaBlindedEngine::ProcessBlock(System.Byte[],System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_AD:
|
|
stloc:InvalidOperationException(var_19_B7, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("RSA engine not initialised")))
|
|
}
|
|
|
|
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: 0x0400769F RID: 30367
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400769F")]
|
|
private readonly IRsa core;
|
|
|
|
// Token: 0x040076A0 RID: 30368
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40076A0")]
|
|
private RsaKeyParameters key;
|
|
|
|
// Token: 0x040076A1 RID: 30369
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40076A1")]
|
|
private SecureRandom random;
|
|
}
|
|
}
|