Package com.horizen.merkletreenative
Class MerklePath
- java.lang.Object
-
- com.horizen.merkletreenative.MerklePath
-
- All Implemented Interfaces:
AutoCloseable
public class MerklePath extends Object implements AutoCloseable
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldElementapply(FieldElement leaf)booleanareRightLeavesEmpty()voidclose()static MerklePathdeserialize(byte[] merklePathBytes)static MerklePathdeserialize(byte[] merklePathBytes, boolean semanticChecks)booleanequals(Object o)voidfreeMerklePath()intgetLength()Get the length of this MerklePathbooleanisLeftmost()booleanisRightmost()longleafIndex()byte[]serialize()booleanverify(int merkleTreeHeight, FieldElement leaf, FieldElement root)booleanverify(FieldElement leaf, FieldElement root)
-
-
-
Method Detail
-
getLength
public int getLength()
Get the length of this MerklePath- Returns:
- the length of this MerklePath
-
verify
public boolean verify(int merkleTreeHeight, FieldElement leaf, FieldElement root)
-
verify
public boolean verify(FieldElement leaf, FieldElement root)
-
apply
public FieldElement apply(FieldElement leaf)
-
isLeftmost
public boolean isLeftmost()
-
isRightmost
public boolean isRightmost()
-
areRightLeavesEmpty
public boolean areRightLeavesEmpty()
-
leafIndex
public long leafIndex()
-
serialize
public byte[] serialize()
-
deserialize
public static MerklePath deserialize(byte[] merklePathBytes, boolean semanticChecks)
-
deserialize
public static MerklePath deserialize(byte[] merklePathBytes)
-
freeMerklePath
public void freeMerklePath()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-