789 lines
24 KiB
C#
789 lines
24 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
|
{
|
|
// Token: 0x02001CE3 RID: 7395
|
|
[Token(Token = "0x2001CE3")]
|
|
public class Gost3411Digest : IDigest, IMemoable
|
|
{
|
|
// Token: 0x0600BA3C RID: 47676 RVA: 0x0029EC54 File Offset: 0x0029CE54
|
|
[Token(Token = "0x600BA3C")]
|
|
[Address(RVA = "0x1B3DA60", Offset = "0x1B3C860", VA = "0x181B3DA60")]
|
|
private static byte[][] MakeC()
|
|
{
|
|
byte[][] array = new byte[4][];
|
|
int num = 0;
|
|
byte[] array2 = new byte[32];
|
|
if (array2 != 0)
|
|
{
|
|
}
|
|
num++;
|
|
array[0] = array2;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600BA3D RID: 47677 RVA: 0x0029EC8C File Offset: 0x0029CE8C
|
|
[Token(Token = "0x600BA3D")]
|
|
[Address(RVA = "0x1B3E2A0", Offset = "0x1B3D0A0", VA = "0x181B3E2A0")]
|
|
public Gost3411Digest()
|
|
{
|
|
byte[] array = new byte[32];
|
|
this.H = array;
|
|
byte[] array2 = new byte[32];
|
|
this.L = array2;
|
|
byte[] array3 = new byte[32];
|
|
this.M = array3;
|
|
byte[] array4 = new byte[32];
|
|
this.Sum = array4;
|
|
byte[][] array5 = Gost3411Digest.MakeC();
|
|
this.C = array5;
|
|
byte[] array6 = new byte[32];
|
|
this.xBuf = array6;
|
|
Gost28147Engine gost28147Engine = new Gost28147Engine();
|
|
this.cipher = gost28147Engine;
|
|
byte[] array7 = new byte[32];
|
|
this.K = array7;
|
|
byte[] array8 = new byte[8];
|
|
this.a = array8;
|
|
short[] array9 = new short[16];
|
|
this.wS = array9;
|
|
short[] array10 = new short[16];
|
|
this.w_S = array10;
|
|
byte[] array11 = new byte[32];
|
|
this.S = array11;
|
|
byte[] array12 = new byte[32];
|
|
this.U = array12;
|
|
byte[] array13 = new byte[32];
|
|
this.V = array13;
|
|
byte[] array14 = new byte[32];
|
|
this.W = array14;
|
|
base..ctor();
|
|
byte[] sbox = Gost28147Engine.GetSBox("D-A");
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.sBox = sbox;
|
|
int num;
|
|
ParametersWithSBox parametersWithSBox = new ParametersWithSBox(num, sbox);
|
|
num = 0;
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x0600BA3E RID: 47678 RVA: 0x0029EDCC File Offset: 0x0029CFCC
|
|
[Token(Token = "0x600BA3E")]
|
|
[Address(RVA = "0x1B3E6A0", Offset = "0x1B3D4A0", VA = "0x181B3E6A0")]
|
|
public Gost3411Digest(byte[] sBoxParam)
|
|
{
|
|
byte[] array = new byte[32];
|
|
this.H = array;
|
|
byte[] array2 = new byte[32];
|
|
this.L = array2;
|
|
byte[] array3 = new byte[32];
|
|
this.M = array3;
|
|
byte[] array4 = new byte[32];
|
|
this.Sum = array4;
|
|
byte[][] array5 = Gost3411Digest.MakeC();
|
|
this.C = array5;
|
|
byte[] array6 = new byte[32];
|
|
this.xBuf = array6;
|
|
Gost28147Engine gost28147Engine = new Gost28147Engine();
|
|
this.cipher = gost28147Engine;
|
|
byte[] array7 = new byte[32];
|
|
this.K = array7;
|
|
byte[] array8 = new byte[8];
|
|
this.a = array8;
|
|
short[] array9 = new short[16];
|
|
this.wS = array9;
|
|
short[] array10 = new short[16];
|
|
this.w_S = array10;
|
|
byte[] array11 = new byte[32];
|
|
this.S = array11;
|
|
byte[] array12 = new byte[32];
|
|
this.U = array12;
|
|
byte[] array13 = new byte[32];
|
|
this.V = array13;
|
|
byte[] array14 = new byte[32];
|
|
this.W = array14;
|
|
base..ctor();
|
|
byte[] array15 = Arrays.Clone(sBoxParam);
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.sBox = array15;
|
|
int num;
|
|
ParametersWithSBox parametersWithSBox = new ParametersWithSBox(num, array15);
|
|
num = 0;
|
|
this.Reset();
|
|
}
|
|
|
|
// Token: 0x0600BA3F RID: 47679 RVA: 0x0029EF08 File Offset: 0x0029D108
|
|
[Token(Token = "0x600BA3F")]
|
|
[Address(RVA = "0x1B3E4E0", Offset = "0x1B3D2E0", VA = "0x181B3E4E0")]
|
|
public Gost3411Digest(Gost3411Digest t)
|
|
{
|
|
byte[] array = new byte[32];
|
|
this.H = array;
|
|
byte[] array2 = new byte[32];
|
|
this.L = array2;
|
|
byte[] array3 = new byte[32];
|
|
this.M = array3;
|
|
byte[] array4 = new byte[32];
|
|
this.Sum = array4;
|
|
byte[][] array5 = Gost3411Digest.MakeC();
|
|
this.C = array5;
|
|
byte[] array6 = new byte[32];
|
|
this.xBuf = array6;
|
|
Gost28147Engine gost28147Engine = new Gost28147Engine();
|
|
this.cipher = gost28147Engine;
|
|
byte[] array7 = new byte[32];
|
|
this.K = array7;
|
|
byte[] array8 = new byte[8];
|
|
this.a = array8;
|
|
short[] array9 = new short[16];
|
|
this.wS = array9;
|
|
short[] array10 = new short[16];
|
|
this.w_S = array10;
|
|
byte[] array11 = new byte[32];
|
|
this.S = array11;
|
|
byte[] array12 = new byte[32];
|
|
this.U = array12;
|
|
byte[] array13 = new byte[32];
|
|
this.V = array13;
|
|
byte[] array14 = new byte[32];
|
|
this.W = array14;
|
|
base..ctor();
|
|
this.Reset(t);
|
|
}
|
|
|
|
// Token: 0x17001D0B RID: 7435
|
|
// (get) Token: 0x0600BA40 RID: 47680 RVA: 0x0029F018 File Offset: 0x0029D218
|
|
[Token(Token = "0x17001D0B")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600BA40")]
|
|
[Address(RVA = "0x1B3EE50", Offset = "0x1B3DC50", VA = "0x181B3EE50", Slot = "4")]
|
|
get
|
|
{
|
|
return "Gost3411";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA41 RID: 47681 RVA: 0x0029F02C File Offset: 0x0029D22C
|
|
[Token(Token = "0x600BA41")]
|
|
[Address(RVA = "0x55EA70", Offset = "0x55D870", VA = "0x18055EA70", Slot = "5")]
|
|
public int GetDigestSize()
|
|
{
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BA42 RID: 47682 RVA: 0x0029F03C File Offset: 0x0029D23C
|
|
[Token(Token = "0x600BA42")]
|
|
[Address(RVA = "0x1B3E1C0", Offset = "0x1B3CFC0", VA = "0x181B3E1C0", Slot = "7")]
|
|
public void Update(byte input)
|
|
{
|
|
byte[] array = this.xBuf;
|
|
int num = this.xBufOff + 1;
|
|
this.xBufOff = num;
|
|
byte[] array2 = this.xBuf;
|
|
int length = array2.Length;
|
|
if (this.xBufOff == length)
|
|
{
|
|
this.sumByteArray(array2);
|
|
byte[] array3 = this.xBuf;
|
|
int num2 = 0;
|
|
this.processBlock(array3, num2);
|
|
this.xBufOff = (int)((ulong)0L);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA43 RID: 47683 RVA: 0x0029F0A4 File Offset: 0x0029D2A4
|
|
[Token(Token = "0x600BA43")]
|
|
[Address(RVA = "0x1B3D330", Offset = "0x1B3C130", VA = "0x181B3D330", Slot = "8")]
|
|
public void BlockUpdate(byte[] input, int inOff, int length)
|
|
{
|
|
int num = 0;
|
|
int num2 = this.xBufOff;
|
|
if (num2 != 0 && length > 0)
|
|
{
|
|
byte[] array = this.xBuf;
|
|
int num3 = num2 + 1;
|
|
this.xBufOff = num3;
|
|
byte[] array2 = this.xBuf;
|
|
int num4 = this.xBufOff;
|
|
if (num4 == array2.Length)
|
|
{
|
|
this.sumByteArray(array2);
|
|
byte[] array3 = this.xBuf;
|
|
int num5 = 0;
|
|
this.processBlock(array3, num5);
|
|
this.xBufOff = num;
|
|
}
|
|
while (num4 != 0)
|
|
{
|
|
}
|
|
}
|
|
byte[] array4 = this.xBuf;
|
|
if (length > array4.Length)
|
|
{
|
|
int length2 = array4.Length;
|
|
int num6 = 0;
|
|
Array.Copy(input, inOff, array4, num6, length2);
|
|
byte[] array5 = this.xBuf;
|
|
int length3 = this.Sum.Length;
|
|
if (num != length3)
|
|
{
|
|
byte b;
|
|
num += (int)b;
|
|
byte b2;
|
|
num += (int)b2;
|
|
num++;
|
|
}
|
|
byte[] array6 = this.xBuf;
|
|
int num7 = 0;
|
|
this.processBlock(array6, num7);
|
|
int length4 = this.xBuf.Length;
|
|
}
|
|
if (length > 0)
|
|
{
|
|
int num8 = this.xBufOff;
|
|
byte[] array7 = this.xBuf;
|
|
int num9 = num8 + 1;
|
|
this.xBufOff = num9;
|
|
int length5 = this.xBuf.Length;
|
|
if (this.xBufOff == length5)
|
|
{
|
|
int length6 = this.Sum.Length;
|
|
if (num != length6)
|
|
{
|
|
byte b3;
|
|
num += (int)b3;
|
|
byte b4;
|
|
num += (int)b4;
|
|
num++;
|
|
}
|
|
byte[] array8 = this.xBuf;
|
|
int num10 = 0;
|
|
this.processBlock(array8, num10);
|
|
this.xBufOff = num;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA44 RID: 47684 RVA: 0x0029F210 File Offset: 0x0029D410
|
|
[Token(Token = "0x600BA44")]
|
|
[Address(RVA = "0x1B3DB20", Offset = "0x1B3C920", VA = "0x181B3DB20")]
|
|
private byte[] P(byte[] input)
|
|
{
|
|
int num = 0;
|
|
byte[] k = this.K;
|
|
byte[] k2 = this.K;
|
|
byte[] k3 = this.K;
|
|
num += 2;
|
|
byte[] k4 = this.K;
|
|
num++;
|
|
return this.K;
|
|
}
|
|
|
|
// Token: 0x0600BA45 RID: 47685 RVA: 0x0029F254 File Offset: 0x0029D454
|
|
[Token(Token = "0x600BA45")]
|
|
[Address(RVA = "0x1B3D240", Offset = "0x1B3C040", VA = "0x181B3D240")]
|
|
private byte[] A(byte[] input)
|
|
{
|
|
int num = 0;
|
|
int length = input.Length;
|
|
byte[] array = this.a;
|
|
byte b = input[num];
|
|
num++;
|
|
int num2 = 0;
|
|
ulong num3;
|
|
Array.Copy(input, 8, input, num2, (int)num3);
|
|
byte[] array2 = this.a;
|
|
int num4 = 0;
|
|
ulong num5;
|
|
Array.Copy(array2, num4, input, 24, (int)num5);
|
|
return input;
|
|
}
|
|
|
|
// Token: 0x0600BA46 RID: 47686 RVA: 0x0029F2AC File Offset: 0x0029D4AC
|
|
[Token(Token = "0x600BA46")]
|
|
[Address(RVA = "0x1B3D980", Offset = "0x1B3C780", VA = "0x181B3D980")]
|
|
private void E(byte[] key, byte[] s, int sOff, byte[] input, int inOff)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
KeyParameter keyParameter = new KeyParameter(key);
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600BA47 RID: 47687 RVA: 0x0029F2D4 File Offset: 0x0029D4D4
|
|
[Token(Token = "0x600BA47")]
|
|
[Address(RVA = "0x1B3EB30", Offset = "0x1B3D930", VA = "0x181B3EB30")]
|
|
private void fw(byte[] input)
|
|
{
|
|
short[] array = this.wS;
|
|
int num = 0;
|
|
int num2 = input.Length;
|
|
num2 -= input;
|
|
if (num < num2)
|
|
{
|
|
num++;
|
|
num += 2;
|
|
byte b;
|
|
array[0] = (short)b;
|
|
}
|
|
short[] array2 = this.wS;
|
|
short[] array3 = this.w_S;
|
|
int length = array2.Length;
|
|
short num3 = array2[3];
|
|
int num4 = 0;
|
|
array3[3] = num3;
|
|
short[] array4 = this.w_S;
|
|
ulong num5;
|
|
Array.Copy(this.wS, 1, array4, num4, (int)num5);
|
|
short[] array5 = this.w_S;
|
|
int num6 = input.Length;
|
|
num6--;
|
|
if (num < num6)
|
|
{
|
|
short num7 = array5[num];
|
|
num++;
|
|
num += 2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA48 RID: 47688 RVA: 0x0029F388 File Offset: 0x0029D588
|
|
[Token(Token = "0x600BA48")]
|
|
[Address(RVA = "0x1B3EE80", Offset = "0x1B3DC80", VA = "0x181B3EE80")]
|
|
private void processBlock(byte[] input, int inOff)
|
|
{
|
|
byte[] m = this.M;
|
|
int num = 0;
|
|
int num2 = 0;
|
|
ulong num3;
|
|
Array.Copy(input, inOff, m, num2, (int)num3);
|
|
byte[] h = this.H;
|
|
byte[] u = this.U;
|
|
byte[] m2 = this.M;
|
|
byte[] v = this.V;
|
|
byte[] u2 = this.U;
|
|
byte[] v2 = this.V;
|
|
byte[] w = this.W;
|
|
num++;
|
|
byte[] w2 = this.W;
|
|
byte[] array = this.P(w2);
|
|
byte[] h2 = this.H;
|
|
int num4 = 0;
|
|
byte[] s = this.S;
|
|
this.E(array, s, num4, h2, num);
|
|
byte[] u3 = this.U;
|
|
byte[] array2 = this.A(u3);
|
|
uint num5;
|
|
byte[] array3 = this.C[(int)num5];
|
|
byte[] u4 = this.U;
|
|
num++;
|
|
byte[] v3 = this.V;
|
|
byte[] array4 = this.A(v3);
|
|
byte[] array5 = this.A(array4);
|
|
this.V = array5;
|
|
byte[] u5 = this.U;
|
|
byte[] v4 = this.V;
|
|
byte[] w3 = this.W;
|
|
num++;
|
|
byte[] w4 = this.W;
|
|
byte[] array6 = this.P(w4);
|
|
byte[] h3 = this.H;
|
|
byte[] s2 = this.S;
|
|
this.E(array6, s2, num, h3, num);
|
|
num5 += (uint)1;
|
|
byte[] s3 = this.S;
|
|
this.fw(s3);
|
|
byte[] s4 = this.S;
|
|
byte[] m3 = this.M;
|
|
num++;
|
|
byte[] s5 = this.S;
|
|
this.fw(s5);
|
|
byte[] h4 = this.H;
|
|
byte[] s6 = this.S;
|
|
num++;
|
|
byte[] s7 = this.S;
|
|
this.fw(s7);
|
|
while (num != 32)
|
|
{
|
|
}
|
|
byte[] h5 = this.H;
|
|
int length = h5.Length;
|
|
int num6 = 0;
|
|
byte[] s8 = this.S;
|
|
int num7 = 0;
|
|
Array.Copy(s8, num7, h5, num6, length);
|
|
}
|
|
|
|
// Token: 0x0600BA49 RID: 47689 RVA: 0x0029F558 File Offset: 0x0029D758
|
|
[Token(Token = "0x600BA49")]
|
|
[Address(RVA = "0x1B3EA60", Offset = "0x1B3D860", VA = "0x181B3EA60")]
|
|
private void finish()
|
|
{
|
|
ulong num = this.byteCount;
|
|
byte[] l = this.L;
|
|
Pack.UInt64_To_LE(num, l);
|
|
int num2 = this.xBufOff;
|
|
if (num2 != 0)
|
|
{
|
|
int num3 = 0;
|
|
byte[] array = this.xBuf;
|
|
int num4 = num2 + 1;
|
|
this.xBufOff = num4;
|
|
byte[] array2 = this.xBuf;
|
|
int num5 = this.xBufOff;
|
|
if (num5 == array2.Length)
|
|
{
|
|
this.sumByteArray(array2);
|
|
byte[] array3 = this.xBuf;
|
|
int num6 = 0;
|
|
this.processBlock(array3, num6);
|
|
this.xBufOff = num3;
|
|
}
|
|
while (num5 != 0)
|
|
{
|
|
}
|
|
}
|
|
byte[] l2 = this.L;
|
|
int num7 = 0;
|
|
this.processBlock(l2, num7);
|
|
byte[] sum = this.Sum;
|
|
int num8 = 0;
|
|
this.processBlock(sum, num8);
|
|
}
|
|
|
|
// Token: 0x0600BA4A RID: 47690 RVA: 0x0029F614 File Offset: 0x0029D814
|
|
[Token(Token = "0x600BA4A")]
|
|
[Address(RVA = "0x1B3D860", Offset = "0x1B3C660", VA = "0x181B3D860", Slot = "9")]
|
|
public int DoFinal(byte[] output, int outOff)
|
|
{
|
|
ulong num = this.byteCount;
|
|
byte[] l = this.L;
|
|
Pack.UInt64_To_LE(num, l);
|
|
int num2 = this.xBufOff;
|
|
if (num2 != 0)
|
|
{
|
|
int num3 = 0;
|
|
byte[] array = this.xBuf;
|
|
int num4 = num2 + 1;
|
|
this.xBufOff = num4;
|
|
byte[] array2 = this.xBuf;
|
|
int num5 = this.xBufOff;
|
|
if (num5 == array2.Length)
|
|
{
|
|
this.sumByteArray(array2);
|
|
byte[] array3 = this.xBuf;
|
|
int num6 = 0;
|
|
this.processBlock(array3, num6);
|
|
this.xBufOff = num3;
|
|
}
|
|
while (num5 != 0)
|
|
{
|
|
}
|
|
}
|
|
byte[] l2 = this.L;
|
|
int num7 = 0;
|
|
this.processBlock(l2, num7);
|
|
byte[] sum = this.Sum;
|
|
int num8 = 0;
|
|
this.processBlock(sum, num8);
|
|
byte[] h = this.H;
|
|
this.Reset();
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BA4B RID: 47691 RVA: 0x0029F6E0 File Offset: 0x0029D8E0
|
|
[Token(Token = "0x600BA4B")]
|
|
[Address(RVA = "0x1B3DCA0", Offset = "0x1B3CAA0", VA = "0x181B3DCA0", Slot = "10")]
|
|
public void Reset()
|
|
{
|
|
byte[] h = this.H;
|
|
int num = 0;
|
|
this.byteCount = (ulong)num;
|
|
this.xBufOff = num;
|
|
int length = h.Length;
|
|
int num2 = 0;
|
|
Array.Clear(h, num2, length);
|
|
byte[] l = this.L;
|
|
int length2 = l.Length;
|
|
int num3 = 0;
|
|
Array.Clear(l, num3, length2);
|
|
byte[] m = this.M;
|
|
int length3 = m.Length;
|
|
int num4 = 0;
|
|
Array.Clear(m, num4, length3);
|
|
byte[] array = this.C[1];
|
|
int length4 = array.Length;
|
|
int num5 = 0;
|
|
Array.Clear(array, num5, length4);
|
|
byte[] array2 = this.C[3];
|
|
int length5 = array2.Length;
|
|
int num6 = 0;
|
|
Array.Clear(array2, num6, length5);
|
|
byte[] sum = this.Sum;
|
|
int length6 = sum.Length;
|
|
int num7 = 0;
|
|
Array.Clear(sum, num7, length6);
|
|
byte[] array3 = this.xBuf;
|
|
int length7 = array3.Length;
|
|
int num8 = 0;
|
|
Array.Clear(array3, num8, length7);
|
|
byte[][] c = this.C;
|
|
byte[] c2 = Gost3411Digest.C2;
|
|
byte[] array4 = c[2];
|
|
}
|
|
|
|
// Token: 0x0600BA4C RID: 47692 RVA: 0x0029F800 File Offset: 0x0029DA00
|
|
[Token(Token = "0x600BA4C")]
|
|
[Address(RVA = "0x1B3F340", Offset = "0x1B3E140", VA = "0x181B3F340")]
|
|
private void sumByteArray(byte[] input)
|
|
{
|
|
int num = 0;
|
|
byte[] sum = this.Sum;
|
|
if (num != sum.Length)
|
|
{
|
|
num++;
|
|
byte b;
|
|
num += (int)b;
|
|
byte b2;
|
|
num += (int)b2;
|
|
byte[] sum2 = this.Sum;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA4D RID: 47693 RVA: 0x0029F83C File Offset: 0x0029DA3C
|
|
[Token(Token = "0x600BA4D")]
|
|
[Address(RVA = "0x1B3E8E0", Offset = "0x1B3D6E0", VA = "0x181B3E8E0")]
|
|
private static void cpyBytesToShort(byte[] S, short[] wS)
|
|
{
|
|
int num = 0;
|
|
int num2 = S.Length;
|
|
num2 -= wS;
|
|
if (num < num2)
|
|
{
|
|
num++;
|
|
num += 2;
|
|
byte b;
|
|
wS[0] = (short)b;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA4E RID: 47694 RVA: 0x0029F870 File Offset: 0x0029DA70
|
|
[Token(Token = "0x600BA4E")]
|
|
[Address(RVA = "0x1B3E990", Offset = "0x1B3D790", VA = "0x181B3E990")]
|
|
private static void cpyShortToBytes(short[] wS, byte[] S)
|
|
{
|
|
int num = 0;
|
|
int num2 = S.Length;
|
|
num2 -= S;
|
|
if (num < num2)
|
|
{
|
|
short num3 = wS[num];
|
|
num++;
|
|
num += 2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600BA4F RID: 47695 RVA: 0x0029F8A4 File Offset: 0x0029DAA4
|
|
[Token(Token = "0x600BA4F")]
|
|
[Address(RVA = "0x55EA70", Offset = "0x55D870", VA = "0x18055EA70", Slot = "6")]
|
|
public int GetByteLength()
|
|
{
|
|
return 32;
|
|
}
|
|
|
|
// Token: 0x0600BA50 RID: 47696 RVA: 0x0029F8B4 File Offset: 0x0029DAB4
|
|
[Token(Token = "0x600BA50")]
|
|
[Address(RVA = "0x1B3D670", Offset = "0x1B3C470", VA = "0x181B3D670", Slot = "11")]
|
|
public IMemoable Copy()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600BA50)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IMemoable BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests.Gost3411Digest::Copy()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:uint8[](var_1_07, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::H, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_1_07))
|
|
stloc:uint8[](var_2_16, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::L, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_2_16))
|
|
stloc:uint8[](var_3_25, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::M, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_3_25))
|
|
stloc:uint8[](var_4_34, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::Sum, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_4_34))
|
|
stloc:uint8[][](var_6_46, call:uint8[][](Gost3411Digest::MakeC))
|
|
stfld:uint8[][](Gost3411Digest::C, ldloc:Gost3411Digest(var_0), ldloc:uint8[][](var_6_46))
|
|
stloc:uint8[](var_7_57, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::xBuf, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_7_57))
|
|
stloc:Gost28147Engine(var_8_66, newobj:Gost28147Engine(Gost28147Engine::.ctor))
|
|
stfld:IBlockCipher(Gost3411Digest::cipher, ldloc:Gost3411Digest(var_0), ldloc:Gost28147Engine[exp:IBlockCipher](var_8_66))
|
|
stloc:uint8[](var_9_77, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::K, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_9_77))
|
|
stloc:uint8[](var_10_87, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(8)))
|
|
stfld:uint8[](Gost3411Digest::a, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_10_87))
|
|
stloc:int16[](var_11_98, newarr:int16[]([mscorlib]System.Int16, ldc.i4:int32(16)))
|
|
stfld:int16[](Gost3411Digest::wS, ldloc:Gost3411Digest(var_0), ldloc:int16[](var_11_98))
|
|
stloc:int16[](var_12_A9, newarr:int16[]([mscorlib]System.Int16, ldc.i4:int32(16)))
|
|
stfld:int16[](Gost3411Digest::w_S, ldloc:Gost3411Digest(var_0), ldloc:int16[](var_12_A9))
|
|
stloc:uint8[](var_13_BA, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::S, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_13_BA))
|
|
stloc:uint8[](var_14_CB, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::U, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_14_CB))
|
|
stloc:uint8[](var_15_DC, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::V, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_15_DC))
|
|
stloc:uint8[](var_16_ED, newarr:uint8[]([mscorlib]System.Byte, ldc.i4:int32(32)))
|
|
stfld:uint8[](Gost3411Digest::W, ldloc:Gost3411Digest(var_0), ldloc:uint8[](var_16_ED))
|
|
call:void(Gost3411Digest::Reset, ldloc:Gost3411Digest(var_0), ldloc:Gost3411Digest[exp:IMemoable](this))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600BA51 RID: 47697 RVA: 0x0029F9C0 File Offset: 0x0029DBC0
|
|
[Token(Token = "0x600BA51")]
|
|
[Address(RVA = "0x1B3DE60", Offset = "0x1B3CC60", VA = "0x181B3DE60", Slot = "12")]
|
|
public void Reset(IMemoable other)
|
|
{
|
|
while (other == 0)
|
|
{
|
|
}
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.sBox = other;
|
|
this.Reset();
|
|
byte[] l = this.L;
|
|
byte[] l2 = this.L;
|
|
byte[] l3 = this.L;
|
|
byte[] l4 = this.L;
|
|
byte[][] c = this.C;
|
|
byte b = l4[1];
|
|
byte[][] c2 = this.C;
|
|
byte[][] c3 = this.C;
|
|
this.xBufOff = c3;
|
|
this.byteCount = c3;
|
|
}
|
|
|
|
// Token: 0x0600BA52 RID: 47698 RVA: 0x0029FA44 File Offset: 0x0029DC44
|
|
// Note: this type is marked as 'beforefieldinit'.
|
|
[Token(Token = "0x600BA52")]
|
|
[Address(RVA = "0x1B3E240", Offset = "0x1B3D040", VA = "0x181B3E240")]
|
|
static Gost3411Digest()
|
|
{
|
|
byte[] array = new byte[32];
|
|
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.CC5B8B6FA17DA57B26C3ACA4DA8B2A477C609D63).FieldHandle);
|
|
Gost3411Digest.C2 = array;
|
|
}
|
|
|
|
// Token: 0x04007672 RID: 30322
|
|
[Token(Token = "0x4007672")]
|
|
private const int DIGEST_LENGTH = 32;
|
|
|
|
// Token: 0x04007673 RID: 30323
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4007673")]
|
|
private byte[] H;
|
|
|
|
// Token: 0x04007674 RID: 30324
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4007674")]
|
|
private byte[] L;
|
|
|
|
// Token: 0x04007675 RID: 30325
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4007675")]
|
|
private byte[] M;
|
|
|
|
// Token: 0x04007676 RID: 30326
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4007676")]
|
|
private byte[] Sum;
|
|
|
|
// Token: 0x04007677 RID: 30327
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4007677")]
|
|
private byte[][] C;
|
|
|
|
// Token: 0x04007678 RID: 30328
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4007678")]
|
|
private byte[] xBuf;
|
|
|
|
// Token: 0x04007679 RID: 30329
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4007679")]
|
|
private int xBufOff;
|
|
|
|
// Token: 0x0400767A RID: 30330
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x400767A")]
|
|
private ulong byteCount;
|
|
|
|
// Token: 0x0400767B RID: 30331
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x400767B")]
|
|
private readonly IBlockCipher cipher;
|
|
|
|
// Token: 0x0400767C RID: 30332
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x400767C")]
|
|
private byte[] sBox;
|
|
|
|
// Token: 0x0400767D RID: 30333
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x400767D")]
|
|
private byte[] K;
|
|
|
|
// Token: 0x0400767E RID: 30334
|
|
[FieldOffset(Offset = "0x68")]
|
|
[Token(Token = "0x400767E")]
|
|
private byte[] a;
|
|
|
|
// Token: 0x0400767F RID: 30335
|
|
[FieldOffset(Offset = "0x70")]
|
|
[Token(Token = "0x400767F")]
|
|
internal short[] wS;
|
|
|
|
// Token: 0x04007680 RID: 30336
|
|
[FieldOffset(Offset = "0x78")]
|
|
[Token(Token = "0x4007680")]
|
|
internal short[] w_S;
|
|
|
|
// Token: 0x04007681 RID: 30337
|
|
[FieldOffset(Offset = "0x80")]
|
|
[Token(Token = "0x4007681")]
|
|
internal byte[] S;
|
|
|
|
// Token: 0x04007682 RID: 30338
|
|
[FieldOffset(Offset = "0x88")]
|
|
[Token(Token = "0x4007682")]
|
|
internal byte[] U;
|
|
|
|
// Token: 0x04007683 RID: 30339
|
|
[FieldOffset(Offset = "0x90")]
|
|
[Token(Token = "0x4007683")]
|
|
internal byte[] V;
|
|
|
|
// Token: 0x04007684 RID: 30340
|
|
[FieldOffset(Offset = "0x98")]
|
|
[Token(Token = "0x4007684")]
|
|
internal byte[] W;
|
|
|
|
// Token: 0x04007685 RID: 30341
|
|
[Token(Token = "0x4007685")]
|
|
private static readonly byte[] C2;
|
|
}
|
|
}
|