248 lines
12 KiB
C#
248 lines
12 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
|
|
{
|
|
// Token: 0x02001675 RID: 5749
|
|
[Token(Token = "0x2001675")]
|
|
[StructLayout(3)]
|
|
public class ISO9797Alg3Mac : IMac
|
|
{
|
|
// Token: 0x060099A2 RID: 39330 RVA: 0x00223138 File Offset: 0x00221338
|
|
[Token(Token = "0x60099A2")]
|
|
[Address(RVA = "0x20F23F0", Offset = "0x20F0DF0", VA = "0x1820F23F0")]
|
|
public ISO9797Alg3Mac(IBlockCipher cipher)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060099A3 RID: 39331 RVA: 0x0022314C File Offset: 0x0022134C
|
|
[Token(Token = "0x60099A3")]
|
|
[Address(RVA = "0x20F2470", Offset = "0x20F0E70", VA = "0x1820F2470")]
|
|
public ISO9797Alg3Mac(IBlockCipher cipher, IBlockCipherPadding padding)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060099A4 RID: 39332 RVA: 0x00223160 File Offset: 0x00221360
|
|
[Token(Token = "0x60099A4")]
|
|
[Address(RVA = "0x20F2220", Offset = "0x20F0C20", VA = "0x1820F2220")]
|
|
public ISO9797Alg3Mac(IBlockCipher cipher, int macSizeInBits)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060099A5 RID: 39333 RVA: 0x00223170 File Offset: 0x00221370
|
|
[Token(Token = "0x60099A5")]
|
|
[Address(RVA = "0x20F2240", Offset = "0x20F0C40", VA = "0x1820F2240")]
|
|
public ISO9797Alg3Mac(IBlockCipher cipher, int macSizeInBits, IBlockCipherPadding padding)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060099A5)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.ISO9797Alg3Mac::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher,System.Int32,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings.IBlockCipherPadding)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_66:
|
|
stloc:ArgumentException(var_6_70, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("cipher must be instance of DesEngine")))
|
|
}
|
|
|
|
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: 0x17001892 RID: 6290
|
|
// (get) Token: 0x060099A6 RID: 39334 RVA: 0x002231F0 File Offset: 0x002213F0
|
|
[Token(Token = "0x17001892")]
|
|
public string AlgorithmName
|
|
{
|
|
[Token(Token = "0x60099A6")]
|
|
[Address(RVA = "0x20F2500", Offset = "0x20F0F00", VA = "0x1820F2500", Slot = "5")]
|
|
get
|
|
{
|
|
return "ISO9797Alg3";
|
|
}
|
|
}
|
|
|
|
// Token: 0x060099A7 RID: 39335 RVA: 0x00223204 File Offset: 0x00221404
|
|
[Token(Token = "0x60099A7")]
|
|
[Address(RVA = "0x20F1C00", Offset = "0x20F0600", VA = "0x1820F1C00", Slot = "4")]
|
|
public void Init(ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060099A7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.ISO9797Alg3Mac::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_110:
|
|
stloc:ArgumentException(var_27_11A, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Key must be either 112 or 168 bit long")))
|
|
}
|
|
|
|
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: 0x060099A8 RID: 39336 RVA: 0x0022332C File Offset: 0x0022152C
|
|
[Token(Token = "0x60099A8")]
|
|
[Address(RVA = "0x3D3FF0", Offset = "0x3D29F0", VA = "0x1803D3FF0", Slot = "6")]
|
|
public int GetMacSize()
|
|
{
|
|
return this.macSize;
|
|
}
|
|
|
|
// Token: 0x060099A9 RID: 39337 RVA: 0x00223340 File Offset: 0x00221540
|
|
[Token(Token = "0x60099A9")]
|
|
[Address(RVA = "0x20F2170", Offset = "0x20F0B70", VA = "0x1820F2170", Slot = "7")]
|
|
public void Update(byte input)
|
|
{
|
|
byte[] array = this.buf;
|
|
int num = this.bufOff;
|
|
if (num == array.Length)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
byte[] array2 = this.mac;
|
|
}
|
|
int num2 = num + 1;
|
|
this.bufOff = num2;
|
|
}
|
|
|
|
// Token: 0x060099AA RID: 39338 RVA: 0x0022338C File Offset: 0x0022158C
|
|
[Token(Token = "0x60099AA")]
|
|
[Address(RVA = "0x20F1750", Offset = "0x20F0150", VA = "0x1820F1750", Slot = "8")]
|
|
public void BlockUpdate(byte[] input, int inOff, int len)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
int num = this.bufOff;
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
byte[] array = this.mac;
|
|
int num2 = 0;
|
|
this.bufOff = num2;
|
|
IBlockCipher blockCipher3 = this.cipher;
|
|
if (num2 < blockCipher2)
|
|
{
|
|
num2 += num2;
|
|
num2++;
|
|
}
|
|
array += num2;
|
|
byte[] array2 = this.buf;
|
|
Array.Copy(input, inOff, array2, num, len);
|
|
}
|
|
|
|
// Token: 0x060099AB RID: 39339 RVA: 0x0022340C File Offset: 0x0022160C
|
|
[Token(Token = "0x60099AB")]
|
|
[Address(RVA = "0x20F1970", Offset = "0x20F0370", VA = "0x1820F1970", Slot = "9")]
|
|
public int DoFinal(byte[] output, int outOff)
|
|
{
|
|
IBlockCipher blockCipher = this.cipher;
|
|
int num = 0;
|
|
IBlockCipherPadding blockCipherPadding = this.padding;
|
|
int i = this.bufOff;
|
|
if (blockCipherPadding != 0)
|
|
{
|
|
if (i == blockCipher)
|
|
{
|
|
IBlockCipher blockCipher2 = this.cipher;
|
|
byte[] array = this.mac;
|
|
this.bufOff = num;
|
|
}
|
|
IBlockCipher blockCipher3 = this.cipher;
|
|
byte[] array2 = this.mac;
|
|
DesEngine desEngine = new DesEngine();
|
|
int[] workingKey = desEngine.GetWorkingKey();
|
|
int blockSize = desEngine.GetBlockSize();
|
|
int[] workingKey2 = desEngine.GetWorkingKey();
|
|
int blockSize2 = desEngine.GetBlockSize();
|
|
int num2 = this.macSize;
|
|
byte[] array3 = this.mac;
|
|
int num3 = 0;
|
|
Array.Copy(array3, num3, output, outOff, num2);
|
|
byte[] array4 = this.buf;
|
|
int length = array4.Length;
|
|
int num4 = 0;
|
|
Array.Clear(array4, num4, length);
|
|
IBlockCipher blockCipher4 = this.cipher;
|
|
this.bufOff = num;
|
|
return this.macSize;
|
|
}
|
|
while (i >= blockCipher)
|
|
{
|
|
}
|
|
byte[] array5 = this.buf;
|
|
int num5 = i + 1;
|
|
this.bufOff = num5;
|
|
int num6 = this.bufOff;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x060099AC RID: 39340 RVA: 0x0022350C File Offset: 0x0022170C
|
|
[Token(Token = "0x60099AC")]
|
|
[Address(RVA = "0x20F2100", Offset = "0x20F0B00", VA = "0x1820F2100", Slot = "10")]
|
|
public void Reset()
|
|
{
|
|
byte[] array = this.buf;
|
|
int length = array.Length;
|
|
int num = 0;
|
|
Array.Clear(array, num, length);
|
|
IBlockCipher blockCipher = this.cipher;
|
|
this.bufOff = (int)((ulong)0L);
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x040064DE RID: 25822
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40064DE")]
|
|
private byte[] mac;
|
|
|
|
// Token: 0x040064DF RID: 25823
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40064DF")]
|
|
private byte[] buf;
|
|
|
|
// Token: 0x040064E0 RID: 25824
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40064E0")]
|
|
private int bufOff;
|
|
|
|
// Token: 0x040064E1 RID: 25825
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40064E1")]
|
|
private IBlockCipher cipher;
|
|
|
|
// Token: 0x040064E2 RID: 25826
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40064E2")]
|
|
private IBlockCipherPadding padding;
|
|
|
|
// Token: 0x040064E3 RID: 25827
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40064E3")]
|
|
private int macSize;
|
|
|
|
// Token: 0x040064E4 RID: 25828
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40064E4")]
|
|
private KeyParameter lastKey2;
|
|
|
|
// Token: 0x040064E5 RID: 25829
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x40064E5")]
|
|
private KeyParameter lastKey3;
|
|
}
|
|
}
|