Skip to content

noir_XPath v0.3.0 — SHA-2 digests, langMatches, TZ(), GROUP_CONCAT, SAMPLE

Latest

Choose a tag to compare

@jeswr jeswr released this 06 Jul 02:22
0aa74d0

noir_XPath v0.3.0

Resolves the deferred / future-planned function estate (sq-3kd2g.4, expanded by maintainer directive 2026-07-06; PR #50).

New functions

  • SPARQL hash digests SHA256 / SHA384 / SHA512 — sha256_hex / sha384_hex / sha512_hex (plus *_hex_bytes variants for ([u8; N], len) byte-tuple pipelines), returning the canonical lowercase-hex ([u8; 2*D], u32) byte tuple. Digest cores are the official noir-lang libraries, newly vendored with full provenance: vendor/sha256/ (tag v0.3.0, MIT) and vendor/sha512/ (main @ e92ffb4, Apache-2.0 — upstream has no release tags). FIPS 180-4 known-answer vectors verified both on the upstream checkouts and through the wrappers.
  • langMatches — lang_matches, RFC 4647 §3.3.1 basic filtering per SPARQL 17.4.3.6: "*" matches any non-empty tag; otherwise case-insensitive exact match or prefix ending at a - subtag boundary. ASCII case fold (exact per RFC 5646). Empty tag (no language) and empty range match nothing.
  • TZ() — tz_from_datetime plus the reusable tz_string_from_offset_minutes: "Z" for offset 0, "±HH:MM" otherwise, "" for the new TZ_OFFSET_NONE (i16::MIN) no-timezone sentinel. Caveat stated in SPARQL_COVERAGE.md: XsdDateTime carries no absent-timezone flag, so absence must be encoded via the sentinel; offset-0 values render "Z".
  • GROUP_CONCAT string core — group_concat, joining a bounded member sequence with a separator (empty members keep their positions). Grouping / DISTINCT / ORDER BY remain query-engine concerns, as for all aggregates in this library.
  • SAMPLE — sample_int / sample_int_partial: deterministic FIRST element (a legal implementation-dependent choice per SPARQL 18.5.1.7 — fixed because a prover-chosen nondeterministic sample would not be verifier-re-derivable), (value, present) emptiness convention.

Deliberately NOT added (honesty notes)

  • MD5 / SHA1: permanently omitted — both cryptographically broken, no maintained sound Noir implementation exists to vendor, and hand-rolling broken digests into a ZK crypto library is refused by policy. Recorded in SPARQL_COVERAGE.md §17.4.6; these are not stubs counted as implemented.
  • Full regex fn:matches / fn:replace: still deferred (the bounded literal/char-class/anchored subset from sq-y73 remains); a bounded-NFA ZK-regex strategy is tracked as sq-j8shy.
  • xsd:decimal exact arithmetic: still deferred (sq-n5e7p); xs:decimal results remain modelled in IEEE 754 double precision, stated per-row in SPARQL_COVERAGE.md.

Documentation repairs

  • Stale coverage rows flipped: the float/double lanes of abs/round/ceil/floor and the numeric operators have been implemented (vendored sparq_ieee754) since the float migration — the rows now say so (named unary ± lanes remain integer-only and are still marked partial).
  • Removed the false "ENCODE_FOR_URI deferred" claim (it is implemented).
  • Source-of-truth banners updated: README/TESTING/CI no longer direct contributors to the removed in-monorepo zk/xpath tree.
  • Collation scope resolved in ARCHITECTURE.md: codepoint collation (the SPARQL requirement) is what compare implements; locale/UCA tailoring is out of scope for data-oblivious circuits.

Conformance / CI status

  • Test suite (pinned nargo 1.0.0-beta.21): 204 xpath inline tests + 303 xpath_unit_tests + 113/113 real qt3tests-derived packages pass (247 stub-wired excluded by design); KNOWN_FAILING is empty.
  • New-function tests use computed expected values only: FIPS 180-4 KATs cross-checked against Python hashlib, the SPARQL 1.1 spec's own TZ examples, RFC 4647 cases.
  • Security status: unaudited — this is a 0.x release. The vendored digest crates are official noir-lang libraries but have not been independently audited here.

Changes since v0.2.0

Single squashed change: PR #50.


🤖 Released by SPARQ agent (Claude Fable 5) — sq-3kd2g.4 / epic sq-3kd2g (sparq#1591)