コード例 #1
0
ファイル: SBox.cs プロジェクト: khayrulislam/AES-Tool
        private void InitializeBox()
        {
            InitializeArray();
            //Properties.Resources.
            File_Reader     dReader          = new File_Reader();
            List <string[]> sBoxlines        = dReader.GetWordList(Properties.Resources.sbox);
            List <string[]> inverseSBoxlines = dReader.GetWordList(Properties.Resources.inversesbox);

            for (int i = 0; i < sBoxlines.Count; i++)
            {
                for (int j = 0; j < sBoxlines[i].Length; j++)
                {
                    sBox[i][j]        = Util.GetByte(sBoxlines[i][j]);
                    inverseSBox[i][j] = Util.GetByte(inverseSBoxlines[i][j]);
                }
            }
        }
コード例 #2
0
        private void InitializeMixColumnMatrix()
        {
            File_Reader     dReader      = new File_Reader();
            List <string[]> lines        = dReader.GetWordList(Properties.Resources.mixcolumn);
            List <string[]> inverseLines = dReader.GetWordList(Properties.Resources.inversemixcolumn);

            matrix        = new byte[Properties.Settings.Default.BLOCK_ROW_SIZE][];
            inverseMatrix = new byte[Properties.Settings.Default.BLOCK_ROW_SIZE][];

            for (int i = 0; i < lines.Count; i++)
            {
                matrix[i]        = new byte[lines[i].Length];
                inverseMatrix[i] = new byte[inverseLines[i].Length];
                for (int j = 0; j < lines[i].Length; j++)
                {
                    matrix[i][j]        = Util.GetByte(lines[i][j]);
                    inverseMatrix[i][j] = Util.GetByte(inverseLines[i][j]);
                }
            }
        }
コード例 #3
0
        private void InitializeKeyConstant()
        {
            File_Reader     dReader = new File_Reader();
            List <string[]> lines   = dReader.GetWordList(Properties.Resources.key);

            this.KeyConstant = new byte[lines.Count][];

            for (int i = 0; i < lines.Count; i++)
            {
                this.KeyConstant[i] = new byte[lines[i].Length];
                for (int j = 0; j < lines[i].Length; j++)
                {
                    this.KeyConstant[i][j] = Util.GetByte(lines[i][j]);
                }
            }
        }