package com.glxp.mipsdl.util;

import cn.hutool.core.util.StrUtil;
import com.sun.tools.javac.Main;

public class DdlUtils {
    static {
//        String path = System.getProperty("user.dir");
//        path = path + "/dll/hsafsiyhsafe.dll";
//        System.out.println(path);
        System.loadLibrary("hsafsiyhsafe"); //
    }

    public native int gm_ecb_encrypt_key(String pub_key, String plain, int plain_len, String cipher);

    public native int gm_ecb_decrypt_key(String pub_key, String cipher, int cipher_len, String plain);


    public static void main(String[] args) {
        DdlUtils ddlUtils = new DdlUtils();
        String key = "D7F322E4541DB0C48EB7B0AF2093BEE3F1AC6A3FAB1BDE30E72816571EEC50B7";
        String code = "H51072700564";
        String data = "";
        ddlUtils.gm_ecb_decrypt_key(code, key, key.length(), data);
    }

}
