use of org.spongycastle.crypto.Digest in project universa by UniversaBlockchain.
the class RSAOAEPDigestFactoryTest method cloneDigest.
/**
* Test {@link RSAOAEPDigestFactory#cloneDigest}.
*/
@Test
public void cloneDigest() throws Exception {
Digest d1Orig = new SHA512Digest();
Digest d1Clone = RSAOAEPDigestFactory.cloneDigest(d1Orig);
assertTrue(d1Clone instanceof SHA512Digest);
assertNotEquals(d1Orig, d1Clone);
}
use of org.spongycastle.crypto.Digest in project AppCoins-ethereumj by AppStoreFoundation.
the class HashUtil method ripemd160.
/**
* @param data - message to hash
*
* @return - reipmd160 hash of the message
*/
public static byte[] ripemd160(byte[] data) {
Digest digest = new RIPEMD160Digest();
if (data != null) {
byte[] resBuf = new byte[digest.getDigestSize()];
digest.update(data, 0, data.length);
digest.doFinal(resBuf, 0);
return resBuf;
}
throw new NullPointerException("Can't hash a NULL value");
}
Aggregations