MCPcopy Create free account
hub / github.com/f0ng/autoDecoder / sm4_setkey_enc

Method sm4_setkey_enc

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

Source from the content-addressed store, hash-verified

211 }
212
213 public void sm4_setkey_enc(SM4_Context ctx, byte[] key) throws Exception {
214 if (ctx == null) {
215 throw new Exception("ctx is null!");
216 }
217
218 if (key == null || key.length != 16) {
219 throw new Exception("key error!");
220 }
221
222 ctx.mode = SM4_ENCRYPT;
223 sm4_setkey(ctx.sk, key);
224 }
225
226 public void sm4_setkey_dec(SM4_Context ctx, byte[] key) throws Exception {
227 if (ctx == null) {

Callers 2

encryptData_ECBMethod · 0.95
encryptData_CBCMethod · 0.95

Calls 1

sm4_setkeyMethod · 0.95

Tested by

no test coverage detected