192 lines
5.0 KiB
C#
192 lines
5.0 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings
|
|
{
|
|
// Token: 0x02001D05 RID: 7429
|
|
[Token(Token = "0x2001D05")]
|
|
public class PaddedBufferedBlockCipher : BufferedBlockCipher
|
|
{
|
|
// Token: 0x0600B7AF RID: 47023 RVA: 0x0027B458 File Offset: 0x00279658
|
|
[Token(Token = "0x600B7AF")]
|
|
[Address(RVA = "0x22E2DF0", Offset = "0x22E1DF0", VA = "0x1822E2DF0")]
|
|
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: 0x0600B7B0 RID: 47024 RVA: 0x0027B498 File Offset: 0x00279698
|
|
[Token(Token = "0x600B7B0")]
|
|
[Address(RVA = "0x22E2E80", Offset = "0x22E1E80", VA = "0x1822E2E80")]
|
|
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: 0x0600B7B1 RID: 47025 RVA: 0x0027B4E0 File Offset: 0x002796E0
|
|
[Token(Token = "0x600B7B1")]
|
|
[Address(RVA = "0x22E2900", Offset = "0x22E1900", VA = "0x1822E2900", 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: 0x0600B7B2 RID: 47026 RVA: 0x0027B530 File Offset: 0x00279730
|
|
[Token(Token = "0x600B7B2")]
|
|
[Address(RVA = "0x22E2860", Offset = "0x22E1860", VA = "0x1822E2860", 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: 0x0600B7B3 RID: 47027 RVA: 0x0027B56C File Offset: 0x0027976C
|
|
[Token(Token = "0x600B7B3")]
|
|
[Address(RVA = "0x22E28C0", Offset = "0x22E18C0", VA = "0x1822E28C0", 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: 0x0600B7B4 RID: 47028 RVA: 0x0027B5A8 File Offset: 0x002797A8
|
|
[Token(Token = "0x600B7B4")]
|
|
[Address(RVA = "0x22E2AA0", Offset = "0x22E1AA0", VA = "0x1822E2AA0", 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: 0x0600B7B5 RID: 47029 RVA: 0x0027B5EC File Offset: 0x002797EC
|
|
[Token(Token = "0x600B7B5")]
|
|
[Address(RVA = "0x22E2B70", Offset = "0x22E1B70", VA = "0x1822E2B70", 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: 0x0600B7B6 RID: 47030 RVA: 0x0027B6A8 File Offset: 0x002798A8
|
|
[Token(Token = "0x600B7B6")]
|
|
[Address(RVA = "0x22E24C0", Offset = "0x22E14C0", VA = "0x1822E24C0", Slot = "36")]
|
|
public override int DoFinal(byte[] output, int outOff)
|
|
{
|
|
int num;
|
|
IBlockCipher cipher;
|
|
do
|
|
{
|
|
num = 0;
|
|
cipher = this.cipher;
|
|
IBlockCipher cipher2 = this.cipher;
|
|
byte[] buf = this.buf;
|
|
this.bufOff = num;
|
|
IBlockCipherPadding blockCipherPadding = this.padding;
|
|
if (num < cipher2)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
int num2 = 0;
|
|
byte[] buf2 = this.buf;
|
|
num2 += num2;
|
|
}
|
|
while (num != 0);
|
|
int bufOff = this.bufOff;
|
|
IBlockCipher cipher3 = this.cipher;
|
|
this.bufOff = num;
|
|
IBlockCipherPadding blockCipherPadding2 = this.padding;
|
|
if (num < cipher)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
IBlockCipher cipher4 = this.cipher;
|
|
num += num;
|
|
return num + num;
|
|
}
|
|
|
|
// Token: 0x040073F6 RID: 29686
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40073F6")]
|
|
private readonly IBlockCipherPadding padding;
|
|
}
|
|
}
|