Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Modes/OpenPgpCfbBlockCipher.cs
T
2026-04-08 23:40:05 +02:00

342 lines
8.7 KiB
C#

using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
{
// Token: 0x02001662 RID: 5730
[Token(Token = "0x2001662")]
[StructLayout(3)]
public class OpenPgpCfbBlockCipher : IBlockCipher
{
// Token: 0x060098FA RID: 39162 RVA: 0x0021FD34 File Offset: 0x0021DF34
[Token(Token = "0x60098FA")]
[Address(RVA = "0x1DDC8D0", Offset = "0x1DDB2D0", VA = "0x181DDC8D0")]
public OpenPgpCfbBlockCipher(IBlockCipher cipher)
{
this.cipher = cipher;
byte[] array = new byte[0];
int num = this.blockSize;
this.IV = array;
byte[] array2 = new byte[num];
int num2 = this.blockSize;
this.FR = array2;
byte[] array3 = new byte[num2];
this.FRE = array3;
}
// Token: 0x060098FB RID: 39163 RVA: 0x0021FD90 File Offset: 0x0021DF90
[Token(Token = "0x60098FB")]
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
public IBlockCipher GetUnderlyingCipher()
{
return this.cipher;
}
// Token: 0x17001884 RID: 6276
// (get) Token: 0x060098FC RID: 39164 RVA: 0x0021FDA4 File Offset: 0x0021DFA4
[Token(Token = "0x17001884")]
public string AlgorithmName
{
[Token(Token = "0x60098FC")]
[Address(RVA = "0x1DDC970", Offset = "0x1DDB370", VA = "0x181DDC970", Slot = "4")]
get
{
IBlockCipher blockCipher = this.cipher;
return 0 + "/OpenPGPCFB";
}
}
// Token: 0x17001885 RID: 6277
// (get) Token: 0x060098FD RID: 39165 RVA: 0x0021FDCC File Offset: 0x0021DFCC
[Token(Token = "0x17001885")]
public bool IsPartialBlockOkay
{
[Token(Token = "0x60098FD")]
[Address(RVA = "0x4405A0", Offset = "0x43EFA0", VA = "0x1804405A0", Slot = "7")]
get
{
return true;
}
}
// Token: 0x060098FE RID: 39166 RVA: 0x0021FDDC File Offset: 0x0021DFDC
[Token(Token = "0x60098FE")]
[Address(RVA = "0x1DDC5A0", Offset = "0x1DDAFA0", VA = "0x181DDC5A0", Slot = "6")]
public int GetBlockSize()
{
IBlockCipher blockCipher = this.cipher;
throw new NullReferenceException();
}
// Token: 0x060098FF RID: 39167 RVA: 0x0021FDF8 File Offset: 0x0021DFF8
[Token(Token = "0x60098FF")]
[Address(RVA = "0x1DDC820", Offset = "0x1DDB220", VA = "0x181DDC820", Slot = "8")]
public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
{
if (this.forEncryption)
{
int num;
return num;
}
int num2;
return num2;
}
// Token: 0x06009900 RID: 39168 RVA: 0x0021FE14 File Offset: 0x0021E014
[Token(Token = "0x6009900")]
[Address(RVA = "0x1DDC850", Offset = "0x1DDB250", VA = "0x181DDC850", Slot = "9")]
public void Reset()
{
byte[] fr = this.FR;
int num = 0;
this.count = num;
byte[] iv = this.IV;
int num2 = 0;
int num3 = 0;
int length = fr.Length;
Array.Copy(iv, num3, fr, num2, length);
IBlockCipher blockCipher = this.cipher;
throw new NullReferenceException();
}
// Token: 0x06009901 RID: 39169 RVA: 0x0021FE60 File Offset: 0x0021E060
[Token(Token = "0x6009901")]
[Address(RVA = "0x1DDC5F0", Offset = "0x1DDAFF0", VA = "0x181DDC5F0", Slot = "5")]
public void Init(bool forEncryption, ICipherParameters parameters)
{
int num;
do
{
num = 0;
this.forEncryption = forEncryption;
if (parameters == 0 || parameters == 0)
{
goto IL_46;
}
}
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_46:
byte[] fr = this.FR;
this.count = num;
int length3 = fr.Length;
int num4 = 0;
byte[] iv2 = this.IV;
int num5 = 0;
Array.Copy(iv2, num5, fr, num4, length3);
IBlockCipher blockCipher = this.cipher;
IBlockCipher blockCipher2 = this.cipher;
}
// Token: 0x06009902 RID: 39170 RVA: 0x0021FF00 File Offset: 0x0021E100
[Token(Token = "0x6009902")]
[Address(RVA = "0x1DDC560", Offset = "0x1DDAF60", VA = "0x181DDC560")]
private byte EncryptByte(byte data, int blockOff)
{
byte[] fre = this.FRE;
byte b;
return b;
}
// Token: 0x06009903 RID: 39171 RVA: 0x0021FF1C File Offset: 0x0021E11C
[Token(Token = "0x6009903")]
[Address(RVA = "0x1DDBEB0", Offset = "0x1DDA8B0", VA = "0x181DDBEB0")]
private int EncryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff)
{
int num;
int num2;
byte[] fre5;
for (;;)
{
num = this.blockSize;
int length = input.Length;
int length2 = outBytes.Length;
num2 = this.count;
if (num2 != 0)
{
break;
}
IBlockCipher blockCipher = this.cipher;
byte[] fre = this.FRE;
int num3 = 0;
if (this.blockSize > 0)
{
byte[] fr = this.FR;
byte[] fre2 = this.FRE;
byte b = fre[input];
num3++;
int num4 = this.blockSize;
byte[] fr2 = this.FR;
byte[] fre3 = this.FRE;
num4 += -2;
byte b2;
fr2[0] = b2;
int num5 = inOff + 1;
byte[] fr3 = this.FR;
byte[] fre4 = this.FRE;
int num6 = this.blockSize;
byte b3;
fr3[0] = b3;
IBlockCipher blockCipher2 = this.cipher;
fre5 = this.FRE;
if (this.blockSize > 2)
{
goto Block_4;
}
}
}
if (num2 == num)
{
IBlockCipher blockCipher3 = this.cipher;
byte[] fre6 = this.FRE;
byte[] fre7 = this.FRE;
int num7 = inOff + 1;
byte[] fre8 = this.FRE;
int num8 = this.blockSize;
int num9 = 0;
byte[] fr4 = this.FR;
Array.Copy(fr4, 2, fr4, num9, num8);
IBlockCipher blockCipher4 = this.cipher;
byte[] fre9 = this.FRE;
if (this.blockSize > 2)
{
byte[] fr5 = this.FR;
byte[] fre10 = this.FRE;
byte b4;
fre9[0] = b4;
int num10 = this.blockSize;
}
}
return num;
Block_4:
byte[] fr6 = this.FR;
byte[] fre11 = this.FRE;
byte b5;
fre5[0] = b5;
int num11 = this.blockSize;
throw new NullReferenceException();
}
// Token: 0x06009904 RID: 39172 RVA: 0x002200B0 File Offset: 0x0021E2B0
[Token(Token = "0x6009904")]
[Address(RVA = "0x1DDB780", Offset = "0x1DDA180", VA = "0x181DDB780")]
private int DecryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff)
{
int num;
int num2;
byte[] fre5;
for (;;)
{
num = this.blockSize;
int length = input.Length;
num2 = this.count;
if (num2 != 0)
{
break;
}
IBlockCipher blockCipher = this.cipher;
byte[] fre = this.FRE;
int num3 = 0;
if (this.blockSize > 0)
{
byte[] fr = this.FR;
byte[] fre2 = this.FRE;
num3++;
int num4 = this.blockSize;
byte[] fr2 = this.FR;
byte[] fre3 = this.FRE;
int num5 = this.blockSize;
int num6 = inOff + 1;
byte[] fr3 = this.FR;
int num7 = this.blockSize;
byte[] fre4 = this.FRE;
int num8 = this.blockSize;
IBlockCipher blockCipher2 = this.cipher;
fre5 = this.FRE;
if (this.blockSize > 2)
{
goto Block_4;
}
}
}
if (num2 == num)
{
IBlockCipher blockCipher3 = this.cipher;
byte[] fre6 = this.FRE;
int length2 = input.Length;
int num9 = inOff + 1;
byte[] fre7 = this.FRE;
byte[] fre8 = this.FRE;
int num10 = 0;
int num11 = this.blockSize;
byte[] fr4 = this.FR;
Array.Copy(fr4, 2, fr4, num10, num11);
byte[] fr5 = this.FR;
int num12 = this.blockSize;
byte[] fr6 = this.FR;
int num13 = this.blockSize;
IBlockCipher blockCipher4 = this.cipher;
byte[] fre9 = this.FRE;
if (this.blockSize > 2)
{
byte[] fr7 = this.FR;
byte b = fre9[input];
fre9[0] = b;
byte[] fre10 = this.FRE;
int num14 = this.blockSize;
}
}
return num;
Block_4:
byte[] fr8 = this.FR;
byte b2 = fre5[input];
fre5[0] = b2;
byte[] fre11 = this.FRE;
int num15 = this.blockSize;
throw new NullReferenceException();
}
// Token: 0x0400648B RID: 25739
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x400648B")]
private byte[] IV;
// Token: 0x0400648C RID: 25740
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x400648C")]
private byte[] FR;
// Token: 0x0400648D RID: 25741
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400648D")]
private byte[] FRE;
// Token: 0x0400648E RID: 25742
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400648E")]
private readonly IBlockCipher cipher;
// Token: 0x0400648F RID: 25743
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x400648F")]
private readonly int blockSize;
// Token: 0x04006490 RID: 25744
[global::Cpp2IlInjected.FieldOffset(Offset = "0x34")]
[Token(Token = "0x4006490")]
private int count;
// Token: 0x04006491 RID: 25745
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006491")]
private bool forEncryption;
}
}