firmware: set up hash handler
Treat the hash file as just another file. It isn't just another file in
some contexts, but in writing data down it is.
Change-Id: I173b6d2a7d7da2db628e8b27ce58b64aea6b932a
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/hash_handler.hpp b/hash_handler.hpp
new file mode 100644
index 0000000..c006194
--- /dev/null
+++ b/hash_handler.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "image_handler.hpp"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace blobs
+{
+
+class HashFileHandler : public ImageHandlerInterface
+{
+ public:
+ /**
+ * Create a HashFileHandler.
+ */
+ HashFileHandler() = default;
+
+ bool open(const std::string& path) override;
+
+ bool write(std::uint32_t offset,
+ const std::vector<std::uint8_t>& data) override;
+
+ private:
+ std::string path;
+};
+
+} // namespace blobs