hash-zig v1.0.0
π First Stable Release: hash-zig v1.0.0
Pure Zig implementation of Generalized XMSS signatures with wire-compatible behavior against the Rust reference implementation (leanSig).
β¨ Key Features
- π Cross-Language Compatibility: All cross-language compatibility tests pass for lifetimes
2^8and2^32in both directions (RustβZig) - β‘ Performance Optimizations: Parallel tree generation, SIMD optimizations, and AVX-512 support for improved key generation performance (~7.1s for 2^32 with 1024 active epochs)
- π― Protocol Fidelity: Poseidon2 hashing, ShakePRF domain separation, target sum encoding, and Merkle construction match the Rust reference bit-for-bit
- π¦ Multiple Lifetimes: Support for
2^8,2^18, and2^32signatures per key with configurable activation windows (defaults to 256 epochs) - π Pure Zig: Minimal dependencies, explicit memory management, ReleaseFast-ready
π οΈ Technical Highlights
- Automatic AVX-512 Detection: Build script automatically detects AVX-512 support and configures SIMD width
- Stack Allocation Optimizations: Improved sign and verification performance with stack allocation
- Parallel Chain Computation: Optimized verification performance with parallel chain computation
- Memory Optimizations: Buffer reuse, copy optimizations, and improved thread pool management
π Requirements
- Zig 0.14.1 or later
- Compatible with Rust leanSig implementation for cross-language interoperability
π Installation
// build.zig.zon
.{
.name = "my_project",
.version = "0.1.0",
.dependencies = .{
.@"hash-zig" = .{
.url = "https://github.com/ch4r10t33r/hash-zig/archive/refs/tags/v1.0.0.tar.gz",
.hash = "...", // generated by zig build
},
},
}β οΈ Note
This is a prototype implementation for research and development purposes. Use at your own risk.
π Documentation
See README.md for detailed documentation, examples, and benchmarks.