using System; using System.Threading; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng { // Token: 0x02001BCD RID: 7117 [Token(Token = "0x2001BCD")] public class ThreadedSeedGenerator { // Token: 0x0600B1F3 RID: 45555 RVA: 0x0026BD78 File Offset: 0x00269F78 [Token(Token = "0x600B1F3")] [Address(RVA = "0x18A4BF0", Offset = "0x18A39F0", VA = "0x1818A4BF0")] public byte[] GenerateSeed(int numBytes, bool fast) { return new ThreadedSeedGenerator.SeedGenerator().GenerateSeed(numBytes, fast); } // Token: 0x0600B1F4 RID: 45556 RVA: 0x0026BD98 File Offset: 0x00269F98 [Token(Token = "0x600B1F4")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] public ThreadedSeedGenerator() { } // Token: 0x02001BCE RID: 7118 [Token(Token = "0x2001BCE")] private class SeedGenerator { // Token: 0x0600B1F5 RID: 45557 RVA: 0x0026BDAC File Offset: 0x00269FAC [Token(Token = "0x600B1F5")] [Address(RVA = "0x18A40F0", Offset = "0x18A2EF0", VA = "0x1818A40F0")] private void Run(object ignored) { while (!this.stop) { int num = this.counter + 1; this.counter = num; if (this.stop) { break; } } } // Token: 0x0600B1F6 RID: 45558 RVA: 0x0026BDDC File Offset: 0x00269FDC [Token(Token = "0x600B1F6")] [Address(RVA = "0x18A3FE0", Offset = "0x18A2DE0", VA = "0x1818A3FE0")] public byte[] GenerateSeed(int numBytes, bool fast) { int num; byte[] array; do { num = 0; ThreadPriority priority = Thread.CurrentThread.Priority; Thread.CurrentThread.Priority = ThreadPriority.Normal; array = this.DoGenerateSeed(numBytes, fast); Thread.CurrentThread.SetPriorityNative(numBytes); } while (num != 0); return array; } // Token: 0x0600B1F7 RID: 45559 RVA: 0x0026BE30 File Offset: 0x0026A030 [Token(Token = "0x600B1F7")] [Address(RVA = "0x18A3E30", Offset = "0x18A2C30", VA = "0x1818A3E30")] private byte[] DoGenerateSeed(int numBytes, bool fast) { int num = 0; this.counter = num; this.stop = num != 0; byte[] array = new byte[numBytes]; WaitCallback waitCallback = new WaitCallback(this.Run); int num2 = 0; bool flag = ThreadPool.QueueUserWorkItem(waitCallback); if (this.counter == num) { Thread.Sleep(1); } int num3 = this.counter; num += num2; byte b; b += b; num++; int length = array.Length; num++; this.stop = true; return array; } // Token: 0x0600B1F8 RID: 45560 RVA: 0x0026BEAC File Offset: 0x0026A0AC [Token(Token = "0x600B1F8")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] public SeedGenerator() { } // Token: 0x0400715D RID: 29021 [FieldOffset(Offset = "0x10")] [Token(Token = "0x400715D")] private int counter; // Token: 0x0400715E RID: 29022 [FieldOffset(Offset = "0x14")] [Token(Token = "0x400715E")] private bool stop; } } }