Skip to content

Commit 2c4d69b

Browse files
committed
Fix bigint conversion in merkle tree path verification
1 parent 5f3b188 commit 2c4d69b

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/main/java/com/unicity/sdk/shared/smt/MerkleTreePath.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@
88
import com.fasterxml.jackson.databind.node.ArrayNode;
99
import com.fasterxml.jackson.databind.node.ObjectNode;
1010
import com.unicity.sdk.ISerializable;
11-
import com.unicity.sdk.shared.cbor.CborDecoder;
1211
import com.unicity.sdk.shared.cbor.CborEncoder;
1312
import com.unicity.sdk.shared.hash.DataHash;
14-
import com.unicity.sdk.shared.hash.DataHasher;
1513
import com.unicity.sdk.shared.hash.HashAlgorithm;
1614
import com.unicity.sdk.shared.hash.JavaDataHasher;
17-
import com.unicity.sdk.shared.util.BigIntegerConverter;
18-
import com.unicity.sdk.shared.util.HexConverter;
1915

20-
import java.io.ByteArrayOutputStream;
21-
import java.io.IOException;
2216
import java.math.BigInteger;
2317
import java.util.ArrayList;
2418
import java.util.List;
@@ -65,7 +59,7 @@ public CompletableFuture<MerkleTreePathVerificationResult> verify(BigInteger req
6559

6660
// Create hasher and compute hash
6761
JavaDataHasher hasher = new JavaDataHasher(HashAlgorithm.SHA256);
68-
hasher.update(BigIntegerConverter.encode(step.getPath()));
62+
hasher.update(step.getPath().toByteArray());
6963
hasher.update(bytes);
7064
DataHash digest = hasher.digest().join();
7165
hash = digest.getHash();

0 commit comments

Comments
 (0)