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: 0x02001CA3 RID: 7331
|
|
[Token(Token = "0x2001CA3")]
|
|
public class RsaBlindedEngine : IAsymmetricBlockCipher
|
|
{
|
|
// Token: 0x0600B860 RID: 47200 RVA: 0x0028FC00 File Offset: 0x0028DE00
|
|
[Token(Token = "0x600B860")]
|
|
[Address(RVA = "0x1DF9770", Offset = "0x1DF8570", VA = "0x181DF9770")]
|
|
public RsaBlindedEngine()
|
|
{
|
|
RsaCoreEngine rsaCoreEngine = new RsaCoreEngine();
|
|
base..ctor();
|
|
this.core = rsaCoreEngine;
|
|
}
|
|
|
|
// Token: 0x0600B861 RID: 47201 RVA: 0x0028FC20 File Offset: 0x0028DE20
|
|
[Token(Token = "0x600B861")]
|
|
[Address(RVA = "0x3FFB80", Offset = "0x3FE980", VA = "0x1803FFB80")]
|
|
public RsaBlindedEngine(IRsa rsa)
|
|
{
|
|
this.core = rsa;
|
|
}
|
|
|
|
// Token: 0x17001CE7 RID: 7399
|
|
// (get) Token: 0x0600B862 RID: 47202 RVA: 0x0028FC3C File Offset: 0x0028DE3C
|
|
[Token(Token = "0x17001CE7")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600B862")]
|
|
[Address(RVA = "0x1DF97D0", Offset = "0x1DF85D0", VA = "0x181DF97D0", Slot = "9")]
|
|
get
|
|
{
|
|
return "RSA";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B863 RID: 47203 RVA: 0x0028FC50 File Offset: 0x0028DE50
|
|
[Token(Token = "0x600B863")]
|
|
[Address(RVA = "0x1DF9250", Offset = "0x1DF8050", VA = "0x181DF9250", 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: 0x0600B864 RID: 47204 RVA: 0x0028FCC4 File Offset: 0x0028DEC4
|
|
[Token(Token = "0x600B864")]
|
|
[Address(RVA = "0x1DF91B0", Offset = "0x1DF7FB0", VA = "0x181DF91B0", Slot = "11")]
|
|
public virtual int GetInputBlockSize()
|
|
{
|
|
IRsa rsa = this.core;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B865 RID: 47205 RVA: 0x0028FCE0 File Offset: 0x0028DEE0
|
|
[Token(Token = "0x600B865")]
|
|
[Address(RVA = "0x1DF9200", Offset = "0x1DF8000", VA = "0x181DF9200", Slot = "12")]
|
|
public virtual int GetOutputBlockSize()
|
|
{
|
|
IRsa rsa = this.core;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B866 RID: 47206 RVA: 0x0028FCFC File Offset: 0x0028DEFC
|
|
[Token(Token = "0x600B866")]
|
|
[Address(RVA = "0x1DF9430", Offset = "0x1DF8230", VA = "0x181DF9430", Slot = "13")]
|
|
public virtual byte[] ProcessBlock(byte[] inBuf, int inOff, int inLen)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B866)
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x040074E6 RID: 29926
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40074E6")]
|
|
private readonly IRsa core;
|
|
|
|
// Token: 0x040074E7 RID: 29927
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40074E7")]
|
|
private RsaKeyParameters key;
|
|
|
|
// Token: 0x040074E8 RID: 29928
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40074E8")]
|
|
private SecureRandom random;
|
|
}
|
|
}
|