当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4364:Matrix operation

题目描述
  M_0 is interested in cryptography. Recently he learned the Advanced Encryption Standard (AES). AES operates on a 4×4 column-major order matrix of bytes and he found it that there is a step called the MixColumns step in the AES.
  In the MixColumns step, there is a state matrix, the four bytes of each column of the state are combined using an invertible linear transformation. The MixColumns function takes four bytes as input and outputs four bytes, where each input byte affects all four output bytes. Together with ShiftRows, MixColumns provides diffusion in the cipher.
  During this operation, each column is multiplied by the known matrix that for the 128 bit key is:

  The addition operation is defined as: xor.
  The multiplication operation is defined as:
  multiplication by 1 means no change
  multiplication by 2 means shifting to the left
  multiplication by 3 means shifting to the left and then performing xor with the initial unshifted value.
  Notice:After each shifting, a conditional xor with 0x1B should be performed if the shifted value is larger than 0xFF.
输入解释
There are several cases.
The first line is an integer T (T <= 20000), indicating the test cases.
Then is the state matrix, each case followed by four lines, each line contains four bytes, separated by spaces.
输出解释
For each case, output the new matrix of the state matrix after the MixColumns step. The output data for two different test cases should be separated by an empty line.
输入样例
1
00 01 02 03
04 05 06 07
08 09 0A 0B
0C 0D 0E 0F
输出样例
08 09 0A 0B
1C 1D 1E 1F
00 01 02 03
14 15 16 17
来自杭电HDUOJ的附加信息
Author FZU
Recommend zhuyuanchen520

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4364

最后修改于 2020-10-25T23:12:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)