hemera
Poseidon2 hash over the Goldilocks field.
Field: p = 2^64 - 2^32 + 1 (Goldilocks)
S-box: d = 7 (x^7)
State width: t = 16
Full rounds: R_F = 8 (4 + 4)
Partial rounds: R_P = 64
Rate: r = 8 elements (56 bytes)
Capacity: c = 8 elements (64 bytes)
Output: 8 elements (64 bytes)
Collision: 256 bits classical, 170 bits quantum
Every parameter is a power of two.
Usage
use ;
// One-shot
let digest = hash;
// Streaming
let mut hasher = new;
hasher.update;
hasher.update;
assert_eq!;
// Keyed
let mac = keyed_hash;
// Key derivation
let key = derive_key;
// XOF (extendable output)
let mut xof = new.update.finalize_xof;
let mut out = ;
xof.fill;
Self-bootstrapping round constants
Hemera generates its own round constants from a genesis seed [0x63, 0x79, 0x62, 0x65, 0x72] ("cyber") through a zero-constant Poseidon2 sponge. No external PRNG, no nothing-up-my-sleeve numbers from other sources.
GPU backend
Optional GPU acceleration via wgpu compute shaders:
= { = "0.1", = ["gpu"] }
Features
| Feature | Description |
|---|---|
gpu |
GPU-accelerated batch permutations via wgpu |
serde |
Serialize/deserialize Hash type |
License
MIT OR Apache-2.0