Files
27Aug2021-Cpp2IL-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Modes/KCtrBlockCipher.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

241 lines
8.8 KiB
C#

using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
{
// Token: 0x02001D1C RID: 7452
[Token(Token = "0x2001D1C")]
public class KCtrBlockCipher : IStreamCipher, IBlockCipher
{
// Token: 0x0600B873 RID: 47219 RVA: 0x0027F494 File Offset: 0x0027D694
[Token(Token = "0x600B873")]
[Address(RVA = "0x22DE090", Offset = "0x22DD090", VA = "0x1822DE090")]
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: 0x0600B874 RID: 47220 RVA: 0x0027F4E8 File Offset: 0x0027D6E8
[Token(Token = "0x600B874")]
[Address(RVA = "0x41CEF0", Offset = "0x41BEF0", VA = "0x18041CEF0")]
public IBlockCipher GetUnderlyingCipher()
{
return this.cipher;
}
// Token: 0x0600B875 RID: 47221 RVA: 0x0027F4FC File Offset: 0x0027D6FC
[Token(Token = "0x600B875")]
[Address(RVA = "0x22DD9A0", Offset = "0x22DC9A0", VA = "0x1822DD9A0", Slot = "10")]
public void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600B875)
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: 0x17001D1D RID: 7453
// (get) Token: 0x0600B876 RID: 47222 RVA: 0x0027F5AC File Offset: 0x0027D7AC
[Token(Token = "0x17001D1D")]
public string AlgorithmName
{
[Token(Token = "0x600B876")]
[Address(RVA = "0x22DE170", Offset = "0x22DD170", VA = "0x1822DE170", Slot = "9")]
get
{
IBlockCipher blockCipher = this.cipher;
return 0 + "/KCTR";
}
}
// Token: 0x17001D1E RID: 7454
// (get) Token: 0x0600B877 RID: 47223 RVA: 0x0027F5D4 File Offset: 0x0027D7D4
[Token(Token = "0x17001D1E")]
public bool IsPartialBlockOkay
{
[Token(Token = "0x600B877")]
[Address(RVA = "0x4246A0", Offset = "0x4236A0", VA = "0x1804246A0", Slot = "12")]
get
{
return true;
}
}
// Token: 0x0600B878 RID: 47224 RVA: 0x0027F5E4 File Offset: 0x0027D7E4
[Token(Token = "0x600B878")]
[Address(RVA = "0x22DD950", Offset = "0x22DC950", VA = "0x1822DD950", Slot = "11")]
public int GetBlockSize()
{
IBlockCipher blockCipher = this.cipher;
throw new NullReferenceException();
}
// Token: 0x0600B879 RID: 47225 RVA: 0x0027F600 File Offset: 0x0027D800
[Token(Token = "0x600B879")]
[Address(RVA = "0x22DE080", Offset = "0x22DD080", VA = "0x1822DE080", Slot = "6")]
public byte ReturnByte(byte input)
{
return this.CalculateByte(input);
}
// Token: 0x0600B87A RID: 47226 RVA: 0x0027F614 File Offset: 0x0027D814
[Token(Token = "0x600B87A")]
[Address(RVA = "0x22DDE90", Offset = "0x22DCE90", VA = "0x1822DDE90", Slot = "7")]
public void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
{
byte b2;
byte b = this.CalculateByte(b2);
}
// Token: 0x0600B87B RID: 47227 RVA: 0x0027F630 File Offset: 0x0027D830
[Token(Token = "0x600B87B")]
[Address(RVA = "0x22DD7E0", Offset = "0x22DC7E0", VA = "0x1822DD7E0")]
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: 0x0600B87C RID: 47228 RVA: 0x0027F6E4 File Offset: 0x0027D8E4
[Token(Token = "0x600B87C")]
[Address(RVA = "0x22DDBC0", Offset = "0x22DCBC0", VA = "0x1822DDBC0", 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: 0x0600B87D RID: 47229 RVA: 0x0027F738 File Offset: 0x0027D938
[Token(Token = "0x600B87D")]
[Address(RVA = "0x22DDFF0", Offset = "0x22DCFF0", VA = "0x1822DDFF0", 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: 0x0600B87E RID: 47230 RVA: 0x0027F774 File Offset: 0x0027D974
[Token(Token = "0x600B87E")]
[Address(RVA = "0x22DE1D0", Offset = "0x22DD1D0", VA = "0x1822DE1D0")]
private void incrementCounterAt(int pos)
{
byte[] array = this.ofbV;
if (pos < array.Length && pos == array.Length)
{
byte[] array2 = this.ofbV;
}
}
// Token: 0x0600B87F RID: 47231 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B87F")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0")]
private void checkCounter()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x04007464 RID: 29796
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007464")]
private byte[] IV;
// Token: 0x04007465 RID: 29797
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007465")]
private byte[] ofbV;
// Token: 0x04007466 RID: 29798
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4007466")]
private byte[] ofbOutV;
// Token: 0x04007467 RID: 29799
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4007467")]
private bool initialised;
// Token: 0x04007468 RID: 29800
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4007468")]
private int byteCount;
// Token: 0x04007469 RID: 29801
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4007469")]
private readonly int blockSize;
// Token: 0x0400746A RID: 29802
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400746A")]
private readonly IBlockCipher cipher;
}
}