예제 #1
0
        public static byte Replace(string bte)
        {
            if (tableESingleton == null)
            {
                TableE.tableESingleton = new TableE();
            }
            var byteStr = bte.ToCharArray();

            return(TableE.tableESingleton.tableE[Convert.ToInt32(byteStr[0].ToString(), 16), Convert.ToInt32(byteStr[1].ToString(), 16)]);
        }
예제 #2
0
        private int nvl(int val1, int val2, int i, int j, int roundKey, int vt)
        {
            var val1Result = (ValidateWidthValue(TableL.Replace(val1.ToString("X2")) + TableL.Replace(val2.ToString("X2")))).ToString("X2");

            if (val1.Equals(0) || val2.Equals(0))
            {
                return(0);
            }
            if (val1.Equals(1))
            {
                return(val2);
            }
            if (val2.Equals(1))
            {
                return(val1);
            }
            var vr = TableE.Replace(ValidateWidthValue(TableL.Replace(val1.ToString("X2")) + TableL.Replace(val2.ToString("X2"))).ToString("X2"));

            return(vr);
        }