Support writing FEC.
After hash tree is written, we re-read the partition to encode FEC,
this cannot be done incrementally for each Update() like the hash
tree, because the data needed to encode each rs block are spreaded
across entire partition, and we can not afford to use that much
memory.
For each round, we encode block_size number of rs blocks, which will
produce block_size * fec_roots bytes of FEC data, this will allow us
to read one block at a time instead of one byte.
Bug: 28171891
Test: update_engine_unittests
Test: brillo_update_payload generate
Test: brillo_update_payload verify
Change-Id: I35ba7e0647b9ee5a97b972dc480deef60d813676
9 files changed