m
This commit is contained in:
+150
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg;
|
||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng
|
||||
{
|
||||
// Token: 0x02001CA8 RID: 7336
|
||||
[Token(Token = "0x2001CA8")]
|
||||
public class SP800SecureRandom : SecureRandom
|
||||
{
|
||||
// Token: 0x0600B5AB RID: 46507 RVA: 0x00274A9C File Offset: 0x00272C9C
|
||||
[Token(Token = "0x600B5AB")]
|
||||
[Address(RVA = "0x2367C00", Offset = "0x2366C00", VA = "0x182367C00")]
|
||||
internal SP800SecureRandom(SecureRandom randomSource, IEntropySource entropySource, IDrbgProvider drbgProvider, bool predictionResistant)
|
||||
{
|
||||
int num = 0;
|
||||
base..ctor(num);
|
||||
this.mRandomSource = randomSource;
|
||||
this.mEntropySource = entropySource;
|
||||
this.mPredictionResistant = false;
|
||||
this.mDrbgProvider = drbgProvider;
|
||||
}
|
||||
|
||||
// Token: 0x0600B5AC RID: 46508 RVA: 0x00274AD0 File Offset: 0x00272CD0
|
||||
[Token(Token = "0x600B5AC")]
|
||||
[Address(RVA = "0x2367B50", Offset = "0x2366B50", VA = "0x182367B50", Slot = "11")]
|
||||
public override void SetSeed(byte[] seed)
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
if (this.mRandomSource != 0)
|
||||
{
|
||||
}
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x0600B5AD RID: 46509 RVA: 0x00274AF4 File Offset: 0x00272CF4
|
||||
[Token(Token = "0x600B5AD")]
|
||||
[Address(RVA = "0x2367AA0", Offset = "0x2366AA0", VA = "0x182367AA0", Slot = "12")]
|
||||
public override void SetSeed(long seed)
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
SecureRandom secureRandom = this.mRandomSource;
|
||||
if (secureRandom != 0)
|
||||
{
|
||||
secureRandom.SetSeed(seed);
|
||||
}
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x0600B5AE RID: 46510 RVA: 0x00274B20 File Offset: 0x00272D20
|
||||
[Token(Token = "0x600B5AE")]
|
||||
[Address(RVA = "0x2367830", Offset = "0x2366830", VA = "0x182367830", Slot = "9")]
|
||||
public override void NextBytes(byte[] bytes)
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
ISP80090Drbg isp80090Drbg = this.mDrbg;
|
||||
if (isp80090Drbg == 0)
|
||||
{
|
||||
IDrbgProvider drbgProvider = this.mDrbgProvider;
|
||||
this.mDrbg = isp80090Drbg;
|
||||
}
|
||||
bool flag = this.mPredictionResistant;
|
||||
ISP80090Drbg isp80090Drbg2 = this.mDrbg;
|
||||
ISP80090Drbg isp80090Drbg3 = this.mDrbg;
|
||||
bool flag2 = this.mPredictionResistant;
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x0600B5AF RID: 46511 RVA: 0x00274B8C File Offset: 0x00272D8C
|
||||
[Token(Token = "0x600B5AF")]
|
||||
[Address(RVA = "0x2367780", Offset = "0x2366780", VA = "0x182367780", Slot = "13")]
|
||||
public override void NextBytes(byte[] buf, int off, int len)
|
||||
{
|
||||
byte[] array = new byte[len];
|
||||
double num = this.NextDouble();
|
||||
int num2 = 0;
|
||||
Array.Copy(array, num2, buf, off, len);
|
||||
}
|
||||
|
||||
// Token: 0x0600B5B0 RID: 46512 RVA: 0x00274BB4 File Offset: 0x00272DB4
|
||||
[Token(Token = "0x600B5B0")]
|
||||
[Address(RVA = "0x2367770", Offset = "0x2366770", VA = "0x182367770", Slot = "10")]
|
||||
public override byte[] GenerateSeed(int numBytes)
|
||||
{
|
||||
return EntropyUtilities.GenerateSeed(this.mEntropySource, numBytes);
|
||||
}
|
||||
|
||||
// Token: 0x0600B5B1 RID: 46513 RVA: 0x00274BD0 File Offset: 0x00272DD0
|
||||
[Token(Token = "0x600B5B1")]
|
||||
[Address(RVA = "0x23679A0", Offset = "0x23669A0", VA = "0x1823679A0", Slot = "16")]
|
||||
public virtual void Reseed(byte[] additionalInput)
|
||||
{
|
||||
int num;
|
||||
do
|
||||
{
|
||||
num = 0;
|
||||
ISP80090Drbg isp80090Drbg = this.mDrbg;
|
||||
if (isp80090Drbg == 0)
|
||||
{
|
||||
IDrbgProvider drbgProvider = this.mDrbgProvider;
|
||||
this.mDrbg = isp80090Drbg;
|
||||
}
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
while (num != 0);
|
||||
}
|
||||
|
||||
// Token: 0x040072FF RID: 29439
|
||||
[FieldOffset(Offset = "0x28")]
|
||||
[Token(Token = "0x40072FF")]
|
||||
private readonly IDrbgProvider mDrbgProvider;
|
||||
|
||||
// Token: 0x04007300 RID: 29440
|
||||
[FieldOffset(Offset = "0x30")]
|
||||
[Token(Token = "0x4007300")]
|
||||
private readonly bool mPredictionResistant;
|
||||
|
||||
// Token: 0x04007301 RID: 29441
|
||||
[FieldOffset(Offset = "0x38")]
|
||||
[Token(Token = "0x4007301")]
|
||||
private readonly SecureRandom mRandomSource;
|
||||
|
||||
// Token: 0x04007302 RID: 29442
|
||||
[FieldOffset(Offset = "0x40")]
|
||||
[Token(Token = "0x4007302")]
|
||||
private readonly IEntropySource mEntropySource;
|
||||
|
||||
// Token: 0x04007303 RID: 29443
|
||||
[FieldOffset(Offset = "0x48")]
|
||||
[Token(Token = "0x4007303")]
|
||||
private ISP80090Drbg mDrbg;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user