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]); } }
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)); }