Skip to content

Commit

Permalink
Merge pull request #2166 from rsksmart/sha256-sync
Browse files Browse the repository at this point in the history
Synchronized access to sha256digest
  • Loading branch information
Vovchyk authored Nov 15, 2023
2 parents 52e52db + 46a60ef commit 3542363
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 3542363

Please sign in to comment.