ReviewOS

home-lang/home

Bun parity: add Web Crypto SHA-3 digests

#330
Closed chris opened this 10 days ago ·
10 days ago

Scope

Advance the contiguous Bun corpus boundary at js/web/crypto/web-crypto-sha3.test.ts (position 4095) by implementing Bun-compatible SHA-3 algorithms in Home's Web Crypto path.

Depends on and follows #329.

Current failures

The file reports six failures, with 0 unsupported. The first failure is:

  • SHA3-256(""): NotSupportedError: Unrecognized algorithm name

The upstream file exercises SHA3-256, SHA3-384, and SHA3-512 digest vectors across empty and non-empty inputs.

Acceptance criteria

  • js/web/crypto/web-crypto-sha3.test.ts passes without exclusions or fixture weakening.
  • crypto.subtle.digest recognizes the Bun-supported SHA-3 algorithm names and returns exact vector bytes.
  • Algorithm normalization, validation, and errors use the shared Web Crypto implementation.
  • Focused permanent regression coverage is added.
  • Rejections retain the algorithm/operation cause and originating test/source stack.
10 days ago

Implemented and pushed in 51796769d (feat(crypto): add Web Crypto SHA-3 parity).

This ports the SHA3-256/SHA3-384/SHA3-512 Web Crypto behavior exercised by Bun, including digest vectors, million-byte input, HMAC sign/verify and default key lengths, RSA SHA-3 JWK handling, PBKDF2-SHA3-256, and hash discovery.

Verification:

  • js/web/crypto/web-crypto-sha3.test.ts: 17 passed, 0 failed
  • permanent HTTP/web tail queue: passed
  • committed only packages/home_test/src/corpus_runner.zig; unrelated worktree changes were not staged.

Sign in to comment on this issue.