Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Drain()

void System.Sha1ForNonSecretPurposes.Drain ( )
inlineprivate

Definition at line 73 of file Sha1ForNonSecretPurposes.cs.

74 {
75 for (int i = 16; i != 80; i++)
76 {
77 _w[i] = BitOperations.RotateLeft(_w[i - 3] ^ _w[i - 8] ^ _w[i - 14] ^ _w[i - 16], 1);
78 }
79 uint num = _w[80];
80 uint num2 = _w[81];
81 uint num3 = _w[82];
82 uint num4 = _w[83];
83 uint num5 = _w[84];
84 for (int j = 0; j != 20; j++)
85 {
86 uint num6 = (num2 & num3) | (~num2 & num4);
87 uint num7 = BitOperations.RotateLeft(num, 5) + num6 + num5 + 1518500249 + _w[j];
88 num5 = num4;
89 num4 = num3;
90 num3 = BitOperations.RotateLeft(num2, 30);
91 num2 = num;
92 num = num7;
93 }
94 for (int k = 20; k != 40; k++)
95 {
96 uint num8 = num2 ^ num3 ^ num4;
97 uint num9 = BitOperations.RotateLeft(num, 5) + num8 + num5 + 1859775393 + _w[k];
98 num5 = num4;
99 num4 = num3;
100 num3 = BitOperations.RotateLeft(num2, 30);
101 num2 = num;
102 num = num9;
103 }
104 for (int l = 40; l != 60; l++)
105 {
106 uint num10 = (num2 & num3) | (num2 & num4) | (num3 & num4);
107 uint num11 = (uint)((int)(BitOperations.RotateLeft(num, 5) + num10 + num5) + -1894007588) + _w[l];
108 num5 = num4;
109 num4 = num3;
110 num3 = BitOperations.RotateLeft(num2, 30);
111 num2 = num;
112 num = num11;
113 }
114 for (int m = 60; m != 80; m++)
115 {
116 uint num12 = num2 ^ num3 ^ num4;
117 uint num13 = (uint)((int)(BitOperations.RotateLeft(num, 5) + num12 + num5) + -899497514) + _w[m];
118 num5 = num4;
119 num4 = num3;
120 num3 = BitOperations.RotateLeft(num2, 30);
121 num2 = num;
122 num = num13;
123 }
124 _w[80] += num;
125 _w[81] += num2;
126 _w[82] += num3;
127 _w[83] += num4;
128 _w[84] += num5;
129 _length += 512L;
130 _pos = 0;
131 }
static uint RotateLeft(uint value, int offset)

References System.Sha1ForNonSecretPurposes._length, System.Sha1ForNonSecretPurposes._pos, System.Sha1ForNonSecretPurposes._w, System.L, and System.Numerics.BitOperations.RotateLeft().

Referenced by System.Sha1ForNonSecretPurposes.Append().