130 lines
3.1 KiB
C#
130 lines
3.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg
|
|
{
|
|
// Token: 0x02001BD4 RID: 7124
|
|
[Token(Token = "0x2001BD4")]
|
|
internal class DrbgUtilities
|
|
{
|
|
// Token: 0x0600B222 RID: 45602 RVA: 0x0026CF34 File Offset: 0x0026B134
|
|
[Token(Token = "0x600B222")]
|
|
[Address(RVA = "0x1891A10", Offset = "0x1890810", VA = "0x181891A10")]
|
|
static DrbgUtilities()
|
|
{
|
|
IDictionary dictionary = Platform.CreateHashtable();
|
|
}
|
|
|
|
// Token: 0x0600B223 RID: 45603 RVA: 0x0026CF50 File Offset: 0x0026B150
|
|
[Token(Token = "0x600B223")]
|
|
[Address(RVA = "0x18912C0", Offset = "0x18900C0", VA = "0x1818912C0")]
|
|
internal static int GetMaxSecurityStrength(IDigest d)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B224 RID: 45604 RVA: 0x0026CF64 File Offset: 0x0026B164
|
|
[Token(Token = "0x600B224")]
|
|
[Address(RVA = "0x1891390", Offset = "0x1890190", VA = "0x181891390")]
|
|
internal static int GetMaxSecurityStrength(IMac m)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x0600B225 RID: 45605 RVA: 0x0026CF80 File Offset: 0x0026B180
|
|
[Token(Token = "0x600B225")]
|
|
[Address(RVA = "0x1891490", Offset = "0x1890290", VA = "0x181891490")]
|
|
internal static byte[] HashDF(IDigest digest, byte[] seedMaterial, int seedLength)
|
|
{
|
|
byte[] array = new byte[seedMaterial];
|
|
byte[] array2 = new byte[array.Length];
|
|
int num = 0;
|
|
if (num < digest)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
num += num;
|
|
num++;
|
|
num += num;
|
|
num++;
|
|
num += num;
|
|
num++;
|
|
num += num;
|
|
num++;
|
|
int num2 = seedMaterial.Length;
|
|
uint num3;
|
|
if (num < (int)num3)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
if (num < num2)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
int num4 = array2.Length;
|
|
num2 = num4;
|
|
int num5 = array.Length;
|
|
num5 -= num2;
|
|
if (num5 <= num4)
|
|
{
|
|
num4 = num5;
|
|
}
|
|
int num6 = 0;
|
|
Array.Copy(array2, num6, array, num2, num4);
|
|
if (seedLength != 0)
|
|
{
|
|
uint num7;
|
|
num7 -= (uint)seedLength;
|
|
int length = array.Length;
|
|
if (num != length)
|
|
{
|
|
num++;
|
|
byte b;
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
b += b;
|
|
b = (byte)((int)b + seedLength);
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600B226 RID: 45606 RVA: 0x0026D0A4 File Offset: 0x0026B2A4
|
|
[Token(Token = "0x600B226")]
|
|
[Address(RVA = "0x1891A00", Offset = "0x1890800", VA = "0x181891A00")]
|
|
internal static bool IsTooLarge(byte[] bytes, int maxBytes)
|
|
{
|
|
if (bytes == 0)
|
|
{
|
|
}
|
|
return bytes.Length > maxBytes;
|
|
}
|
|
|
|
// Token: 0x0600B227 RID: 45607 RVA: 0x0026D0C0 File Offset: 0x0026B2C0
|
|
[Token(Token = "0x600B227")]
|
|
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
|
|
public DrbgUtilities()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04007181 RID: 29057
|
|
[Token(Token = "0x4007181")]
|
|
private static readonly IDictionary maxSecurityStrengths;
|
|
}
|
|
}
|