603 lines
27 KiB
C#
603 lines
27 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
|
|
{
|
|
// Token: 0x02001C3B RID: 7227
|
|
[Token(Token = "0x2001C3B")]
|
|
public class KCcmBlockCipher : IAeadBlockCipher
|
|
{
|
|
// Token: 0x0600B48E RID: 46222 RVA: 0x002758D0 File Offset: 0x00273AD0
|
|
[Token(Token = "0x600B48E")]
|
|
[Address(RVA = "0x1C2B850", Offset = "0x1C2A650", VA = "0x181C2B850")]
|
|
private void setNb(int Nb)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B48E)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.KCcmBlockCipher::setNb(System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_0C:
|
|
stloc:ArgumentException(var_0_16, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Nb = 4 is recommended by DSTU7624 but can be changed to only 6 or 8 in this implementation")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600B48F RID: 46223 RVA: 0x002758F4 File Offset: 0x00273AF4
|
|
[Token(Token = "0x600B48F")]
|
|
[Address(RVA = "0x1C2B3B0", Offset = "0x1C2A1B0", VA = "0x181C2B3B0")]
|
|
public KCcmBlockCipher(IBlockCipher engine)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600B490 RID: 46224 RVA: 0x00275904 File Offset: 0x00273B04
|
|
[Token(Token = "0x600B490")]
|
|
[Address(RVA = "0x1C2B3C0", Offset = "0x1C2A1C0", VA = "0x181C2B3C0")]
|
|
public KCcmBlockCipher(IBlockCipher engine, int Nb)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B490)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.KCcmBlockCipher::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_D8:
|
|
stloc:ArgumentException(var_10_E2, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Nb = 4 is recommended by DSTU7624 but can be changed to only 6 or 8 in this implementation")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600B491 RID: 46225 RVA: 0x002759F4 File Offset: 0x00273BF4
|
|
[Token(Token = "0x600B491")]
|
|
[Address(RVA = "0x1C29860", Offset = "0x1C28660", VA = "0x181C29860", Slot = "17")]
|
|
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B491)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.KCcmBlockCipher::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_B9:
|
|
stloc:ArgumentException(var_15_C3, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Invalid mac size specified")))
|
|
}
|
|
|
|
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x17001C7F RID: 7295
|
|
// (get) Token: 0x0600B492 RID: 46226 RVA: 0x00275AC8 File Offset: 0x00273CC8
|
|
[Token(Token = "0x17001C7F")]
|
|
public virtual string AlgorithmName
|
|
{
|
|
[Token(Token = "0x600B492")]
|
|
[Address(RVA = "0x1C2B7F0", Offset = "0x1C2A5F0", VA = "0x181C2B7F0", Slot = "18")]
|
|
get
|
|
{
|
|
IBlockCipher blockCipher = this.engine;
|
|
return 0 + "/KCCM";
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B493 RID: 46227 RVA: 0x00275AF0 File Offset: 0x00273CF0
|
|
[Token(Token = "0x600B493")]
|
|
[Address(RVA = "0x1C297B0", Offset = "0x1C285B0", VA = "0x181C297B0", Slot = "19")]
|
|
public virtual int GetBlockSize()
|
|
{
|
|
IBlockCipher blockCipher = this.engine;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B494 RID: 46228 RVA: 0x00275B0C File Offset: 0x00273D0C
|
|
[Token(Token = "0x600B494")]
|
|
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "20")]
|
|
public virtual IBlockCipher GetUnderlyingCipher()
|
|
{
|
|
return this.engine;
|
|
}
|
|
|
|
// Token: 0x0600B495 RID: 46229 RVA: 0x00275B20 File Offset: 0x00273D20
|
|
[Token(Token = "0x600B495")]
|
|
[Address(RVA = "0x1C2A390", Offset = "0x1C29190", VA = "0x181C2A390", Slot = "21")]
|
|
public virtual void ProcessAadByte(byte input)
|
|
{
|
|
((IDisposable)this.associatedText).Dispose();
|
|
}
|
|
|
|
// Token: 0x0600B496 RID: 46230 RVA: 0x00275B40 File Offset: 0x00273D40
|
|
[Token(Token = "0x600B496")]
|
|
[Address(RVA = "0x1C2A3C0", Offset = "0x1C291C0", VA = "0x181C2A3C0", Slot = "22")]
|
|
public virtual void ProcessAadBytes(byte[] input, int inOff, int len)
|
|
{
|
|
int num = this.associatedText.Read(input, inOff, len);
|
|
}
|
|
|
|
// Token: 0x0600B497 RID: 46231 RVA: 0x00275B64 File Offset: 0x00273D64
|
|
[Token(Token = "0x600B497")]
|
|
[Address(RVA = "0x1C29CF0", Offset = "0x1C28AF0", VA = "0x181C29CF0")]
|
|
private void ProcessAAD(byte[] assocText, int assocOff, int assocLen, int dataLen)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600B497)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.KCcmBlockCipher::ProcessAAD(System.Byte[],System.Int32,System.Int32,System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_1CD:
|
|
stloc:IBlockCipher(var_40_1D3, ldfld:IBlockCipher(KCcmBlockCipher::engine, ldloc:KCcmBlockCipher(this)))
|
|
stloc:uint8[](var_41_1DB, ldfld:uint8[](KCcmBlockCipher::macBlock, ldloc:KCcmBlockCipher(this)))
|
|
stloc:ArgumentException(var_42_1E7, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("authText buffer too short")))
|
|
}
|
|
|
|
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 1660
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x0600B498 RID: 46232 RVA: 0x00275D5C File Offset: 0x00273F5C
|
|
[Token(Token = "0x600B498")]
|
|
[Address(RVA = "0x1C2A680", Offset = "0x1C29480", VA = "0x181C2A680", Slot = "23")]
|
|
public virtual int ProcessByte(byte input, byte[] output, int outOff)
|
|
{
|
|
MemoryStream memoryStream = this.data;
|
|
return 0;
|
|
}
|
|
|
|
// Token: 0x0600B499 RID: 46233 RVA: 0x00275D78 File Offset: 0x00273F78
|
|
[Token(Token = "0x600B499")]
|
|
[Address(RVA = "0x1C2A6B0", Offset = "0x1C294B0", VA = "0x181C2A6B0", Slot = "24")]
|
|
public virtual int ProcessBytes(byte[] input, int inOff, int inLen, byte[] output, int outOff)
|
|
{
|
|
Check.DataLength(input, inOff, inOff, "input buffer too short");
|
|
int num = this.data.ReadByte();
|
|
return 0;
|
|
}
|
|
|
|
// Token: 0x0600B49A RID: 46234 RVA: 0x00275DA8 File Offset: 0x00273FA8
|
|
[Token(Token = "0x600B49A")]
|
|
[Address(RVA = "0x1C2A750", Offset = "0x1C29550", VA = "0x181C2A750")]
|
|
public int ProcessPacket(byte[] input, int inOff, int len, byte[] output, int outOff)
|
|
{
|
|
byte[] array11;
|
|
byte[] array12;
|
|
do
|
|
{
|
|
Check.DataLength(input, inOff, inOff, "input buffer too short");
|
|
if (this.associatedText.CanWrite > false)
|
|
{
|
|
MemoryStream memoryStream = this.associatedText;
|
|
bool canWrite = this.associatedText.CanWrite;
|
|
MemoryStream memoryStream2 = this.data;
|
|
if (this.forEncryption)
|
|
{
|
|
bool canWrite2 = memoryStream2.CanWrite;
|
|
}
|
|
bool canWrite3 = memoryStream2.CanWrite;
|
|
}
|
|
IBlockCipher blockCipher = this.engine;
|
|
if (this.forEncryption)
|
|
{
|
|
break;
|
|
}
|
|
int num = this.macSize;
|
|
Check.DataLength(typeof(IBlockCipher).TypeHandle != 0, "partial blocks not supported");
|
|
IBlockCipher blockCipher2 = this.engine;
|
|
byte[] array = this.s;
|
|
int num2 = 0;
|
|
IBlockCipher blockCipher3 = this.engine;
|
|
if (len > 0)
|
|
{
|
|
IBlockCipher blockCipher4 = this.engine;
|
|
int num3 = 0;
|
|
if (num3 < inOff)
|
|
{
|
|
num3 += num3;
|
|
num3++;
|
|
}
|
|
IBlockCipher blockCipher5 = this.engine;
|
|
int num4 = 0;
|
|
uint num5;
|
|
if (num4 < (int)num5)
|
|
{
|
|
num4 += num4;
|
|
num4++;
|
|
}
|
|
num2++;
|
|
}
|
|
byte[] array2 = this.counter;
|
|
uint num6;
|
|
if (num6 < (uint)array2.Length)
|
|
{
|
|
byte[] array3 = this.s;
|
|
num6 += (uint)1;
|
|
byte[] array4 = this.counter;
|
|
array4 += array4;
|
|
array4 += array4;
|
|
}
|
|
IBlockCipher blockCipher6 = this.engine;
|
|
byte[] array5 = this.buffer;
|
|
if (this.macSize > 0)
|
|
{
|
|
byte[] array6 = this.buffer;
|
|
int num7 = this.macSize;
|
|
}
|
|
byte[] array7 = this.counter;
|
|
if (num6 < (uint)array7.Length)
|
|
{
|
|
byte[] array8 = this.s;
|
|
num6 += (uint)1;
|
|
if (this.counter != 0)
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
IBlockCipher blockCipher7 = this.engine;
|
|
byte[] array9 = this.buffer;
|
|
int num8 = this.macSize;
|
|
int num9 = this.macSize;
|
|
int num10 = 0;
|
|
byte[] array10 = this.mac;
|
|
int num11 = 0;
|
|
Array.Copy(this.macBlock, num11, array10, num10, num9);
|
|
array11 = new byte[this.macSize];
|
|
int num12 = this.macSize;
|
|
int num13 = 0;
|
|
int num14 = 0;
|
|
Array.Copy(this.buffer, num13, array11, num14, num12);
|
|
array12 = this.mac;
|
|
}
|
|
while (!Arrays.ConstantTimeAreEqual(array12, array11));
|
|
Check.DataLength(typeof(IBlockCipher).TypeHandle != 0, "partial blocks not supported");
|
|
int num18;
|
|
if (len > 0)
|
|
{
|
|
int num15 = 0;
|
|
if (num15 < array12)
|
|
{
|
|
num15 += num15;
|
|
num15++;
|
|
}
|
|
int num16 = 0;
|
|
uint num17;
|
|
if (num16 < (int)num17)
|
|
{
|
|
num16 += num16;
|
|
num16++;
|
|
}
|
|
array12 += num16;
|
|
num18 = 0;
|
|
uint num19;
|
|
if (num18 < (int)num19)
|
|
{
|
|
num18 += num18;
|
|
num18++;
|
|
}
|
|
}
|
|
uint num20;
|
|
num20 += (uint)1;
|
|
while (num18 != 0)
|
|
{
|
|
}
|
|
num18 += num18;
|
|
num18 += 2;
|
|
num18 += 19;
|
|
num18 += num18;
|
|
num18 += 2;
|
|
num18 += 19;
|
|
num18 += num18;
|
|
num18 += 2;
|
|
num18 += 19;
|
|
if (num18 > 0)
|
|
{
|
|
num20 += (uint)1;
|
|
}
|
|
num20 += (uint)len;
|
|
throw new IndexOutOfRangeException();
|
|
}
|
|
|
|
// Token: 0x0600B49B RID: 46235 RVA: 0x00276074 File Offset: 0x00274274
|
|
[Token(Token = "0x600B49B")]
|
|
[Address(RVA = "0x1C2A3F0", Offset = "0x1C291F0", VA = "0x181C2A3F0")]
|
|
private void ProcessBlock(byte[] input, int inOff, int len, byte[] output, int outOff)
|
|
{
|
|
do
|
|
{
|
|
byte[] array = this.counter;
|
|
int num = 0;
|
|
if (num < array.Length)
|
|
{
|
|
byte[] array2 = this.s;
|
|
num++;
|
|
byte[] array3 = this.counter;
|
|
}
|
|
IBlockCipher blockCipher = this.engine;
|
|
byte[] array4 = this.buffer;
|
|
IBlockCipher blockCipher2 = this.engine;
|
|
int num2 = 0;
|
|
if (num2 < blockCipher)
|
|
{
|
|
num2 += num2;
|
|
num2++;
|
|
}
|
|
if (num2 >= num2)
|
|
{
|
|
return;
|
|
}
|
|
byte[] array5 = this.buffer;
|
|
}
|
|
while (this.engine != 0);
|
|
byte b;
|
|
b += b;
|
|
}
|
|
|
|
// Token: 0x0600B49C RID: 46236 RVA: 0x002760F8 File Offset: 0x002742F8
|
|
[Token(Token = "0x600B49C")]
|
|
[Address(RVA = "0x1C29590", Offset = "0x1C28390", VA = "0x181C29590")]
|
|
private void CalculateMac(byte[] authText, int authOff, int len)
|
|
{
|
|
if (len > 0)
|
|
{
|
|
int num = 0;
|
|
IBlockCipher blockCipher = this.engine;
|
|
byte[] array = this.macBlock;
|
|
num += array;
|
|
num++;
|
|
IBlockCipher blockCipher2 = this.engine;
|
|
byte[] array2 = this.macBlock;
|
|
IBlockCipher blockCipher3 = this.engine;
|
|
IBlockCipher blockCipher4 = this.engine;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B49D RID: 46237 RVA: 0x00276148 File Offset: 0x00274348
|
|
[Token(Token = "0x600B49D")]
|
|
[Address(RVA = "0x1C29700", Offset = "0x1C28500", VA = "0x181C29700", Slot = "25")]
|
|
public virtual int DoFinal(byte[] output, int outOff)
|
|
{
|
|
MemoryStream memoryStream = this.data;
|
|
bool canWrite = this.data.CanWrite;
|
|
return outOff;
|
|
}
|
|
|
|
// Token: 0x0600B49E RID: 46238 RVA: 0x00276170 File Offset: 0x00274370
|
|
[Token(Token = "0x600B49E")]
|
|
[Address(RVA = "0x1C29800", Offset = "0x1C28600", VA = "0x181C29800", Slot = "26")]
|
|
public virtual byte[] GetMac()
|
|
{
|
|
return Arrays.Clone(this.mac);
|
|
}
|
|
|
|
// Token: 0x0600B49F RID: 46239 RVA: 0x00276188 File Offset: 0x00274388
|
|
[Token(Token = "0x600B49F")]
|
|
[Address(RVA = "0x7A2180", Offset = "0x7A0F80", VA = "0x1807A2180", Slot = "27")]
|
|
public virtual int GetUpdateOutputSize(int len)
|
|
{
|
|
return len;
|
|
}
|
|
|
|
// Token: 0x0600B4A0 RID: 46240 RVA: 0x00276198 File Offset: 0x00274398
|
|
[Token(Token = "0x600B4A0")]
|
|
[Address(RVA = "0x1B33830", Offset = "0x1B32630", VA = "0x181B33830", Slot = "28")]
|
|
public virtual int GetOutputSize(int len)
|
|
{
|
|
int num = this.macSize;
|
|
return num + len;
|
|
}
|
|
|
|
// Token: 0x0600B4A1 RID: 46241 RVA: 0x002761B4 File Offset: 0x002743B4
|
|
[Token(Token = "0x600B4A1")]
|
|
[Address(RVA = "0x1C2B210", Offset = "0x1C2A010", VA = "0x181C2B210", Slot = "29")]
|
|
public virtual void Reset()
|
|
{
|
|
byte[] g = this.G1;
|
|
int num = 0;
|
|
Arrays.Fill(g, (byte)num);
|
|
byte[] array = this.buffer;
|
|
int num2 = 0;
|
|
Arrays.Fill(array, (byte)num2);
|
|
byte[] array2 = this.counter;
|
|
int num3 = 0;
|
|
Arrays.Fill(array2, (byte)num3);
|
|
byte[] array3 = this.macBlock;
|
|
int num4 = 0;
|
|
Arrays.Fill(array3, (byte)num4);
|
|
byte[] array4 = this.counter;
|
|
MemoryStream memoryStream = this.data;
|
|
MemoryStream memoryStream2 = this.associatedText;
|
|
byte[] array5 = this.initialAssociatedText;
|
|
if (array5 != 0)
|
|
{
|
|
this.ProcessAadByte(array5);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600B4A2 RID: 46242 RVA: 0x0027623C File Offset: 0x0027443C
|
|
[Token(Token = "0x600B4A2")]
|
|
[Address(RVA = "0x1C22D00", Offset = "0x1C21B00", VA = "0x181C22D00")]
|
|
private void intToBytes(int num, byte[] outBytes, int outOff)
|
|
{
|
|
int num2 = outOff + 1;
|
|
}
|
|
|
|
// Token: 0x0600B4A3 RID: 46243 RVA: 0x00276254 File Offset: 0x00274454
|
|
[Token(Token = "0x600B4A3")]
|
|
[Address(RVA = "0x1C2B610", Offset = "0x1C2A410", VA = "0x181C2B610")]
|
|
private byte getFlag(bool authTextPresents, int macSize)
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
if (authTextPresents)
|
|
{
|
|
}
|
|
StringBuilder stringBuilder2 = stringBuilder.Append("0");
|
|
if (macSize > 16)
|
|
{
|
|
if (macSize == 32)
|
|
{
|
|
}
|
|
if (macSize == 48)
|
|
{
|
|
}
|
|
if (macSize != 64)
|
|
{
|
|
goto IL_3F;
|
|
}
|
|
}
|
|
if (macSize == 8)
|
|
{
|
|
}
|
|
if (macSize == 16)
|
|
{
|
|
StringBuilder stringBuilder3 = stringBuilder.Append("011");
|
|
}
|
|
IL_3F:
|
|
string text = Convert.ToString(this.Nb_ - 1, 2);
|
|
int num2;
|
|
if (text.m_stringLength < 4)
|
|
{
|
|
StringBuilder stringBuilder4 = new StringBuilder(text);
|
|
int num = 0;
|
|
num2 = stringBuilder4.Insert(num, "0").GetHashCode();
|
|
}
|
|
num2 = stringBuilder.GetHashCode();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x04007299 RID: 29337
|
|
[Token(Token = "0x4007299")]
|
|
private static readonly int BYTES_IN_INT;
|
|
|
|
// Token: 0x0400729A RID: 29338
|
|
[Token(Token = "0x400729A")]
|
|
private static readonly int BITS_IN_BYTE;
|
|
|
|
// Token: 0x0400729B RID: 29339
|
|
[Token(Token = "0x400729B")]
|
|
private static readonly int MAX_MAC_BIT_LENGTH;
|
|
|
|
// Token: 0x0400729C RID: 29340
|
|
[Token(Token = "0x400729C")]
|
|
private static readonly int MIN_MAC_BIT_LENGTH;
|
|
|
|
// Token: 0x0400729D RID: 29341
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400729D")]
|
|
private IBlockCipher engine;
|
|
|
|
// Token: 0x0400729E RID: 29342
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400729E")]
|
|
private int macSize;
|
|
|
|
// Token: 0x0400729F RID: 29343
|
|
[FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x400729F")]
|
|
private bool forEncryption;
|
|
|
|
// Token: 0x040072A0 RID: 29344
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40072A0")]
|
|
private byte[] initialAssociatedText;
|
|
|
|
// Token: 0x040072A1 RID: 29345
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40072A1")]
|
|
private byte[] mac;
|
|
|
|
// Token: 0x040072A2 RID: 29346
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40072A2")]
|
|
private byte[] macBlock;
|
|
|
|
// Token: 0x040072A3 RID: 29347
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40072A3")]
|
|
private byte[] nonce;
|
|
|
|
// Token: 0x040072A4 RID: 29348
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40072A4")]
|
|
private byte[] G1;
|
|
|
|
// Token: 0x040072A5 RID: 29349
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x40072A5")]
|
|
private byte[] buffer;
|
|
|
|
// Token: 0x040072A6 RID: 29350
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x40072A6")]
|
|
private byte[] s;
|
|
|
|
// Token: 0x040072A7 RID: 29351
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x40072A7")]
|
|
private byte[] counter;
|
|
|
|
// Token: 0x040072A8 RID: 29352
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x40072A8")]
|
|
private readonly MemoryStream associatedText;
|
|
|
|
// Token: 0x040072A9 RID: 29353
|
|
[FieldOffset(Offset = "0x68")]
|
|
[Token(Token = "0x40072A9")]
|
|
private readonly MemoryStream data;
|
|
|
|
// Token: 0x040072AA RID: 29354
|
|
[FieldOffset(Offset = "0x70")]
|
|
[Token(Token = "0x40072AA")]
|
|
private int Nb_;
|
|
}
|
|
}
|