如何解决与jpbc库相关的以下错误?

时间:2014-04-08 11:30:37

标签: java java-api

我使用JPBC库来实现基于配对的算法 我已经在java类路径中包含了所有必需的jar文件,但我仍然收到此错误,

import it.unisa.dia.gas.jpbc.CurveGenerator;
import it.unisa.dia.gas.jpbc.CurveParameters;
import it.unisa.dia.gas.plaf.jpbc.pairing.a.TypeACurveGenerator;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;
import it.unisa.dia.gas.jpbc.Pairing;
import java.security.SecureRandom;

public class Sensor{
public static void main(String args[])
{
    SecureRandom rand = new SecureRandom();
    int rbits = 160;
    int qbits = 512;
    CurveGenerator crvGen = new TypeACurveGenerator(rbits, qbits);
    CurveParameters params = crvGen.generate();
    System.out.println(params);
    PairingFactory.getInstance().setUsePBCWhenPossible(true);
    Pairing pairing = PairingFactory.getPairing(params, rand);
 }
}

每当我尝试运行此代码时,我都会收到以下错误:

 java.lang.UnsatisfiedLinkError: Unable to load library 'jpbc-pbc': The specified 
 module could not be found.

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)

0 个答案:

没有答案