186 lines
4.9 KiB
C#
186 lines
4.9 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings
|
|
{
|
|
// Token: 0x02001C25 RID: 7205
|
|
[Token(Token = "0x2001C25")]
|
|
public class PaddedBufferedBlockCipher : BufferedBlockCipher
|
|
{
|
|
// Token: 0x0600B3E1 RID: 46049 RVA: 0x00272298 File Offset: 0x00270498
|
|
[Token(Token = "0x600B3E1")]
|
|
[Address(RVA = "0x1810890", Offset = "0x180F690", VA = "0x181810890")]
|
|
public PaddedBufferedBlockCipher(IBlockCipher cipher, IBlockCipherPadding padding)
|
|
{
|
|
this.cipher = cipher;
|
|
this.padding = padding;
|
|
byte[] array = new byte[0];
|
|
this.buf = array;
|
|
this.bufOff = (int)((ulong)0L);
|
|
}
|
|
|
|
// Token: 0x0600B3E2 RID: 46050 RVA: 0x002722D8 File Offset: 0x002704D8
|
|
[Token(Token = "0x600B3E2")]
|
|
[Address(RVA = "0x1810920", Offset = "0x180F720", VA = "0x181810920")]
|
|
public PaddedBufferedBlockCipher(IBlockCipher cipher)
|
|
{
|
|
int num = 0;
|
|
Pkcs7Padding pkcs7Padding;
|
|
pkcs7Padding.Init(num);
|
|
base..ctor();
|
|
this.cipher = cipher;
|
|
this.padding = pkcs7Padding;
|
|
byte[] array = new byte[pkcs7Padding];
|
|
this.buf = array;
|
|
this.bufOff = (int)((ulong)0L);
|
|
}
|
|
|
|
// Token: 0x0600B3E3 RID: 46051 RVA: 0x00272320 File Offset: 0x00270520
|
|
[Token(Token = "0x600B3E3")]
|
|
[Address(RVA = "0x18103A0", Offset = "0x180F1A0", VA = "0x1818103A0", Slot = "23")]
|
|
public override void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
this.forEncryption = forEncryption;
|
|
}
|
|
while (parameters != 0 && parameters != 0 && parameters == 0);
|
|
IBlockCipherPadding blockCipherPadding = this.padding;
|
|
num += num;
|
|
num++;
|
|
IBlockCipher cipher = this.cipher;
|
|
}
|
|
|
|
// Token: 0x0600B3E4 RID: 46052 RVA: 0x00272370 File Offset: 0x00270570
|
|
[Token(Token = "0x600B3E4")]
|
|
[Address(RVA = "0x1810300", Offset = "0x180F100", VA = "0x181810300", Slot = "25")]
|
|
public override int GetOutputSize(int length)
|
|
{
|
|
int num = this.bufOff;
|
|
byte[] buf = this.buf;
|
|
num += length;
|
|
int num2 = buf.Length;
|
|
if (length != 0)
|
|
{
|
|
num2 -= length;
|
|
return num;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x0600B3E5 RID: 46053 RVA: 0x002723AC File Offset: 0x002705AC
|
|
[Token(Token = "0x600B3E5")]
|
|
[Address(RVA = "0x1810360", Offset = "0x180F160", VA = "0x181810360", Slot = "26")]
|
|
public override int GetUpdateOutputSize(int length)
|
|
{
|
|
byte[] buf = this.buf;
|
|
int num = this.bufOff;
|
|
int length2 = buf.Length;
|
|
num += length;
|
|
if (length != 0)
|
|
{
|
|
return num - length;
|
|
}
|
|
return num - length2;
|
|
}
|
|
|
|
// Token: 0x0600B3E6 RID: 46054 RVA: 0x002723E8 File Offset: 0x002705E8
|
|
[Token(Token = "0x600B3E6")]
|
|
[Address(RVA = "0x1810540", Offset = "0x180F340", VA = "0x181810540", Slot = "28")]
|
|
public override int ProcessByte(byte input, byte[] output, int outOff)
|
|
{
|
|
byte[] buf = this.buf;
|
|
int num = 0;
|
|
int bufOff = this.bufOff;
|
|
if (bufOff == buf.Length)
|
|
{
|
|
IBlockCipher cipher = this.cipher;
|
|
}
|
|
int num2 = bufOff + 1;
|
|
this.bufOff = num2;
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x0600B3E7 RID: 46055 RVA: 0x0027242C File Offset: 0x0027062C
|
|
[Token(Token = "0x600B3E7")]
|
|
[Address(RVA = "0x1810610", Offset = "0x180F410", VA = "0x181810610", Slot = "32")]
|
|
public override int ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff)
|
|
{
|
|
int num = this.GetOutputSize(length);
|
|
if (num > 0)
|
|
{
|
|
}
|
|
byte[] buf = this.buf;
|
|
int num2 = buf.Length;
|
|
int bufOff = this.bufOff;
|
|
num2 -= bufOff;
|
|
byte[] buf3;
|
|
int bufOff2;
|
|
if (length > num2)
|
|
{
|
|
Array.Copy(input, inOff, buf, bufOff, num2);
|
|
IBlockCipher cipher = this.cipher;
|
|
byte[] buf2 = this.buf;
|
|
int num3 = 0;
|
|
this.bufOff = num3;
|
|
if (length > buf2.Length)
|
|
{
|
|
IBlockCipher cipher2 = this.cipher;
|
|
if (num3 < buf2)
|
|
{
|
|
num3 += num3;
|
|
num3++;
|
|
}
|
|
buf3 = this.buf;
|
|
num += num3;
|
|
uint num4;
|
|
num4 += num4;
|
|
}
|
|
bufOff2 = this.bufOff;
|
|
}
|
|
Array.Copy(input, inOff, buf3, bufOff2, length);
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x0600B3E8 RID: 46056 RVA: 0x002724E8 File Offset: 0x002706E8
|
|
[Token(Token = "0x600B3E8")]
|
|
[Address(RVA = "0x180FFD0", Offset = "0x180EDD0", VA = "0x18180FFD0", Slot = "36")]
|
|
public override int DoFinal(byte[] output, int outOff)
|
|
{
|
|
int num;
|
|
do
|
|
{
|
|
num = 0;
|
|
IBlockCipher cipher = this.cipher;
|
|
IBlockCipher cipher2 = this.cipher;
|
|
byte[] buf = this.buf;
|
|
this.bufOff = num;
|
|
IBlockCipherPadding blockCipherPadding = this.padding;
|
|
byte[] buf2 = this.buf;
|
|
if (num < cipher2)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
int num2 = 0;
|
|
byte[] buf3 = this.buf;
|
|
num2 += num2;
|
|
}
|
|
while (num != 0);
|
|
int bufOff = this.bufOff;
|
|
IBlockCipher cipher3 = this.cipher;
|
|
this.bufOff = num;
|
|
IBlockCipherPadding blockCipherPadding2 = this.padding;
|
|
IBlockCipher cipher4 = this.cipher;
|
|
return num + 0;
|
|
}
|
|
|
|
// Token: 0x0400723D RID: 29245
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400723D")]
|
|
private readonly IBlockCipherPadding padding;
|
|
}
|
|
}
|