Skip to main content

Crate spg_crypto

Crate spg_crypto 

Source
Expand description

BLAKE3 cryptographic hash — self-built single-thread implementation. Follows the spec at https://github.com/BLAKE3-team/BLAKE3-specs/blob/master/blake3.pdf.

Scope: unkeyed hash(input) -> [u8; 32] only. KDF / keyed-hash modes are out of scope.

v3.0.4 attempted a NEON-vectorised compress for aarch64 but the benchmark regressed 1.5–2× — see the comment on fn compress. The NEON path is kept under #[cfg(test)] as a cross-check oracle.

Modules§

base64
Base64 (RFC 4648 standard alphabet) — encode + decode.
crc32
IEEE 802.3 CRC-32 (the “zip / png / ethernet” variant).
hmac
HMAC-SHA-256 — self-built per RFC 2104.
lzss
v6.6.0 — LZSS (Lempel-Ziv-Storer-Szymanski 1982) encoder + decoder.
pbkdf2
PBKDF2-HMAC-SHA-256 — RFC 8018 §5.2.
sha256
SHA-256 — self-built per FIPS 180-4 §6.2.

Constants§

OUT_LEN

Functions§

hash
Top-level BLAKE3 hash. Returns the 32-byte digest.
hex
Helper: format a 32-byte digest as a lower-case hex string (no separators). Allocates a 64-character String. Useful for tests / human-facing logs.