Extend the cooperative contact transaction to uncached ESP32 storage, including the PSRAM policy used by the XIAO and V4. Preserve owned contact copies, the 152-byte disk format, revision cancellation and synchronous durability operations. Keep contact capacities unchanged. Avoid SDK error logs when optional blob or transaction cleanup files are absent, while preserving metadata and deletion failure handling. Validate cached ESP/nRF and uncached PSRAM paths under ASan/UBSan, including bounded writes, mutation cancellation, faults, recovery and reboot readback. Update the existing uncached production fixture.
19 lines
434 B
C++
19 lines
434 B
C++
#pragma once
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <openssl/sha.h>
|
|
#include <cstring>
|
|
#define PUB_KEY_SIZE 32
|
|
#define PRV_KEY_SIZE 64
|
|
namespace mesh {
|
|
class Utils {
|
|
public:
|
|
static void toHex(char* out, const uint8_t* bytes, size_t length);
|
|
static void sha256(uint8_t* out, size_t size, const uint8_t* data, int length) {
|
|
uint8_t digest[32];
|
|
SHA256(data, length, digest);
|
|
memcpy(out, digest, size);
|
|
}
|
|
};
|
|
}
|