private static void Transform(int i, int[] buffer, int messageLenBytes, byte[] message, byte[] paddingBytes, int[] state) {
        int index = i << 6;
        for (int j = 0; j < 64; j++, index++) {
            buffer[j >>> 2] = ((int) ((index < messageLenBytes) ? message[index] : paddingBytes[index - messageLenBytes]) << 24) | (buffer[j >>> 2] >>> 8);
        } // end for
        int a = state[0];
        int b = state[1];
        int c = state[2];
        int d = state[3];
        for (int k = 0; k < 64; k++) {
            int div16 = k >>> 4;
            int f = 0;
            int bufferIndex = k;
            switch (div16) {
                case 0:
                    f = (state[1] & state[2]) | (~state[1] & state[3]);
                    break;
                    
                case 1:
                    f = (state[1] & state[3]) | (state[2] & ~state[3]);
                    bufferIndex = (bufferIndex * 5 + 1) & 0x0F;
                    break;
                    
                case 2:
                    f = state[1] ^ state[2] ^ state[3];
                    bufferIndex = (bufferIndex * 3 + 5) & 0x0F;
                    break;
                    
                case 3:
                    f = state[2] ^ (state[1] | ~state[3]);
                    bufferIndex = (bufferIndex * 7) & 0x0F;
                    break;
                    // end switch
            } // end for
            int temp = state[1] + Integer.rotateLeft(state[0] + f + buffer[bufferIndex] + T_TABLE[k], S_TABLE[(div16 << 2) | (k & 3)]);
            state[0] = state[3];
            state[3] = state[2];
            state[2] = state[1];
            state[1] = temp;
        } // end for

        state[0] += a;
        state[1] += b;
        state[2] += c;
        state[3] += d;
    }