Examples of doHash()


Examples of makwa.Makwa.doHash()

     * check a test vector.
     */
    byte[] salt = new byte[] { 1, 2, 3, 4 };
    byte[] input = "sample for PHC".getBytes("UTF-8");
    Makwa m = new Makwa(PHC_PUB2048, 0, false, 0, 4096);
    byte[] out = m.doHash(input, salt, true, 16, 8192);
    byte[] ref = new byte[] {
      (byte)0x1d, (byte)0x4f, (byte)0x1b, (byte)0x05,
      (byte)0x58, (byte)0xe9, (byte)0x60, (byte)0xce,
      (byte)0x11, (byte)0xad, (byte)0xd5, (byte)0x20,
      (byte)0xca, (byte)0x9e, (byte)0x28, (byte)0xf3
View Full Code Here

Examples of makwa.Makwa.doHash()

    long ttprev = 0;
    byte[] input = new byte[9];
    for (;;) {
      long begin = System.currentTimeMillis();
      byte[] salt = Makwa.createSalt();
      mpub.doHash(input, salt, true, 16, w);
      long end = System.currentTimeMillis();
      long tt = end - begin;
      if (tt > 4000) {
        System.out.printf("wf/s = %.2f",
          (1000.0 * (w - wprev)) / (tt - ttprev));
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.