Add utility to calculate digest from the root of verity tree

This function will help verifying that external hashtree wasn't
tampered. See another change in this topic for more context.

Test: atest build_verity_tree_test
Bug: 145670581
Change-Id: I10a8141a60eec142c77cde0048f0abf44b3406bb
3 files changed