// Decompiled with JetBrains decompiler
// Type: .
// Assembly: WindowsBC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9909ee17073e3364
// MVID: 658BFC85-36E1-493D-98E6-AE9127D73D60
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Downloader.MSIL.BitCoinMiner.c-64f742a0b28b2c3d2a62ef6607fcfd5fa55b793a1aff3a6c11e014e3b119149e.exe

using \u000E;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography;

namespace \u0001\u0002
{
  internal sealed class \u0007\u0002 : IDisposable, ICryptoTransform
  {
    private int \u0001;
    private ICryptoTransform \u0002;
    private readonly byte[] \u0003;
    private byte[] \u0004;
    private int \u0005;
    private byte[] \u0006;
    private HMACSHA1 \u0007;
    private bool \u0008;
    private bool \u000E;

    public \u0007\u0002([In] string obj0, [In] byte[] obj1, [In] int obj2, [In] bool obj3)
    {
      if (obj2 != 16 && obj2 != 32)
        throw new Exception(\u0097\u0003.\u001D\u0002((object) \u0008.\u000E\u0003(1265), (object) obj2, (object) \u0008.\u000E\u0003(1290)));
      if (obj1.Length != obj2 / 2)
      {
        object[] objArray = new object[4]
        {
          (object) \u0008.\u000E\u0003(1319),
          (object) (obj2 / 2),
          (object) \u0008.\u000E\u0003(1356),
          (object) obj2
        };
        throw new Exception(\u008B\u0004.\u001E\u0002(objArray));
      }
      this.\u0001 = obj2;
      this.\u0004 = new byte[this.\u0001];
      this.\u0005 = 16;
      Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(obj0, obj1, 1000);
      RijndaelManaged rijndaelManaged = new RijndaelManaged();
      \u0092\u0004.\u007E\u0002\u0006((object) rijndaelManaged, CipherMode.ECB);
      this.\u0003 = new byte[this.\u0001];
      byte[] numArray = \u001C\u0004.\u007E\u0008\u0006((object) rfc2898DeriveBytes, this.\u0001);
      byte[] key = \u001C\u0004.\u007E\u0008\u0006((object) rfc2898DeriveBytes, this.\u0001);
      this.\u0002 = \u008E\u0003.\u007E\u0003\u0006((object) rijndaelManaged, numArray, key);
      this.\u0006 = \u001C\u0004.\u007E\u0008\u0006((object) rfc2898DeriveBytes, 2);
      this.\u0007 = new HMACSHA1(key);
      this.\u000E = obj3;
    }

    public int TransformBlock([In] byte[] obj0, [In] int obj1, [In] int obj2, [In] byte[] obj3, [In] int obj4)
    {
      if (!this.\u000E)
      {
        int num1 = \u0094\u0003.\u007E\u000F\u0006((object) this.\u0007, obj0, obj1, obj2, obj0, obj1);
      }
      for (int index1 = 0; index1 < obj2; ++index1)
      {
        if (this.\u0005 == 16)
        {
          int index2 = 0;
          while (++this.\u0003[index2] == (byte) 0)
            ++index2;
          int num2 = \u0094\u0003.\u007E\u0099\u0005((object) this.\u0002, this.\u0003, 0, this.\u0001, this.\u0004, 0);
          this.\u0005 = 0;
        }
        obj3[index1 + obj4] = (byte) ((int) obj0[index1 + obj1] ^ (int) this.\u0004[this.\u0005++]);
      }
      if (this.\u000E)
      {
        int num3 = \u0094\u0003.\u007E\u000F\u0006((object) this.\u0007, obj3, obj4, obj2, obj3, obj4);
      }
      return obj2;
    }

    [SpecialName]
    public byte[] \u009A\u0003() => this.\u0006;

    public byte[] \u009B\u0003()
    {
      if (!this.\u0008)
      {
        byte[] numArray1 = new byte[0];
        byte[] numArray2 = \u0081\u0003.\u007E\u0010\u0006((object) this.\u0007, numArray1, 0, 0);
        this.\u0008 = true;
      }
      return \u008A\u0005.\u007E\u000E\u0006((object) this.\u0007);
    }

    public byte[] TransformFinalBlock([In] byte[] obj0, [In] int obj1, [In] int obj2) => throw new NotImplementedException(\u0008.\u000E\u0003(1377));

    [SpecialName]
    public int get_InputBlockSize() => this.\u0001;

    [SpecialName]
    public int get_OutputBlockSize() => this.\u0001;

    [SpecialName]
    public bool get_CanTransformMultipleBlocks() => true;

    [SpecialName]
    public bool get_CanReuseTransform() => true;

    public void Dispose() => \u0093\u0003.\u007E\u009E((object) this.\u0002);
  }
}
