class

FCacheMac

Tamper evidence for a shared derived-data tier. The tier keys values by input fingerprint alone, so whoever can write to the server (or sits on a plain-http path to it) could plant a cooked asset that every machine then ships. With MOWO_CACHE_HMAC_KEY set, a writer stores <key>.mac next to each value and a reader treats a value whose sidecar is missing or wrong as a miss.

Module
Http
Header
#include "Http/CacheMac.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr const char*kSecretEnvironmentVariableDefault "".

Public functions

ReturnsNameDescription
std::stringHmacSha256HexHMAC-SHA256 (RFC 2104), lowercase hex.
std::stringForEntryHMAC over the key, a NUL and the value, so a valid sidecar is not reusable under another key.
std::stringSecretFromEnvironment
boolEqual

Function details

HmacSha256Hex

C++
static std::string HmacSha256Hex(const std::string& secret, const void* data, size_t size)

HMAC-SHA256 (RFC 2104), lowercase hex.

ForEntry

C++
static std::string ForEntry(const std::string& secret, const std::string& key, const void* data, size_t size)

HMAC over the key, a NUL and the value, so a valid sidecar is not reusable under another key.

SecretFromEnvironment

C++
static std::string SecretFromEnvironment()

Equal

C++
static bool Equal(const std::string& a, const std::string& b)
Generated from Http/CacheMac.h via http.json · Dec 4, 2026Version 1.1.0