27 {
28 int num = -1;
29 int num2 = -1;
30 (HashAlgorithmName, int, int)[]
array = s_uvLookup;
31 for (
int i = 0;
i <
array.Length;
i++)
32 {
33 (HashAlgorithmName, int, int) tuple =
array[i];
34 if (tuple.Item1 == hashAlgorithm)
35 {
36 num = tuple.Item2;
37 num2 = tuple.Item3;
38 break;
39 }
40 }
41 if (num == -1)
42 {
44 }
45 int num3 = num2 >> 3;
46 Span<byte> span = stackalloc byte[num3];
47 span.Fill(id);
48 int num4 = (salt.Length - 1 + num3) / num3 * num3;
49 int num5 = checked((password.
Length + 1) * 2);
50 if (password == default(ReadOnlySpan<char>))
51 {
52 num5 = 0;
53 }
54 int num6 = (num5 - 1 + num3) / num3 * num3;
55 int num7 = num4 + num6;
56 Span<byte> span2 = default(Span<byte>);
57 byte[] array2 = null;
58 if (num7 <= 1024)
59 {
60 span2 = stackalloc byte[num7];
61 }
62 else
63 {
65 span2 = array2.AsSpan(0, num7);
66 }
67 IncrementalHash incrementalHash = IncrementalHash.CreateHash(hashAlgorithm);
68 try
69 {
72 Span<byte> span3 = stackalloc byte[num >> 3];
73 Span<byte> span4 = stackalloc byte[num3];
74 while (true)
75 {
76 incrementalHash.AppendData(span);
77 incrementalHash.AppendData(span2);
78 for (int num8 = iterationCount; num8 > 0; num8--)
79 {
80 if (!incrementalHash.TryGetHashAndReset(span3, out var bytesWritten) || bytesWritten != span3.Length)
81 {
82 throw new CryptographicException();
83 }
84 if (num8 != 1)
85 {
86 incrementalHash.AppendData(span3);
87 }
88 }
90 {
91 break;
92 }
96 for (int num9 = span2.Length / num3 - 1; num9 >= 0; num9--)
97 {
98 Span<byte> into = span2.Slice(num9 * num3, num3);
100 }
101 }
103 }
104 finally
105 {
106 CryptographicOperations.ZeroMemory(span2);
107 if (array2 != null)
108 {
110 }
111 incrementalHash.Dispose();
112 }
113 }
static string Cryptography_UnknownHashAlgorithm
static void Return(byte[] array, int clearSize=-1)
static byte[] Rent(int minimumLength)
static void AddPlusOne(Span< byte > into, Span< byte > addend)
static void CircularCopy(ReadOnlySpan< byte > bytes, Span< byte > destination)
static void CircularCopyUtf16BE(ReadOnlySpan< char > password, Span< byte > destination)