Remove SHA3-256 hash as it turned out it is slower as SHA256

In some tests it seemed that SHA3-256 is 30% fast than SHA256 but later
with the data we used in dao testnet it was actually slower.
To avoid confusion which hash function to use and to avoid mixing them
without strong reason I prefer to remove it again.
This commit is contained in:
Manfred Karrer 2019-03-21 18:44:24 -05:00
parent 7651a946e4
commit 6d5b404876
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -82,29 +82,5 @@ public class Hash {
digest.doFinal(out, 0);
return out;
}
/**
* @param data Data as byte array
* @return Hash of data
*/
public static byte[] getSha3_256Hash(byte[] data) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA3-256");
digest.update(data, 0, data.length);
return digest.digest();
} catch (NoSuchAlgorithmException e) {
log.error("Could not create MessageDigest for hash. " + e.toString());
e.printStackTrace();
throw new RuntimeException(e);
}
}
/**
* Calculates RIPEMD160(SHA3-256(data)).
*/
public static byte[] getSha3_256Ripemd160hash(byte[] data) {
byte[] sha3_256Hash = getSha3_256Hash(data);
return getRipemd160hash(sha3_256Hash);
}
}