Use Groestl hash in two places

This commit is contained in:
HashEngineering 2021-02-02 11:34:30 -08:00
parent 479c28f966
commit d802a58fe0
No known key found for this signature in database
GPG key ID: A615EB0C5CEBDEDE
2 changed files with 2 additions and 2 deletions

View file

@ -175,7 +175,7 @@ public class DeterministicKey extends ECKey {
int inputLength = input.length; int inputLength = input.length;
byte[] checksummed = new byte[inputLength + 4]; byte[] checksummed = new byte[inputLength + 4];
System.arraycopy(input, 0, checksummed, 0, inputLength); System.arraycopy(input, 0, checksummed, 0, inputLength);
byte[] checksum = Sha256Hash.hashTwice(input); byte[] checksum = Groestl.digest(input);
System.arraycopy(checksum, 0, checksummed, inputLength, 4); System.arraycopy(checksum, 0, checksummed, inputLength, 4);
return checksummed; return checksummed;
} }

View file

@ -122,7 +122,7 @@ public class Base58 {
byte[] addressBytes = new byte[1 + payload.length + 4]; byte[] addressBytes = new byte[1 + payload.length + 4];
addressBytes[0] = (byte) version; addressBytes[0] = (byte) version;
System.arraycopy(payload, 0, addressBytes, 1, payload.length); System.arraycopy(payload, 0, addressBytes, 1, payload.length);
byte[] checksum = Sha256Hash.hashTwice(addressBytes, 0, payload.length + 1); byte[] checksum = Groestl.digest(addressBytes, 0, payload.length + 1);
System.arraycopy(checksum, 0, addressBytes, payload.length + 1, 4); System.arraycopy(checksum, 0, addressBytes, payload.length + 1, 4);
return Base58.encode(addressBytes); return Base58.encode(addressBytes);
} }