Files
Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Modes/KCtrBlockCipher.cs
T
2026-04-10 22:50:51 +02:00

241 lines
8.8 KiB
C#

using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
{
// Token: 0x02001C3C RID: 7228
[Token(Token = "0x2001C3C")]
public class KCtrBlockCipher : IStreamCipher, IBlockCipher
{
// Token: 0x0600B4A5 RID: 46245 RVA: 0x002762F8 File Offset: 0x002744F8
[Token(Token = "0x600B4A5")]
[Address(RVA = "0x180BBA0", Offset = "0x180A9A0", VA = "0x18180BBA0")]
public KCtrBlockCipher(IBlockCipher cipher)
{
this.checkCounter();
this.cipher = cipher;
byte[] array = new byte[0];
this.IV = array;
this.blockSize = array;
byte[] array2 = new byte[array];
this.ofbV = array2;
byte[] array3 = new byte[array2];
this.ofbOutV = array3;
}
// Token: 0x0600B4A6 RID: 46246 RVA: 0x0027634C File Offset: 0x0027454C
[Token(Token = "0x600B4A6")]
[Address(RVA = "0x3F63D0", Offset = "0x3F51D0", VA = "0x1803F63D0")]
public IBlockCipher GetUnderlyingCipher()
{
return this.cipher;
}
// Token: 0x0600B4A7 RID: 46247 RVA: 0x00276360 File Offset: 0x00274560
[Token(Token = "0x600B4A7")]
[Address(RVA = "0x180B4B0", Offset = "0x180A2B0", VA = "0x18180B4B0", Slot = "10")]
public void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B4A7)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.KCtrBlockCipher::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_95:
stloc:ArgumentException(var_14_9F, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Invalid parameter passed")))
}
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: 0x17001C80 RID: 7296
// (get) Token: 0x0600B4A8 RID: 46248 RVA: 0x00276410 File Offset: 0x00274610
[Token(Token = "0x17001C80")]
public string AlgorithmName
{
[Token(Token = "0x600B4A8")]
[Address(RVA = "0x180BC80", Offset = "0x180AA80", VA = "0x18180BC80", Slot = "9")]
get
{
IBlockCipher blockCipher = this.cipher;
return 0 + "/KCTR";
}
}
// Token: 0x17001C81 RID: 7297
// (get) Token: 0x0600B4A9 RID: 46249 RVA: 0x00276438 File Offset: 0x00274638
[Token(Token = "0x17001C81")]
public bool IsPartialBlockOkay
{
[Token(Token = "0x600B4A9")]
[Address(RVA = "0x460D40", Offset = "0x45FB40", VA = "0x180460D40", Slot = "12")]
get
{
return true;
}
}
// Token: 0x0600B4AA RID: 46250 RVA: 0x00276448 File Offset: 0x00274648
[Token(Token = "0x600B4AA")]
[Address(RVA = "0x180B460", Offset = "0x180A260", VA = "0x18180B460", Slot = "11")]
public int GetBlockSize()
{
IBlockCipher blockCipher = this.cipher;
throw new NullReferenceException();
}
// Token: 0x0600B4AB RID: 46251 RVA: 0x00276464 File Offset: 0x00274664
[Token(Token = "0x600B4AB")]
[Address(RVA = "0x180BB90", Offset = "0x180A990", VA = "0x18180BB90", Slot = "6")]
public byte ReturnByte(byte input)
{
return this.CalculateByte(input);
}
// Token: 0x0600B4AC RID: 46252 RVA: 0x00276478 File Offset: 0x00274678
[Token(Token = "0x600B4AC")]
[Address(RVA = "0x180B9A0", Offset = "0x180A7A0", VA = "0x18180B9A0", Slot = "7")]
public void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
{
byte b2;
byte b = this.CalculateByte(b2);
}
// Token: 0x0600B4AD RID: 46253 RVA: 0x00276494 File Offset: 0x00274694
[Token(Token = "0x600B4AD")]
[Address(RVA = "0x180B2F0", Offset = "0x180A0F0", VA = "0x18180B2F0")]
protected byte CalculateByte(byte b)
{
int num = this.byteCount;
if (num != 0)
{
byte[] array = this.ofbOutV;
int num2 = num + 1;
this.byteCount = num2;
byte[] array2 = this.ofbV;
if (num2 == array2.Length)
{
int num3 = 0;
this.byteCount = num3;
}
byte b2;
return b2;
}
byte[] array3 = this.ofbV;
int num4 = 0;
if (num4 < array3.Length)
{
num4++;
if (num4 == array3.Length)
{
byte[] array4 = this.ofbV;
}
}
IBlockCipher blockCipher = this.cipher;
byte[] array5 = this.ofbOutV;
int num5 = this.byteCount;
byte[] array6 = this.ofbOutV;
int num6 = num5 + 1;
this.byteCount = num6;
byte b3;
return b3;
}
// Token: 0x0600B4AE RID: 46254 RVA: 0x00276548 File Offset: 0x00274748
[Token(Token = "0x600B4AE")]
[Address(RVA = "0x180B6D0", Offset = "0x180A4D0", VA = "0x18180B6D0", Slot = "13")]
public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
{
IBlockCipher blockCipher = this.cipher;
int num = input.Length;
num -= inOff;
IBlockCipher blockCipher2 = this.cipher;
int length = output.Length;
IBlockCipher blockCipher3 = this.cipher;
byte b2;
byte b = this.CalculateByte(b2);
this.ofbOutV = b;
IBlockCipher blockCipher4 = this.cipher;
throw new NullReferenceException();
}
// Token: 0x0600B4AF RID: 46255 RVA: 0x0027659C File Offset: 0x0027479C
[Token(Token = "0x600B4AF")]
[Address(RVA = "0x180BB00", Offset = "0x180A900", VA = "0x18180BB00", Slot = "14")]
public void Reset()
{
if (this.initialised)
{
IBlockCipher blockCipher = this.cipher;
byte[] array = this.ofbV;
}
IBlockCipher blockCipher2 = this.cipher;
this.byteCount = (int)((ulong)0L);
}
// Token: 0x0600B4B0 RID: 46256 RVA: 0x002765D8 File Offset: 0x002747D8
[Token(Token = "0x600B4B0")]
[Address(RVA = "0x180BCE0", Offset = "0x180AAE0", VA = "0x18180BCE0")]
private void incrementCounterAt(int pos)
{
byte[] array = this.ofbV;
if (pos < array.Length && pos == array.Length)
{
byte[] array2 = this.ofbV;
}
}
// Token: 0x0600B4B1 RID: 46257 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B4B1")]
[Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080")]
private void checkCounter()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x040072AB RID: 29355
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40072AB")]
private byte[] IV;
// Token: 0x040072AC RID: 29356
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40072AC")]
private byte[] ofbV;
// Token: 0x040072AD RID: 29357
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x40072AD")]
private byte[] ofbOutV;
// Token: 0x040072AE RID: 29358
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40072AE")]
private bool initialised;
// Token: 0x040072AF RID: 29359
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x40072AF")]
private int byteCount;
// Token: 0x040072B0 RID: 29360
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40072B0")]
private readonly int blockSize;
// Token: 0x040072B1 RID: 29361
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40072B1")]
private readonly IBlockCipher cipher;
}
}