Files
2026-06-04 11:42:34 +02:00

84 lines
2.2 KiB
C#

using System;
using System.Security.Cryptography;
namespace Mono.Security.Cryptography
{
// Token: 0x020000A3 RID: 163
internal class BlockProcessor
{
// Token: 0x060008EB RID: 2283 RVA: 0x00023098 File Offset: 0x00021298
public BlockProcessor(ICryptoTransform transform)
: this(transform, transform.InputBlockSize)
{
}
// Token: 0x060008EC RID: 2284 RVA: 0x000230A8 File Offset: 0x000212A8
public BlockProcessor(ICryptoTransform transform, int blockSize)
{
this.transform = transform;
this.blockSize = blockSize;
this.block = new byte[blockSize];
}
// Token: 0x060008ED RID: 2285 RVA: 0x000230D8 File Offset: 0x000212D8
~BlockProcessor()
{
Array.Clear(this.block, 0, this.blockSize);
}
// Token: 0x060008EE RID: 2286 RVA: 0x00023120 File Offset: 0x00021320
public void Initialize()
{
Array.Clear(this.block, 0, this.blockSize);
this.blockCount = 0;
}
// Token: 0x060008EF RID: 2287 RVA: 0x0002313C File Offset: 0x0002133C
public void Core(byte[] rgb)
{
this.Core(rgb, 0, rgb.Length);
}
// Token: 0x060008F0 RID: 2288 RVA: 0x0002314C File Offset: 0x0002134C
public void Core(byte[] rgb, int ib, int cb)
{
int num = Math.Min(this.blockSize - this.blockCount, cb);
Buffer.BlockCopy(rgb, ib, this.block, this.blockCount, num);
this.blockCount += num;
if (this.blockCount == this.blockSize)
{
this.transform.TransformBlock(this.block, 0, this.blockSize, this.block, 0);
int num2 = (cb - num) / this.blockSize;
for (int i = 0; i < num2; i++)
{
this.transform.TransformBlock(rgb, num + ib, this.blockSize, this.block, 0);
num += this.blockSize;
}
this.blockCount = cb - num;
if (this.blockCount > 0)
{
Buffer.BlockCopy(rgb, num + ib, this.block, 0, this.blockCount);
}
}
}
// Token: 0x060008F1 RID: 2289 RVA: 0x00023230 File Offset: 0x00021430
public byte[] Final()
{
return this.transform.TransformFinalBlock(this.block, 0, this.blockCount);
}
// Token: 0x040001DB RID: 475
private ICryptoTransform transform;
// Token: 0x040001DC RID: 476
private byte[] block;
// Token: 0x040001DD RID: 477
private int blockSize;
// Token: 0x040001DE RID: 478
private int blockCount;
}
}