verity: add C++ version of build_verity_tree that handles sparse files

A C++ version can reuse libsparse to calculate the verity hash tree
of a sparse file without unsparsing it.  In addition to saving disk
space, it also cuts the time taken in half by optimizing out the
hash calculation for skipped blocks that are known to be zero.

Change-Id: I882fe3a417dc2c83bb0e6cd974b6a886f8bc8ac3
2 files changed