BraintreeEncryption.Library.BouncyCastle.Crypto.Digests.Sha256Digest.ProcessBlock C# (CSharp) Method

ProcessBlock() private method

private ProcessBlock ( ) : void
return void
        internal override void ProcessBlock()
        {
            //
            // expand 16 word block into 64 word blocks.
            //
            for (int ti = 16; ti <= 63; ti++)
            {
                X[ti] = Theta1(X[ti - 2]) + X[ti - 7] + Theta0(X[ti - 15]) + X[ti - 16];
            }

            //
            // set up working variables.
            //
            uint a = H1;
            uint b = H2;
            uint c = H3;
            uint d = H4;
            uint e = H5;
            uint f = H6;
            uint g = H7;
            uint h = H8;

            int t = 0;
            for(int i = 0; i < 8; ++i)
            {
                // t = 8 * i
                h += Sum1Ch(e, f, g) + K[t] + X[t];
                d += h;
                h += Sum0Maj(a, b, c);
                ++t;

                // t = 8 * i + 1
                g += Sum1Ch(d, e, f) + K[t] + X[t];
                c += g;
                g += Sum0Maj(h, a, b);
                ++t;

                // t = 8 * i + 2
                f += Sum1Ch(c, d, e) + K[t] + X[t];
                b += f;
                f += Sum0Maj(g, h, a);
                ++t;

                // t = 8 * i + 3
                e += Sum1Ch(b, c, d) + K[t] + X[t];
                a += e;
                e += Sum0Maj(f, g, h);
                ++t;

                // t = 8 * i + 4
                d += Sum1Ch(a, b, c) + K[t] + X[t];
                h += d;
                d += Sum0Maj(e, f, g);
                ++t;

                // t = 8 * i + 5
                c += Sum1Ch(h, a, b) + K[t] + X[t];
                g += c;
                c += Sum0Maj(d, e, f);
                ++t;

                // t = 8 * i + 6
                b += Sum1Ch(g, h, a) + K[t] + X[t];
                f += b;
                b += Sum0Maj(c, d, e);
                ++t;

                // t = 8 * i + 7
                a += Sum1Ch(f, g, h) + K[t] + X[t];
                e += a;
                a += Sum0Maj(b, c, d);
                ++t;
            }

            H1 += a;
            H2 += b;
            H3 += c;
            H4 += d;
            H5 += e;
            H6 += f;
            H7 += g;
            H8 += h;

            //
            // reset the offset and clean out the word buffer.
            //
            xOff = 0;
            Array.Clear(X, 0, 16);
        }