a
This commit is contained in:
+214
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests
|
||||
{
|
||||
// Token: 0x02001CFD RID: 7421
|
||||
[Token(Token = "0x2001CFD")]
|
||||
public class SkeinDigest : IDigest, IMemoable
|
||||
{
|
||||
// Token: 0x0600BBCB RID: 48075 RVA: 0x002A9364 File Offset: 0x002A7564
|
||||
[Token(Token = "0x600BBCB")]
|
||||
[Address(RVA = "0x1FE39F0", Offset = "0x1FE27F0", VA = "0x181FE39F0")]
|
||||
public SkeinDigest(int stateSizeBits, int digestSizeBits)
|
||||
{
|
||||
SkeinEngine skeinEngine = new SkeinEngine(stateSizeBits, digestSizeBits);
|
||||
this.engine = skeinEngine;
|
||||
int num = 0;
|
||||
skeinEngine.chain = num;
|
||||
skeinEngine.key = num;
|
||||
skeinEngine.preMessageParameters = num;
|
||||
skeinEngine.postMessageParameters = num;
|
||||
skeinEngine.CreateInitialState();
|
||||
skeinEngine.UbiInit(48);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBCC RID: 48076 RVA: 0x002A93B8 File Offset: 0x002A75B8
|
||||
[Token(Token = "0x600BBCC")]
|
||||
[Address(RVA = "0x1FE3930", Offset = "0x1FE2730", VA = "0x181FE3930")]
|
||||
public SkeinDigest(SkeinDigest digest)
|
||||
{
|
||||
SkeinEngine skeinEngine = digest.engine;
|
||||
bool isPartialBlockOkay = skeinEngine.threefish.IsPartialBlockOkay;
|
||||
SkeinEngine skeinEngine2;
|
||||
skeinEngine2.CopyIn(skeinEngine);
|
||||
this.engine = skeinEngine2;
|
||||
}
|
||||
|
||||
// Token: 0x0600BBCD RID: 48077 RVA: 0x002A93F4 File Offset: 0x002A75F4
|
||||
[Token(Token = "0x600BBCD")]
|
||||
[Address(RVA = "0x1FE3730", Offset = "0x1FE2530", VA = "0x181FE3730", Slot = "12")]
|
||||
public void Reset(IMemoable other)
|
||||
{
|
||||
int num;
|
||||
SkeinEngine skeinEngine;
|
||||
for (;;)
|
||||
{
|
||||
num = 0;
|
||||
if (other != 0)
|
||||
{
|
||||
skeinEngine = this.engine;
|
||||
if (other == 0 || other != 0)
|
||||
{
|
||||
ThreefishEngine threefish = skeinEngine.threefish;
|
||||
bool isPartialBlockOkay = threefish.IsPartialBlockOkay;
|
||||
bool isPartialBlockOkay2 = threefish.IsPartialBlockOkay;
|
||||
if (isPartialBlockOkay == isPartialBlockOkay2 && skeinEngine.outputSizeBytes == (isPartialBlockOkay2 ? 1 : 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
skeinEngine.CopyIn(num);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBCE RID: 48078 RVA: 0x002A9454 File Offset: 0x002A7654
|
||||
[Token(Token = "0x600BBCE")]
|
||||
[Address(RVA = "0x1FE34E0", Offset = "0x1FE22E0", VA = "0x181FE34E0", Slot = "11")]
|
||||
public IMemoable Copy()
|
||||
{
|
||||
SkeinEngine skeinEngine = this.engine;
|
||||
bool isPartialBlockOkay = skeinEngine.threefish.IsPartialBlockOkay;
|
||||
SkeinEngine skeinEngine2;
|
||||
skeinEngine2.CopyIn(skeinEngine);
|
||||
SkeinDigest skeinDigest;
|
||||
skeinDigest.engine = skeinEngine2;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x17001D25 RID: 7461
|
||||
// (get) Token: 0x0600BBCF RID: 48079 RVA: 0x002A9488 File Offset: 0x002A7688
|
||||
[Token(Token = "0x17001D25")]
|
||||
public string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x600BBCF")]
|
||||
[Address(RVA = "0x1FE3AC0", Offset = "0x1FE28C0", VA = "0x181FE3AC0", Slot = "4")]
|
||||
get
|
||||
{
|
||||
object[] array = new object[4];
|
||||
if ("Skein-" != 0)
|
||||
{
|
||||
}
|
||||
array[0] = "Skein-";
|
||||
bool isPartialBlockOkay = this.engine.threefish.IsPartialBlockOkay;
|
||||
if (isPartialBlockOkay)
|
||||
{
|
||||
}
|
||||
array[1] = isPartialBlockOkay;
|
||||
if ("-" != 0)
|
||||
{
|
||||
}
|
||||
array[2] = "-";
|
||||
int outputSizeBytes = this.engine.outputSizeBytes;
|
||||
if (outputSizeBytes != 0)
|
||||
{
|
||||
}
|
||||
array[3] = outputSizeBytes;
|
||||
return string.Concat(array);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD0 RID: 48080 RVA: 0x002A9508 File Offset: 0x002A7708
|
||||
[Token(Token = "0x600BBD0")]
|
||||
[Address(RVA = "0x40DB30", Offset = "0x40C930", VA = "0x18040DB30", Slot = "5")]
|
||||
public int GetDigestSize()
|
||||
{
|
||||
return this.engine.outputSizeBytes;
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD1 RID: 48081 RVA: 0x002A9528 File Offset: 0x002A7728
|
||||
[Token(Token = "0x600BBD1")]
|
||||
[Address(RVA = "0x1FE35C0", Offset = "0x1FE23C0", VA = "0x181FE35C0", Slot = "6")]
|
||||
public int GetByteLength()
|
||||
{
|
||||
string algorithmName = ((IBlockCipher)this.engine.threefish).AlgorithmName;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD2 RID: 48082 RVA: 0x002A954C File Offset: 0x002A774C
|
||||
[Token(Token = "0x600BBD2")]
|
||||
[Address(RVA = "0x1FE3600", Offset = "0x1FE2400", VA = "0x181FE3600")]
|
||||
public void Init(SkeinParameters parameters)
|
||||
{
|
||||
SkeinEngine skeinEngine = this.engine;
|
||||
int num = 0;
|
||||
skeinEngine.chain = num;
|
||||
skeinEngine.key = num;
|
||||
skeinEngine.preMessageParameters = num;
|
||||
skeinEngine.postMessageParameters = num;
|
||||
if (parameters != 0)
|
||||
{
|
||||
byte[] key = parameters.GetKey();
|
||||
IDictionary parameters2 = parameters.parameters;
|
||||
skeinEngine.InitParams(parameters2);
|
||||
}
|
||||
skeinEngine.CreateInitialState();
|
||||
skeinEngine.UbiInit(48);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD3 RID: 48083 RVA: 0x002A95AC File Offset: 0x002A77AC
|
||||
[Token(Token = "0x600BBD3")]
|
||||
[Address(RVA = "0x1FE36D0", Offset = "0x1FE24D0", VA = "0x181FE36D0", Slot = "10")]
|
||||
public void Reset()
|
||||
{
|
||||
SkeinEngine skeinEngine = this.engine;
|
||||
ulong[] chain = skeinEngine.chain;
|
||||
int length = chain.Length;
|
||||
int num = 0;
|
||||
ulong[] initialState = skeinEngine.initialState;
|
||||
int num2 = 0;
|
||||
Array.Copy(initialState, num2, chain, num, length);
|
||||
skeinEngine.UbiInit(48);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD4 RID: 48084 RVA: 0x002A95F8 File Offset: 0x002A77F8
|
||||
[Token(Token = "0x600BBD4")]
|
||||
[Address(RVA = "0x1FE38D0", Offset = "0x1FE26D0", VA = "0x181FE38D0", Slot = "7")]
|
||||
public void Update(byte inByte)
|
||||
{
|
||||
SkeinEngine skeinEngine = this.engine;
|
||||
skeinEngine.singleByte[0] = inByte;
|
||||
byte[] singleByte = skeinEngine.singleByte;
|
||||
int num = 0;
|
||||
skeinEngine.Update(singleByte, num, 1);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD5 RID: 48085 RVA: 0x002A9634 File Offset: 0x002A7834
|
||||
[Token(Token = "0x600BBD5")]
|
||||
[Address(RVA = "0x1C30790", Offset = "0x1C2F590", VA = "0x181C30790", Slot = "8")]
|
||||
public void BlockUpdate(byte[] inBytes, int inOff, int len)
|
||||
{
|
||||
this.engine.Update(inBytes, inOff, len);
|
||||
}
|
||||
|
||||
// Token: 0x0600BBD6 RID: 48086 RVA: 0x002A9658 File Offset: 0x002A7858
|
||||
[Token(Token = "0x600BBD6")]
|
||||
[Address(RVA = "0x1C307C0", Offset = "0x1C2F5C0", VA = "0x181C307C0", Slot = "9")]
|
||||
public int DoFinal(byte[] outBytes, int outOff)
|
||||
{
|
||||
return this.engine.DoFinal(outBytes, outOff);
|
||||
}
|
||||
|
||||
// Token: 0x04007744 RID: 30532
|
||||
[Token(Token = "0x4007744")]
|
||||
public const int SKEIN_256 = 256;
|
||||
|
||||
// Token: 0x04007745 RID: 30533
|
||||
[Token(Token = "0x4007745")]
|
||||
public const int SKEIN_512 = 512;
|
||||
|
||||
// Token: 0x04007746 RID: 30534
|
||||
[Token(Token = "0x4007746")]
|
||||
public const int SKEIN_1024 = 1024;
|
||||
|
||||
// Token: 0x04007747 RID: 30535
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4007747")]
|
||||
private readonly SkeinEngine engine;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user