Update public methods signatures

- Update public methods signatures
- Remove 'lastAccess' param
- Add option to pass root for tree.Dump, Iterate, IterateWithStop,
Graphviz (and related)
- Move error messages to const defined error messages for external usage
This commit is contained in:
2021-05-26 17:01:09 +02:00
parent f24fb28266
commit 0b2c3b07ed
8 changed files with 224 additions and 181 deletions

View File

@@ -12,8 +12,9 @@ func SwapEndianness(b []byte) []byte {
}
// BigIntToBytes converts a *big.Int into a byte array in Little-Endian
func BigIntToBytes(bi *big.Int) []byte {
var b [32]byte // TODO make the length depending on the tree.hashFunction.Len()
func BigIntToBytes(blen int, bi *big.Int) []byte {
// var b [blen]byte // TODO make the length depending on the tree.hashFunction.Len()
b := make([]byte, blen)
copy(b[:], SwapEndianness(bi.Bytes()))
return b[:]
}