Exemplo n.º 1
0
        public static void SubBytes(byte[] state)
        {
            CheckState(state);

            SBox sBox = SBox.GetInstance();

            for (int i = 0; i < state.Length; i++)
            {
                state[i] = sBox.Substitute(state[i]);
            }
        }
Exemplo n.º 2
0
        public static uint SubWord(uint word)
        {
            byte[] bytes = BitConverter.GetBytes(word);
            SBox   sBox  = SBox.GetInstance();

            for (int i = 0; i < sizeof(int); i++)
            {
                bytes[i] = sBox.Substitute(bytes[i]);
            }
            return(BitConverter.ToUInt32(bytes));
        }