SHA-512/224 (FIPS 180-4 §5.3.6.1) — wrapper over sha512 with a distinct IV + 7-word truncation = 224 bits.
Module sha512_224 | Source packages/front/fw/src/crypto/hash/sha512_224.js | Deps sha512 | Worker-safe yes
Truncated SHA-512 variant. Faster than SHA-256 on 64-bit platforms (in C/asm); in JS, performance is equivalent to SHA-256.
Resolve
const sha512_224 = runtime.resolve('sha512_224');
// Returns: { name, fn, hash }
API
| Method | Signature | Returns |
|---|---|---|
hash |
(data) => bitArray |
Digest 7 words × 32 bits = 224 bits |
fn |
constructor() |
Streaming HMAC-compatible (blockSize 1024) |
Examples
const { sha512_224, hex, bitArray } = fw.runtime.resolveAll(['sha512_224', 'hex', 'bitArray']);
hex.fromBytes(bitArray.ba_to_ui8(sha512_224.hash('abc')));
// "4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa"
Worker Usage
const worker = fw.createWorker(
function ({ libs, args }) { self.postMessage(libs.sha512_224.hash(args[0])); },
{ dependencies: ['sha512_224'], args: ['abc'] }
);
Notes
- IV derived by independent computation per FIPS 180-4 §5.3.6 (cross-checked against OpenSSL
sha512.c). - Block size: 1024 bits (HMAC-compatible).
- LDT 1 GiB gated behind
CRYPTO_FULL=1(gap-fix post-upgrade audit).
See also
- sha512, sha512_256
- hmac — HMAC-SHA-512/224
- Conformance sha512_224.acvp.md