From 46a60efd53c5264e526c1aab5acfb4e2589e7edb Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Fri, 3 Nov 2023 18:25:24 +0200 Subject: [PATCH] Synchronized access to sha256digest --- rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java b/rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java index 59bed4e8cb6..aad79a2df3c 100644 --- a/rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java +++ b/rskj-core/src/main/java/org/ethereum/crypto/HashUtil.java @@ -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) {