m
This commit is contained in:
@@ -0,0 +1,300 @@
|
||||
using System;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs
|
||||
{
|
||||
// Token: 0x02001D34 RID: 7476
|
||||
[Token(Token = "0x2001D34")]
|
||||
public class SipHash : IMac
|
||||
{
|
||||
// Token: 0x0600B961 RID: 47457 RVA: 0x00284280 File Offset: 0x00282480
|
||||
[Token(Token = "0x600B961")]
|
||||
[Address(RVA = "0x73F040", Offset = "0x73E040", VA = "0x18073F040")]
|
||||
public SipHash()
|
||||
{
|
||||
this.c = (int)((ulong)2L);
|
||||
this.d = (int)((ulong)4L);
|
||||
}
|
||||
|
||||
// Token: 0x0600B962 RID: 47458 RVA: 0x002842A8 File Offset: 0x002824A8
|
||||
[Token(Token = "0x600B962")]
|
||||
[Address(RVA = "0x73F000", Offset = "0x73E000", VA = "0x18073F000")]
|
||||
public SipHash(int c, int d)
|
||||
{
|
||||
this.c = c;
|
||||
this.d = d;
|
||||
}
|
||||
|
||||
// Token: 0x17001D32 RID: 7474
|
||||
// (get) Token: 0x0600B963 RID: 47459 RVA: 0x002842CC File Offset: 0x002824CC
|
||||
[Token(Token = "0x17001D32")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600B963")]
|
||||
[Address(RVA = "0x25C7710", Offset = "0x25C6710", VA = "0x1825C7710", Slot = "11")]
|
||||
get
|
||||
{
|
||||
object[] array = new object[4];
|
||||
if ("SipHash-" != 0)
|
||||
{
|
||||
}
|
||||
array[0] = "SipHash-";
|
||||
int num = this.c;
|
||||
if (num != 0)
|
||||
{
|
||||
}
|
||||
array[1] = num;
|
||||
if ("-" != 0)
|
||||
{
|
||||
}
|
||||
array[2] = "-";
|
||||
int num2 = this.d;
|
||||
num = num2;
|
||||
if (num2 != 0)
|
||||
{
|
||||
}
|
||||
array[3] = num;
|
||||
return string.Concat(array);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B964 RID: 47460 RVA: 0x0028433C File Offset: 0x0028253C
|
||||
[Token(Token = "0x600B964")]
|
||||
[Address(RVA = "0x681E00", Offset = "0x680E00", VA = "0x180681E00", Slot = "12")]
|
||||
public virtual int GetMacSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
// Token: 0x0600B965 RID: 47461 RVA: 0x0028434C File Offset: 0x0028254C
|
||||
[Token(Token = "0x600B965")]
|
||||
[Address(RVA = "0x25C74B0", Offset = "0x25C64B0", VA = "0x1825C74B0", Slot = "13")]
|
||||
public virtual void Init(ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600B965)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs.SipHash::Init(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_50:
|
||||
stloc:ArgumentException(var_7_5F, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("must be a 128-bit key"), ldstr:string("parameters")))
|
||||
}
|
||||
|
||||
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: 0x0600B966 RID: 47462 RVA: 0x002843BC File Offset: 0x002825BC
|
||||
[Token(Token = "0x600B966")]
|
||||
[Address(RVA = "0x25C76C0", Offset = "0x25C66C0", VA = "0x1825C76C0", Slot = "14")]
|
||||
public virtual void Update(byte input)
|
||||
{
|
||||
int num = this.wordPos;
|
||||
num++;
|
||||
this.m = (long)input;
|
||||
this.wordPos = num;
|
||||
if (num == 8)
|
||||
{
|
||||
this.Reset();
|
||||
this.wordPos = (int)((ulong)0L);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600B967 RID: 47463 RVA: 0x002843F8 File Offset: 0x002825F8
|
||||
[Token(Token = "0x600B967")]
|
||||
[Address(RVA = "0x25C71B0", Offset = "0x25C61B0", VA = "0x1825C71B0", Slot = "15")]
|
||||
public virtual void BlockUpdate(byte[] input, int offset, int length)
|
||||
{
|
||||
int num = this.wordPos;
|
||||
int num2 = 0;
|
||||
if (num != 0)
|
||||
{
|
||||
if (length > 0)
|
||||
{
|
||||
ulong num3 = Pack.LE_To_UInt64(input, 0);
|
||||
long num4 = this.m;
|
||||
this.m = num4;
|
||||
this.Reset();
|
||||
num2 += 8;
|
||||
this.m = (long)num3;
|
||||
}
|
||||
if (num2 >= length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num5 = this.wordPos;
|
||||
num5++;
|
||||
byte b;
|
||||
this.m = (long)b;
|
||||
this.wordPos = num5;
|
||||
if (num5 == 8)
|
||||
{
|
||||
this.Reset();
|
||||
this.wordPos = num2;
|
||||
}
|
||||
}
|
||||
if (length > 0)
|
||||
{
|
||||
ulong num6 = Pack.LE_To_UInt64(input, 0);
|
||||
this.m = (long)num6;
|
||||
this.Reset();
|
||||
num2 += 8;
|
||||
}
|
||||
if (num2 < length)
|
||||
{
|
||||
byte b2;
|
||||
this.m = (long)b2;
|
||||
}
|
||||
this.wordPos = length;
|
||||
}
|
||||
|
||||
// Token: 0x0600B968 RID: 47464 RVA: 0x002844AC File Offset: 0x002826AC
|
||||
[Token(Token = "0x600B968")]
|
||||
[Address(RVA = "0x25C73E0", Offset = "0x25C63E0", VA = "0x1825C73E0", Slot = "16")]
|
||||
public virtual long DoFinal()
|
||||
{
|
||||
int num = this.wordPos;
|
||||
uint num2;
|
||||
num2 -= (uint)num;
|
||||
long num3 = this.m;
|
||||
this.m = num3;
|
||||
this.Reset();
|
||||
this.ProcessMessageWord();
|
||||
return this.v3;
|
||||
}
|
||||
|
||||
// Token: 0x0600B969 RID: 47465 RVA: 0x002844E4 File Offset: 0x002826E4
|
||||
[Token(Token = "0x600B969")]
|
||||
[Address(RVA = "0x25C7390", Offset = "0x25C6390", VA = "0x1825C7390", Slot = "17")]
|
||||
public virtual int DoFinal(byte[] output, int outOff)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
// Token: 0x0600B96A RID: 47466 RVA: 0x002844F4 File Offset: 0x002826F4
|
||||
[Token(Token = "0x600B96A")]
|
||||
[Address(RVA = "0x25C7640", Offset = "0x25C6640", VA = "0x1825C7640", Slot = "18")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
long num = this.k0;
|
||||
long num2 = this.k1;
|
||||
this.v0 = num;
|
||||
num = num2;
|
||||
this.v1 = num;
|
||||
this.v2 = num;
|
||||
int num3 = 0;
|
||||
this.v3 = num2;
|
||||
this.m = (long)num3;
|
||||
this.wordPos = num3;
|
||||
}
|
||||
|
||||
// Token: 0x0600B96B RID: 47467 RVA: 0x00284540 File Offset: 0x00282740
|
||||
[Token(Token = "0x600B96B")]
|
||||
[Address(RVA = "0x25C7600", Offset = "0x25C6600", VA = "0x1825C7600", Slot = "19")]
|
||||
protected virtual void ProcessMessageWord()
|
||||
{
|
||||
this.ProcessMessageWord();
|
||||
long num = this.m;
|
||||
}
|
||||
|
||||
// Token: 0x0600B96C RID: 47468 RVA: 0x0028455C File Offset: 0x0028275C
|
||||
[Token(Token = "0x600B96C")]
|
||||
[Address(RVA = "0x25C70E0", Offset = "0x25C60E0", VA = "0x1825C70E0", Slot = "20")]
|
||||
protected virtual void ApplySipRounds(int n)
|
||||
{
|
||||
long num = this.v0;
|
||||
long num2 = this.v1;
|
||||
long num3 = this.v2;
|
||||
long num4 = this.v3;
|
||||
if (n > 0)
|
||||
{
|
||||
num += num2;
|
||||
num3 += num4;
|
||||
num3 += num2;
|
||||
num = num3;
|
||||
num += num4;
|
||||
num = num3;
|
||||
num3 = num;
|
||||
while (n != 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
this.v0 = num;
|
||||
this.v1 = num2;
|
||||
this.v2 = num3;
|
||||
this.v3 = num4;
|
||||
}
|
||||
|
||||
// Token: 0x0600B96D RID: 47469 RVA: 0x002845C0 File Offset: 0x002827C0
|
||||
[Token(Token = "0x600B96D")]
|
||||
[Address(RVA = "0x25C76A0", Offset = "0x25C66A0", VA = "0x1825C76A0")]
|
||||
protected static long RotateLeft(long x, int n)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x040074F9 RID: 29945
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x40074F9")]
|
||||
protected readonly int c;
|
||||
|
||||
// Token: 0x040074FA RID: 29946
|
||||
[FieldOffset(Offset = "0x14")]
|
||||
[Token(Token = "0x40074FA")]
|
||||
protected readonly int d;
|
||||
|
||||
// Token: 0x040074FB RID: 29947
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40074FB")]
|
||||
protected long k0;
|
||||
|
||||
// Token: 0x040074FC RID: 29948
|
||||
[FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40074FC")]
|
||||
protected long k1;
|
||||
|
||||
// Token: 0x040074FD RID: 29949
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40074FD")]
|
||||
protected long v0;
|
||||
|
||||
// Token: 0x040074FE RID: 29950
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x40074FE")]
|
||||
protected long v1;
|
||||
|
||||
// Token: 0x040074FF RID: 29951
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x40074FF")]
|
||||
protected long v2;
|
||||
|
||||
// Token: 0x04007500 RID: 29952
|
||||
[FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x4007500")]
|
||||
protected long v3;
|
||||
|
||||
// Token: 0x04007501 RID: 29953
|
||||
[FieldOffset(Offset = "0x48")]
|
||||
[Token(Token = "0x4007501")]
|
||||
protected long m;
|
||||
|
||||
// Token: 0x04007502 RID: 29954
|
||||
[FieldOffset(Offset = "0x50")]
|
||||
[Token(Token = "0x4007502")]
|
||||
protected int wordPos;
|
||||
|
||||
// Token: 0x04007503 RID: 29955
|
||||
[FieldOffset(Offset = "0x54")]
|
||||
[Token(Token = "0x4007503")]
|
||||
protected int wordCount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user