|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Functions | |
| void | fnv1a_mix_byte (uint32_t &hash, uint8_t value) |
| Mixes a single value into a running FNV-1a 32-bit hash. | |
| void | fnv1a_mix_u32 (uint32_t &hash, uint32_t value) |
| Mixes a 32-bit word into a running FNV-1a 32-bit hash. | |
| uint32_t | fnv1a_32 (const uint8_t *data, size_t len) |
| Computes FNV-1a 32-bit hash over a byte buffer. | |
Variables | |
| static constexpr uint32_t | FNV1A_32_OFFSET_BASIS = 0x811C9DC5u |
| FNV-1a 32-bit constants (Fowler/Noll/Vo). | |
| static constexpr uint32_t | FNV1A_32_PRIME = 0x01000193u |
|
inline |
Computes FNV-1a 32-bit hash over a byte buffer.
| data | Input buffer. |
| len | Buffer length in bytes. |
Definition at line 52 of file Hash.h.
References FNV1A_32_OFFSET_BASIS, and fnv1a_mix_byte().
Referenced by fnv1a_hash().
|
inline |
Mixes a single value into a running FNV-1a 32-bit hash.
| hash | In/out running hash; pass FNV1A_32_OFFSET_BASIS initially. |
| value | Byte to mix in. |
Definition at line 28 of file Hash.h.
References FNV1A_32_PRIME.
Referenced by fnv1a_32().
|
inline |
Mixes a 32-bit word into a running FNV-1a 32-bit hash.
| hash | In/out running hash; pass FNV1A_32_OFFSET_BASIS initially. |
| value | Word to mix in. |
Convenience for callers that hash structured numeric fields rather than byte buffers; matches the pre-existing pattern in TropicSlotMap.
Definition at line 41 of file Hash.h.
References FNV1A_32_PRIME.
Referenced by cdc::core::TropicSlotMap::computeMapSignature().
|
staticconstexpr |
FNV-1a 32-bit constants (Fowler/Noll/Vo).
See: https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-1a http://www.isthe.com/chongo/tech/comp/fnv/
Definition at line 20 of file Hash.h.
Referenced by cdc::core::TropicSlotMap::computeMapSignature(), and fnv1a_32().
|
staticconstexpr |
Definition at line 21 of file Hash.h.
Referenced by fnv1a_mix_byte(), and fnv1a_mix_u32().