Java 类org.bouncycastle.crypto.signers.ECNRSigner 实例源码

项目:ipack    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:ipack    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:ipack    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:ipack    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:ipack    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:gwt-crypto    文件:ECNRTest.java   
private void ecNR239bitPrime()
{
    BigInteger n = new BigInteger("883423532389192164791648750360308884807550341691627752275345424702807307");

    ECCurve.Fp curve = new ECCurve.Fp(
        new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), // q
        new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
        new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16), // b
        n, ECConstants.ONE);

    ECDomainParameters params = new ECDomainParameters(
        curve,
        curve.decodePoint(Hex.decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")), // G
        n);

    ECPrivateKeyParameters priKey = new ECPrivateKeyParameters(
        new BigInteger("876300101507107567501066130761671078357010671067781776716671676178726717"), // d
        params);

    ECNRSigner ecnr = new ECNRSigner();
    ParametersWithRandom param = new ParametersWithRandom(priKey, k);

    ecnr.init(true, param);

    byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray();
    BigInteger[] sig = ecnr.generateSignature(message);

    if (!r.equals(sig[0]))
    {
        fail("r component wrong.", r, sig[0]);
    }

    if (!s.equals(sig[1]))
    {
        fail("s component wrong.", s, sig[1]);
    }

    // Verify the signature
    ECPublicKeyParameters pubKey = new ECPublicKeyParameters(
        curve.decodePoint(Hex.decode("025b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c70")), // Q
        params);

    ecnr.init(false, pubKey);
    if (!ecnr.verifySignature(message, sig[0], sig[1]))
    {
        fail("signature fails");
    }
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:Aki-SSL    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:CryptMeme    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:ECNRTest.java   
private void ecNR239bitPrime()
{
    ECCurve.Fp curve = new ECCurve.Fp(
        new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), // q
        new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
        new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

    ECDomainParameters params = new ECDomainParameters(
        curve,
        curve.decodePoint(Hex.decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")), // G
        new BigInteger("883423532389192164791648750360308884807550341691627752275345424702807307")); // n

    ECPrivateKeyParameters priKey = new ECPrivateKeyParameters(
        new BigInteger("876300101507107567501066130761671078357010671067781776716671676178726717"), // d
        params);

    ECNRSigner ecnr = new ECNRSigner();
    ParametersWithRandom param = new ParametersWithRandom(priKey, k);

    ecnr.init(true, param);

    byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray();
    BigInteger[] sig = ecnr.generateSignature(message);

    if (!r.equals(sig[0]))
    {
        fail("r component wrong.", r, sig[0]);
    }

    if (!s.equals(sig[1]))
    {
        fail("s component wrong.", s, sig[1]);
    }

    // Verify the signature
    ECPublicKeyParameters pubKey = new ECPublicKeyParameters(
        curve.decodePoint(Hex.decode("025b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c70")), // Q
        params);

    ecnr.init(false, pubKey);
    if (!ecnr.verifySignature(message, sig[0], sig[1]))
    {
        fail("signature fails");
    }
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:irma_future_id    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:ECNRTest.java   
private void ecNR239bitPrime()
{
    ECCurve.Fp curve = new ECCurve.Fp(
        new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), // q
        new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
        new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

    ECDomainParameters params = new ECDomainParameters(
        curve,
        curve.decodePoint(Hex.decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")), // G
        new BigInteger("883423532389192164791648750360308884807550341691627752275345424702807307")); // n

    ECPrivateKeyParameters priKey = new ECPrivateKeyParameters(
        new BigInteger("876300101507107567501066130761671078357010671067781776716671676178726717"), // d
        params);

    ECNRSigner ecnr = new ECNRSigner();
    ParametersWithRandom param = new ParametersWithRandom(priKey, k);

    ecnr.init(true, param);

    byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").toByteArray();
    BigInteger[] sig = ecnr.generateSignature(message);

    if (!r.equals(sig[0]))
    {
        fail("r component wrong.", r, sig[0]);
    }

    if (!s.equals(sig[1]))
    {
        fail("s component wrong.", s, sig[1]);
    }

    // Verify the signature
    ECPublicKeyParameters pubKey = new ECPublicKeyParameters(
        curve.decodePoint(Hex.decode("025b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c70")), // Q
        params);

    ecnr.init(false, pubKey);
    if (!ecnr.verifySignature(message, sig[0], sig[1]))
    {
        fail("signature fails");
    }
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR()
{
    super(new SHA1Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR224()
{
    super(new SHA224Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR256()
{
    super(new SHA256Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR384()
{
    super(new SHA384Digest(), new ECNRSigner(), new StdDSAEncoder());
}
项目:bc-java    文件:SignatureSpi.java   
public ecNR512()
{
    super(new SHA512Digest(), new ECNRSigner(), new StdDSAEncoder());
}