buffer: bugfix (v3) fix the checksum

The BIOS is expected to use the XOR checksum which behaves ever so
slightly different compared to summing up the bytes (even though
bitwise XOR is the same as addition).

Fixed the unit test accordingly

Tested: Unit test + tested on a BIOS with real / valid checksummed
payload

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I326f814eb66892971ec32f0572618a34825d88b0
diff --git a/src/buffer.cpp b/src/buffer.cpp
index 35a6f77..836049f 100644
--- a/src/buffer.cpp
+++ b/src/buffer.cpp
@@ -211,9 +211,12 @@
 
     // Calculate the checksum
     uint8_t* entryHeaderPtr = reinterpret_cast<uint8_t*>(&entryHeader);
-    uint8_t checksum = std::accumulate(
-        entryHeaderPtr, entryHeaderPtr + sizeof(struct QueueEntryHeader), 0);
-    checksum = std::accumulate(std::begin(entry), std::end(entry), checksum);
+    uint8_t checksum =
+        std::accumulate(entryHeaderPtr,
+                        entryHeaderPtr + sizeof(struct QueueEntryHeader), 0,
+                        std::bit_xor<void>()) ^
+        std::accumulate(entry.begin(), entry.end(), 0, std::bit_xor<void>());
+
     if (checksum != 0)
     {
         throw std::runtime_error(fmt::format(