Package com.bitsofproof.supernode.common

Examples of com.bitsofproof.supernode.common.ECKeyPair.sign()


    {
      JSONObject test = tests.getJSONObject (i);
      ECKeyPair key = ECKeyPair.parseWIF (test.getString ("key"));
      byte[] message = test.getString ("message").getBytes ();
      byte[] expectedSignature = ByteUtils.fromHex (test.getString ("expectedSignature"));
      byte[] signature = key.sign (message);
      assertTrue (Arrays.equals (expectedSignature, signature));
    }
  }
}
View Full Code Here


  public void testECDSASpeed () throws ValidationException
  {
    ECKeyPair key = ECKeyPair.createNew (true);
    byte[] data = new byte[32];
    random.nextBytes (data);
    byte[] signature = key.sign (data);
    long cpu = -mxb.getCurrentThreadUserTime ();
    for ( int i = 0; i < 100; ++i )
    {
      assertTrue (key.verify (data, signature));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.