org.bouncycastle.jce.provider.test
Class ECNRTest

java.lang.Object
  extended by org.bouncycastle.util.test.SimpleTest
      extended by org.bouncycastle.jce.provider.test.ECNRTest
All Implemented Interfaces:
Test

public class ECNRTest
extends SimpleTest


Field Summary
(package private)  byte[] k1
           
(package private)  byte[] k2
           
(package private)  java.security.SecureRandom random
           
 
Constructor Summary
ECNRTest()
           
 
Method Summary
private  void checkSignature(int size, ECPrivateKeySpec priKey, ECPublicKeySpec pubKey, java.security.Signature sgr, java.security.SecureRandom k, byte[] message, java.math.BigInteger r, java.math.BigInteger s)
           
protected  java.math.BigInteger[] derDecode(byte[] encoding)
           
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
 void performTest()
           
private  void testECNR192bitPrime()
          X9.62 - 1998,
Page 104-105, ECDSA over the field Fp
an example with 192 bit prime
private  void testECNR239bitPrime()
          X9.62 - 1998,
J.3.2, Page 155, ECDSA over the field Fp
an example with 239 bit prime
private  void testECNR521bitPrime()
          SEC 2: Recommended Elliptic Curve Domain Parameters - September 2000,
Page 17-19, Recommended 521-bit Elliptic Curve Domain Parameters over Fp
an ECC example with a 521 bit prime and a 512 bit hash
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, fail, fail, fail, perform, runTest, runTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

k1

byte[] k1

k2

byte[] k2

random

java.security.SecureRandom random
Constructor Detail

ECNRTest

public ECNRTest()
Method Detail

testECNR239bitPrime

private void testECNR239bitPrime()
                          throws java.lang.Exception
X9.62 - 1998,
J.3.2, Page 155, ECDSA over the field Fp
an example with 239 bit prime

Throws:
java.lang.Exception

testECNR192bitPrime

private void testECNR192bitPrime()
                          throws java.lang.Exception
X9.62 - 1998,
Page 104-105, ECDSA over the field Fp
an example with 192 bit prime

Throws:
java.lang.Exception

testECNR521bitPrime

private void testECNR521bitPrime()
                          throws java.lang.Exception
SEC 2: Recommended Elliptic Curve Domain Parameters - September 2000,
Page 17-19, Recommended 521-bit Elliptic Curve Domain Parameters over Fp
an ECC example with a 521 bit prime and a 512 bit hash

Throws:
java.lang.Exception

checkSignature

private void checkSignature(int size,
                            ECPrivateKeySpec priKey,
                            ECPublicKeySpec pubKey,
                            java.security.Signature sgr,
                            java.security.SecureRandom k,
                            byte[] message,
                            java.math.BigInteger r,
                            java.math.BigInteger s)
                     throws java.lang.Exception
Throws:
java.lang.Exception

derDecode

protected java.math.BigInteger[] derDecode(byte[] encoding)
                                    throws java.io.IOException
Throws:
java.io.IOException

getName

public java.lang.String getName()
Specified by:
getName in interface Test
Specified by:
getName in class SimpleTest

performTest

public void performTest()
                 throws java.lang.Exception
Specified by:
performTest in class SimpleTest
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)