示例#1
0
 /// <summary>
 ///     生成S盒选择项的行号列号
 /// </summary>
 /// <param name="input">输入(48位)</param>
 /// <param name="firstBit">第一位位置(从此位置向后取6位)</param>
 /// <param name="row">产生的行号</param>
 /// <param name="col">产生的列号</param>
 private static void GenerateRowAndColumnNumber(BitArray input, int firstBit, out int row, out int col)
 {
     int lastBit = firstBit + 5;
     BitArray columnArray = new BitArray(4);
     BitArray rowArray = new BitArray(2);
     rowArray[0] = input[firstBit];
     rowArray[1] = input[lastBit];
     columnArray[0] = input[firstBit + 1];
     columnArray[1] = input[firstBit + 2];
     columnArray[2] = input[firstBit + 3];
     columnArray[3] = input[firstBit + 4];
     row = rowArray.ToInt32();
     col = columnArray.ToInt32();
 }