update_payload: Add puffdiff support.

This patch adds support for applier.py to be able to apply PUFFDIFF
operation using puffin binary. It also fixes minor deficiencies for the
PUFFDIFF operation.

BUG=chromium:768461
TEST=unittests pass;
TEST=scripts/paycheck.py payload-puffin.delta new_kern.dat new_root.dat old_kern.dat old_root.dat

Change-Id: I5612ead8d8b8176e7263cfcb15403e8d36319642
Reviewed-on: https://chromium-review.googlesource.com/713540
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/update_metadata.proto b/update_metadata.proto
index f91f673..c5b2ed4 100644
--- a/update_metadata.proto
+++ b/update_metadata.proto
@@ -77,6 +77,9 @@
 // - REPLACE_XZ: Replace the dst_extents with the contents of the attached
 //   xz file after decompression. The xz file should only use crc32 or no crc at
 //   all to be compatible with xz-embedded.
+// - PUFFDIFF: Read the data in src_extents in the old partition, perform
+//   puffpatch with the attached data and write the new data to dst_extents in
+//   the new partition.
 //
 // The operations allowed in the payload (supported by the client) depend on the
 // major and minor version. See InstallOperation.Type bellow for details.