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

250 lines
6.6 KiB
C#

using System;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
{
// Token: 0x02001D19 RID: 7449
[Token(Token = "0x2001D19")]
public class GOfbBlockCipher : IBlockCipher
{
// Token: 0x0600B845 RID: 47173 RVA: 0x0027E718 File Offset: 0x0027C918
[Token(Token = "0x600B845")]
[Address(RVA = "0x25B99D0", Offset = "0x25B89D0", VA = "0x1825B99D0")]
public GOfbBlockCipher(IBlockCipher cipher)
{
this.cipher = cipher;
byte[] array = new byte[0];
this.IV = array;
byte[] array2 = new byte[array];
this.ofbV = array2;
byte[] array3 = new byte[array2];
this.ofbOutV = array3;
}
// Token: 0x0600B846 RID: 47174 RVA: 0x0027E774 File Offset: 0x0027C974
[Token(Token = "0x600B846")]
[Address(RVA = "0x4157E0", Offset = "0x4147E0", VA = "0x1804157E0")]
public IBlockCipher GetUnderlyingCipher()
{
return this.cipher;
}
// Token: 0x0600B847 RID: 47175 RVA: 0x0027E788 File Offset: 0x0027C988
[Token(Token = "0x600B847")]
[Address(RVA = "0x25B9460", Offset = "0x25B8460", VA = "0x1825B9460", Slot = "5")]
public void Init(bool forEncryption, ICipherParameters parameters)
{
do
{
int num = 0;
this.firstStep = true;
this.N3 = num;
if (parameters == 0 || parameters == 0)
{
goto IL_4D;
}
}
while (parameters == 0);
byte[] iv = this.IV;
byte[] array;
int length = array.Length;
int length2 = iv.Length;
int num2 = 0;
int num3 = 0;
Array.Copy(array, num2, iv, num3, length2);
IL_4D:
byte[] iv2 = this.IV;
int length3 = iv2.Length;
int num4 = 0;
byte[] array2 = this.ofbV;
int num5 = 0;
Array.Copy(iv2, num5, array2, num4, length3);
IBlockCipher blockCipher = this.cipher;
if (parameters != 0)
{
IBlockCipher blockCipher2 = this.cipher;
}
}
// Token: 0x17001D19 RID: 7449
// (get) Token: 0x0600B848 RID: 47176 RVA: 0x0027E82C File Offset: 0x0027CA2C
[Token(Token = "0x17001D19")]
public string AlgorithmName
{
[Token(Token = "0x600B848")]
[Address(RVA = "0x25B9BB0", Offset = "0x25B8BB0", VA = "0x1825B9BB0", Slot = "4")]
get
{
IBlockCipher blockCipher = this.cipher;
return 0 + "/GCTR";
}
}
// Token: 0x17001D1A RID: 7450
// (get) Token: 0x0600B849 RID: 47177 RVA: 0x0027E854 File Offset: 0x0027CA54
[Token(Token = "0x17001D1A")]
public bool IsPartialBlockOkay
{
[Token(Token = "0x600B849")]
[Address(RVA = "0x4246A0", Offset = "0x4236A0", VA = "0x1804246A0", Slot = "7")]
get
{
return true;
}
}
// Token: 0x0600B84A RID: 47178 RVA: 0x0027E864 File Offset: 0x0027CA64
[Token(Token = "0x600B84A")]
[Address(RVA = "0x471180", Offset = "0x470180", VA = "0x180471180", Slot = "6")]
public int GetBlockSize()
{
return this.blockSize;
}
// Token: 0x0600B84B RID: 47179 RVA: 0x0027E878 File Offset: 0x0027CA78
[Token(Token = "0x600B84B")]
[Address(RVA = "0x25B9690", Offset = "0x25B8690", VA = "0x1825B9690", Slot = "8")]
public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
{
int num = 0;
if ((this.firstStep ? 1 : 0) != num)
{
IBlockCipher blockCipher = this.cipher;
this.firstStep = num != 0;
byte[] array = this.ofbOutV;
byte[] array2 = this.ofbOutV;
int num2 = 0;
int num3 = this.bytesToint(array2, num2);
byte[] array3 = this.ofbOutV;
this.N3 = num3;
int num4 = this.bytesToint(array3, 4);
this.N4 = num4;
}
int num5 = this.N3;
num5 += 16843009;
int num6 = this.N4;
this.N3 = num5;
if (num6 < 16843012 && num6 > 0)
{
num6++;
this.N4 = num6;
}
byte[] array4 = this.ofbV;
int num7 = 0;
this.intTobytes(num5, array4, num7);
byte[] array5 = this.ofbV;
int n = this.N4;
uint num8;
this.intTobytes(n, array5, (int)num8);
IBlockCipher blockCipher2 = this.cipher;
byte[] array6 = this.ofbOutV;
int num9;
if (this.blockSize > 0)
{
byte[] array7 = this.ofbOutV;
num9 = this.blockSize;
}
byte[] array8 = this.ofbV;
int num10 = array8.Length;
int num11 = 0;
num10 -= num9;
Array.Copy(array8, num9, array8, num11, num10);
byte[] array9 = this.ofbV;
int num12 = this.blockSize;
int num13 = 0;
int num14 = array9.Length;
byte[] array10 = this.ofbOutV;
num14 -= num12;
Array.Copy(array10, num13, array9, num14, num12);
return this.blockSize;
}
// Token: 0x0600B84C RID: 47180 RVA: 0x0027E9E8 File Offset: 0x0027CBE8
[Token(Token = "0x600B84C")]
[Address(RVA = "0x25B9960", Offset = "0x25B8960", VA = "0x1825B9960", Slot = "9")]
public void Reset()
{
byte[] iv = this.IV;
int length = iv.Length;
int num = 0;
byte[] array = this.ofbV;
int num2 = 0;
Array.Copy(iv, num2, array, num, length);
IBlockCipher blockCipher = this.cipher;
throw new NullReferenceException();
}
// Token: 0x0600B84D RID: 47181 RVA: 0x0027EA28 File Offset: 0x0027CC28
[Token(Token = "0x600B84D")]
[Address(RVA = "0x25B9AF0", Offset = "0x25B8AF0", VA = "0x1825B9AF0")]
private int bytesToint(byte[] inBytes, int inOff)
{
int length = inBytes.Length;
int num = inOff + 1;
byte b;
byte b2;
b += b2;
b += b2;
byte b3;
b += b3;
throw new NullReferenceException();
}
// Token: 0x0600B84E RID: 47182 RVA: 0x0027EA54 File Offset: 0x0027CC54
[Token(Token = "0x600B84E")]
[Address(RVA = "0x22DD6C0", Offset = "0x22DC6C0", VA = "0x1822DD6C0")]
private void intTobytes(int num, byte[] outBytes, int outOff)
{
int num2 = outOff + 1;
}
// Token: 0x04007448 RID: 29768
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007448")]
private byte[] IV;
// Token: 0x04007449 RID: 29769
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007449")]
private byte[] ofbV;
// Token: 0x0400744A RID: 29770
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400744A")]
private byte[] ofbOutV;
// Token: 0x0400744B RID: 29771
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x400744B")]
private readonly int blockSize;
// Token: 0x0400744C RID: 29772
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400744C")]
private readonly IBlockCipher cipher;
// Token: 0x0400744D RID: 29773
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400744D")]
private bool firstStep = true;
// Token: 0x0400744E RID: 29774
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x400744E")]
private int N3;
// Token: 0x0400744F RID: 29775
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x400744F")]
private int N4;
// Token: 0x04007450 RID: 29776
[Token(Token = "0x4007450")]
private const int C1 = 16843012;
// Token: 0x04007451 RID: 29777
[Token(Token = "0x4007451")]
private const int C2 = 16843009;
}
}