Calculate verity hash tree.

Calculate verity hash tree in FilesystemVerifierAction based on configs
specified in protobuf, and write it to target partition before reading
from those blocks.

A new error code kVerityCalculationError was added to report error if
it fails.

Bug: 28171891
Test: update_engine_unittests

Change-Id: I492885a0655bf51043902f578720fffd87e6a3cf
diff --git a/common/error_code.h b/common/error_code.h
index 86b7a3e..252cc42 100644
--- a/common/error_code.h
+++ b/common/error_code.h
@@ -79,6 +79,7 @@
   kNoUpdate = 53,
   kRollbackNotPossible = 54,
   kFirstActiveOmahaPingSentPersistenceError = 55,
+  kVerityCalculationError = 56,
 
   // VERY IMPORTANT! When adding new error codes:
   //
diff --git a/common/error_code_utils.cc b/common/error_code_utils.cc
index 930dafe..a1607f5 100644
--- a/common/error_code_utils.cc
+++ b/common/error_code_utils.cc
@@ -156,6 +156,8 @@
       return "ErrorCode::kRollbackNotPossible";
     case ErrorCode::kFirstActiveOmahaPingSentPersistenceError:
       return "ErrorCode::kFirstActiveOmahaPingSentPersistenceError";
+    case ErrorCode::kVerityCalculationError:
+      return "ErrorCode::kVerityCalculationError";
       // Don't add a default case to let the compiler warn about newly added
       // error codes which should be added here.
   }