MCPcopy Index your code
hub / github.com/f0ng/autoDecoder / sm4_setkey_dec

Method sm4_setkey_dec

src/com/autoDecoder/util/SM4.java:226–241  ·  view source on GitHub ↗
(SM4_Context ctx, byte[] key)

Source from the content-addressed store, hash-verified

224 }
225
226 public void sm4_setkey_dec(SM4_Context ctx, byte[] key) throws Exception {
227 if (ctx == null) {
228 throw new Exception("ctx is null!");
229 }
230
231 if (key == null || key.length != 16) {
232 throw new Exception("key error!");
233 }
234
235 int i = 0;
236 ctx.mode = SM4_DECRYPT;
237 sm4_setkey(ctx.sk, key);
238 for (i = 0; i < 16; i++) {
239 SWAP(ctx.sk, i);
240 }
241 }
242
243 public byte[] sm4_crypt_ecb(SM4_Context ctx, byte[] input) throws Exception {
244 if (input == null) {

Callers 2

decryptData_ECBMethod · 0.95
decryptData_CBCMethod · 0.95

Calls 2

sm4_setkeyMethod · 0.95
SWAPMethod · 0.95

Tested by

no test coverage detected