Package gnu.java.security.hash

Examples of gnu.java.security.hash.Sha160.digest()


    harness.check(bob.verify(signature), "instance methods");

    IMessageDigest sha = new Sha160();
    sha.update(message, 0, message.length);
    byte[] hash = sha.digest();
    BigInteger[] rs = DSSSignature.sign(privateK, hash);

    harness.check(DSSSignature.verify(publicK, hash, rs), "class methods");
  }
}
View Full Code Here


   md.update(bytes, 0, 8);
  }
  int ofs = offset;
  while (len-- > 0)
  {
   bytes = md.digest();
   buf[ofs++] = bytes[0];
   md.update(bytes, 1, md.hashSize() - 1);
  }
  return ofs - offset;
}
View Full Code Here

     {
       private final Sha160 adaptee = new Sha160();

       public byte[] engineDigest()
       {
         return adaptee.digest();
       }

       public int engineDigest(byte[] buf, int offset, int len)
         throws java.security.DigestException
       {
View Full Code Here

         throws java.security.DigestException
       {
        int result = adaptee.hashSize();
        if (len < result)
          throw new java.security.DigestException();
        System.arraycopy(adaptee.digest(), 0, buf, offset, result);
        return result;
       }

       public int engineGetDigestLength()
       {
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.