Example usage for org.bouncycastle.crypto.digests RIPEMD160Digest reset

List of usage examples for org.bouncycastle.crypto.digests RIPEMD160Digest reset

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.digests RIPEMD160Digest reset.

Prototype

public void reset() 

Source Link

Document

reset the chaining variables to the IV values.

Usage

From source file:xyz.jamescarroll.genipass.Crypto.ECKey.java

License:Open Source License

/**
 * Public method that generates the master extended public key.
 *
 * @param u the string of the username//  ww w . ja  v a2 s .c o  m
 * @param p the string of the master password.
 * @return an ECKey object representing the master extended public key.
 */

public static ECKey genFromSeeds(String u, String p) {
    RIPEMD160Digest ripemd = new RIPEMD160Digest();
    byte[] digest = new byte[ripemd.getDigestSize()];
    BigInteger hu, hp;

    hu = ripemd160ToBigInteger(u.getBytes(), digest, ripemd);
    hp = ripemd160ToBigInteger(p.getBytes(), digest, ripemd);
    ripemd.reset();

    digest = calcMasterExtPrivateKey(hu, hp);

    return calcExtPublicKey(digest).setmMaster(true);
}