(long[] sk, byte[] input, byte[] output)
| 149 | } |
| 150 | |
| 151 | private void sm4_one_round(long[] sk, byte[] input, byte[] output) { |
| 152 | int i = 0; |
| 153 | long[] ulbuf = new long[36]; |
| 154 | ulbuf[0] = GET_ULONG_BE(input, 0); |
| 155 | ulbuf[1] = GET_ULONG_BE(input, 4); |
| 156 | ulbuf[2] = GET_ULONG_BE(input, 8); |
| 157 | ulbuf[3] = GET_ULONG_BE(input, 12); |
| 158 | while (i < 32) { |
| 159 | ulbuf[(i + 4)] = sm4F(ulbuf[i], ulbuf[(i + 1)], ulbuf[(i + 2)], ulbuf[(i + 3)], sk[i]); |
| 160 | i++; |
| 161 | } |
| 162 | PUT_ULONG_BE(ulbuf[35], output, 0); |
| 163 | PUT_ULONG_BE(ulbuf[34], output, 4); |
| 164 | PUT_ULONG_BE(ulbuf[33], output, 8); |
| 165 | PUT_ULONG_BE(ulbuf[32], output, 12); |
| 166 | } |
| 167 | //修改了填充模式,为模式 |
| 168 | private byte[] padding(byte[] input, int mode) { |
| 169 | if (input == null) { |
no test coverage detected