private static byte[] ToSm4Hash(this byte[] input, byte[] key, byte[] iv) { var sm4 = new Sm4(); var ctx = new Sm4Context { IsPadding = true }; sm4.SetKeyEnc(ctx, key); return(sm4.EncryptCBC(ctx, iv, input)); }
private byte[] buildSM4Key(String factor, String key) { byte[] keys = HexStringToBytes(key); return(Sm4.EncriptB(keys, getFactor(factor))); }