SHA-256 hash verification of flash slots, pico_hash_binary, flash:: namespace, ring_buffer iterator, non-destructive log

This commit is contained in:
Ian Gulliver
2026-04-12 23:47:00 +09:00
parent cc37b711a4
commit 23587c41e2
7 changed files with 210 additions and 64 deletions

View File

@@ -8,6 +8,7 @@
#include "msgpack.h"
#include "halfsiphash.h"
#include "static_vector.h"
#include "flash.h"
struct Envelope {
static constexpr int8_t ext_id = 0;
@@ -128,19 +129,11 @@ struct RequestFlashStatus {
auto as_tuple() { return std::tie(); }
};
struct SlotInfo {
bool valid;
uint32_t version;
bool hash_ok;
auto as_tuple() const { return std::tie(valid, version, hash_ok); }
auto as_tuple() { return std::tie(valid, version, hash_ok); }
};
struct ResponseFlashStatus {
static constexpr int8_t ext_id = 15;
int8_t boot_partition;
SlotInfo slot_a;
SlotInfo slot_b;
flash::slot slot_a;
flash::slot slot_b;
auto as_tuple() const { return std::tie(boot_partition, slot_a, slot_b); }
auto as_tuple() { return std::tie(boot_partition, slot_a, slot_b); }
};