Skip to content

Commit

Permalink
Synchronized access to sha256digest
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovchyk committed Nov 15, 2023
1 parent 52e52db commit 46a60ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public static MessageDigest makeMessageDigest() {
* @return - sha256 hash of the data
*/
public static byte[] sha256(byte[] input) {
return sha256digest.digest(input);
synchronized (sha256digest) {
return sha256digest.digest(input);
}
}

public static byte[] keccak256(byte[] input) {
Expand Down

0 comments on commit 46a60ef

Please sign in to comment.