CSharpRTMP.Core.Protocols.Rtmfp.AESEngine.GetEncryptKey C# (CSharp) Method

GetEncryptKey() private method

private GetEncryptKey ( byte key ) : System.UInt32[]
key byte
return System.UInt32[]
        private UInt32[] GetEncryptKey(byte[] key)
        {
            var encryptKey = new UInt32[4*(AES_MAXNR + 1)];

            encryptKey[0] = GetU32(key);
            encryptKey[1] = GetU32(key,4);
            encryptKey[2] = GetU32(key,8);
            encryptKey[3] = GetU32(key,12);

            UInt32 temp;
            int i = 0;
            if (bits == 128)
            {
                while (true)
                {
                    temp = encryptKey[3 + i*4];
                    encryptKey[4 + i*4] = encryptKey[0 + i*4] ^
                                          (Te2[(temp >> 16) & 0xff] & 0xff000000) ^
                                          (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
                                          (Te0[(temp) & 0xff] & 0x0000ff00) ^
                                          (Te1[(temp >> 24)] & 0x000000ff) ^
                                          rcon[i];
                    encryptKey[5 + i*4] = encryptKey[1 + i*4] ^ encryptKey[4 + i*4];
                    encryptKey[6 + i*4] = encryptKey[2 + i*4] ^ encryptKey[5 + i*4];
                    encryptKey[7 + i*4] = encryptKey[3 + i*4] ^ encryptKey[6 + i*4];
                    if (++i == 10)
                    {
                        break;
                    }
                }
            }
            return encryptKey;
        }