Package org.bouncycastle.crypto.digests

Examples of org.bouncycastle.crypto.digests.RIPEMD160Digest.doFinal()


        for (int i = 0; i < messages.length; i++)
        {
            byte[] m = messages[i].getBytes();
            digest.update(m, 0, m.length);
            digest.doFinal(resBuf, 0);

            if (!arraysEqual(resBuf, Hex.decode(digests[i])))
            {
                return new SimpleTestResult(false, getName() + ": Vector " + i + " failed");
            }
View Full Code Here


                + System.getProperty("line.separator")
                + "    got     : " + new String(Hex.encode(resBuf)));
        }

        d.update(m, m.length/2, m.length - m.length/2);
        d.doFinal(resBuf, 0);

        if (!arraysEqual(resBuf, Hex.decode(digests[digests.length-1])))
        {
            return new SimpleTestResult(false,
                "RIPEMD160 failing clone test - part 2"
View Full Code Here

    try
    {
      byte[] sha256 = MessageDigest.getInstance ("SHA-256").digest (key);
      RIPEMD160Digest digest = new RIPEMD160Digest ();
      digest.update (sha256, 0, sha256.length);
      digest.doFinal (ph, 0);
    }
    catch ( NoSuchAlgorithmException e )
    {
      throw new RuntimeException (e);
    }
View Full Code Here

    public static final byte[] ripemd160(byte[] data) {
        byte[] ph = new byte[20];
        RIPEMD160Digest digest = new RIPEMD160Digest();
        digest.update(data, 0, data.length);
        digest.doFinal(ph, 0);
        return ph;
    }

    public static final byte[] hash(byte[] data, int offset, int len) {
        try {
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.