Add AddBatch CaseC

CASE C: ALMOST CASE B --> if Tree has few Leafs (but numLeafs>=minLeafsThreshold)
==============================================================================
- Use A, B, G, F as Roots of subtrees
- Do CASE B for each subtree
- Then go from L to the Root

              R
             /  \
            /    \
           /      \
          *        *
         / |      / \
        /  |     /   \
       /   |    /     \
L:    A    B   G       D
              / \
             /   \
            /     \
           C      *
                 / \
                /   \
               /     \
              ...    ... (nLeafs >= minLeafsThreshold)
This commit is contained in:
2021-04-23 16:49:31 +02:00
parent 600fd212cc
commit a3473079de
4 changed files with 490 additions and 54 deletions

View File

@@ -13,7 +13,7 @@ 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
var b [32]byte // TODO make the length depending on the tree.hashFunction.Len()
copy(b[:], SwapEndianness(bi.Bytes()))
return b[:]
}