Applies the inverse Rijndael MixColumns for decryption to the input and returns the result.
(BigInteger ciphertext)
| 2660 | * returns the result. |
| 2661 | */ |
| 2662 | public static BigInteger mixColumnsDec(BigInteger ciphertext) { |
| 2663 | int[] cells = splitBlockIntoCells(ciphertext); |
| 2664 | int[] outputCells = new int[16]; |
| 2665 | |
| 2666 | for (int i = 0; i < 4; i++) { |
| 2667 | int[] row = { |
| 2668 | cells[i * 4], |
| 2669 | cells[i * 4 + 1], |
| 2670 | cells[i * 4 + 2], |
| 2671 | cells[i * 4 + 3], |
| 2672 | }; |
| 2673 | |
| 2674 | outputCells[i * 4] = MULT14[row[0]] ^ MULT11[row[1]] ^ MULT13[row[2]] ^ MULT9[row[3]]; |
| 2675 | outputCells[i * 4 + 1] = MULT9[row[0]] ^ MULT14[row[1]] ^ MULT11[row[2]] ^ MULT13[row[3]]; |
| 2676 | outputCells[i * 4 + 2] = MULT13[row[0]] ^ MULT9[row[1]] ^ MULT14[row[2]] ^ MULT11[row[3]]; |
| 2677 | outputCells[i * 4 + 3] = MULT11[row[0]] ^ MULT13[row[1]] ^ MULT9[row[2]] ^ MULT14[row[3]]; |
| 2678 | } |
| 2679 | return mergeCellsIntoBlock(outputCells); |
| 2680 | } |
| 2681 | |
| 2682 | /** |
| 2683 | * Encrypts the plaintext with the key and returns the result |
no test coverage detected