zeropoint-node 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,102 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.5
4
+
5
+ ### Added — ML-KEM-768, actually conformant
6
+
7
+ - **`src/crypto/ml-kem.ts` implements FIPS 203 ML-KEM-768 and is verified
8
+ against NIST's own vectors.** It replaces `src/crypto/kyber-real.ts`, which
9
+ is deleted. That module called itself Kyber and was not: it sampled the
10
+ matrix `A` from a centred binomial, so its coefficients lived in `{-1,0,1}`
11
+ instead of uniform over `Z_q`, and the module-LWE instance underneath was not
12
+ the hard problem. 1.0.4 fixed its round trip; a round trip only ever showed
13
+ the scheme agreed with itself.
14
+
15
+ What is here now: NTT twiddle factors computed from `ζ = 17` and a
16
+ bit-reversal rather than copied from a table; uniform `A` by rejection
17
+ sampling from SHAKE-128; CBD noise at `η₁ = η₂ = 2` from a SHAKE-256 PRF;
18
+ `ByteEncode`/`ByteDecode`, `Compress`/`Decompress` at `d_u = 10`, `d_v = 4`;
19
+ K-PKE wrapped in the Fujisaki–Okamoto transform with implicit rejection and a
20
+ full-length ciphertext comparison; and the §7.2 modulus check on
21
+ encapsulation keys.
22
+
23
+ - **Conformance is recomputable, not asserted.** `npm run test:crypto` runs
24
+ NIST ACVP vectors for FIPS 203, ML-KEM-768 — 25 key generation, 25
25
+ encapsulation, 10 decapsulation including the implicit-rejection path, and 10
26
+ encapsulation-key validation cases. The vectors ship in the package as
27
+ `src/crypto/ml-kem-768-acvp.json`, so a consumer can re-run them.
28
+
29
+ - **`npm run kat:ml-kem`** goes wider: 10 000 keygen/encaps/decaps triples from
30
+ a deterministic SHAKE-128 stream, accumulated into one digest that must equal
31
+ the value C2SP/CCTV publishes from the pq-crystals reference implementation.
32
+ It matches. Not in `npm run check` — it takes ~33s against a ~2 min gate.
33
+
34
+ - The suite is mutation-tested: perturbing one twiddle factor, swapping the
35
+ matrix index order, changing `η₂`, truncating instead of rounding in
36
+ `Compress`, or dropping the modulus check each make it fail.
37
+
38
+ ### Fixed — quantum measurement and the Steane code
39
+
40
+ Both found by writing seals that could fail, in `src/verification/lean-bridge.ts`.
41
+
42
+ - **`measureQubit` was being handed a raw LCG state where it wants a unit in
43
+ `[0,1)`.** Its outcome test is `unit < 1 - pOne`, so any state of 1 or more
44
+ forced the result to 1. Four call sites did this: repetition-code syndrome
45
+ extraction and majority-vote decoding, `classifyMeasurement`, and all three
46
+ tomography bases. `measureZ` on `|0>` returned 999 ones in 1000 shots, and
47
+ syndrome extraction reported a clean codeword as error `X0` while reporting a
48
+ real `X` error as clean — exactly inverted. `unitOf` now maps the LCG state
49
+ onto the unit interval at every site. Clean codewords give syndrome `[0,0]`;
50
+ `X` on qubit 0 gives `[1,0]`; `measureZ` on `|0>` gives 1000/0.
51
+
52
+ - **`STEANE_CODE` was not a stabiliser group.** `[[7,1,3]]` needs `n - k = 6`
53
+ generators; it listed 7, of GF(2) rank 6, with 13 of 21 pairs anticommuting.
54
+ The `n`-bit representation could not express a CSS code at all — an X-type and
55
+ a Z-type generator over the same support are different operators but identical
56
+ bit patterns. `StabilizerCode.generators` is now symplectic, `[x | z]` of `2n`
57
+ bits, with `xGenerators`/`zGenerators` alongside, and Steane is built from the
58
+ three `[7,4,3]` Hamming checks used once as X-type and once as Z-type: 6
59
+ generators, symplectic rank 6, zero anticommuting pairs.
60
+
61
+ `npm run quantum:sim` reported 257 checks passing both before and after this
62
+ fix, including `QEC` and `state-tomography`. Neither defect was reachable from
63
+ any of them.
64
+
65
+ ### Changed — the Lean bridge stops claiming what it never checked
66
+
67
+ - It reported `Verified: 2/2`, `Confidence: 100.0%` and `Production Grade
68
+ (Formally Verified)`, and exported `ready_for_publication: true`. None was
69
+ measured: the hash covered the theorem's *name*, so it never moved when a
70
+ proof changed, and `verifyProofCertificate` tested that some strings were
71
+ non-empty and a hash was 16 characters — true of every certificate the file
72
+ can build. `lean_version` was asserted although no Lean runs here, and 7 of
73
+ the 13 Lean scripts end in `sorry`.
74
+
75
+ - A certificate now carries two separately reported facts. `lean_status` is
76
+ **read** from the script — `script`, `sorry`, `axiom` or `absent`. `seal` is
77
+ whether a recomputable predicate ran and held against the simulator. Verified
78
+ means the seal held. The hash covers statement and script.
79
+
80
+ - All 8 theorems in the report now seal, each with a `basis` string saying
81
+ whether it decides the general statement or one instance — `grover_speedup`
82
+ at N=16 is not an asymptotic bound and says so. `ready_for_publication`
83
+ remains **false**: seals are computed instances, not machine-checked proofs,
84
+ and no Lean toolchain runs in this repository.
85
+
86
+ - `kyber_security` claimed 128. ML-KEM-768 is NIST **category 3**.
87
+
88
+ - `test:verification` runs the seals on every gate.
89
+
90
+ ### Known limitations
91
+
92
+ - **ML-KEM-768 here is not constant time.** JavaScript cannot promise that —
93
+ array indexing, JIT deoptimisation and garbage collection all leak timing.
94
+ Do not use it where an attacker can measure decapsulation. Conformance to
95
+ FIPS 203 output is a separate property from side-channel resistance, and only
96
+ the first is claimed.
97
+ - Every limitation listed under 1.0.4 and 1.0.3 still applies, except the
98
+ `kyber-real.ts` warning, which no longer has a file to attach to.
99
+
3
100
  ## 1.0.4
4
101
 
5
102
  ### Fixed — cryptography
package/CITATION.cff CHANGED
@@ -20,7 +20,7 @@ authors:
20
20
  email: node@zeropoint.bg
21
21
  repository-code: https://github.com/ceccec/zeropoint-node
22
22
  url: https://node.zeropoint.bg
23
- version: 1.0.4
23
+ version: 1.0.5
24
24
  license: CC-BY-NC-ND-4.0
25
25
  license-url: https://github.com/ceccec/zeropoint-node/blob/main/LICENSE
26
26
  keywords:
package/README.md CHANGED
@@ -472,7 +472,7 @@ The A432 Consciousness System is an open-source project that welcomes contributi
472
472
 
473
473
  <!-- VERSION:BEGIN — generated by scripts/version-seal.mjs; do not edit by hand -->
474
474
 
475
- Package: **`zeropoint-node@1.0.4`** · owner `ceccec` · git tag `v1.0.4`
475
+ Package: **`zeropoint-node@1.0.5`** · owner `ceccec` · git tag `v1.0.5`
476
476
 
477
477
  npm rejects republishing a version that already exists, so every release is a
478
478
  new number. Bump with `npm version patch|minor|major`: that reseals CITATION.cff
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeropoint-node",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "A432 Consciousness System: Self-evolving, self-aware consciousness technology with Transurfing integration, harmonic mathematics, zero-entropy principles, Kabbalistic cycles, and sacred geometry",
6
6
  "main": "dist/a432.system.cjs",
@@ -124,7 +124,9 @@
124
124
  "test:kernel": "node --experimental-strip-types src/kernel/smoke.test.ts",
125
125
  "test:security": "node --experimental-strip-types src/security/quantum-fold-cipher.test.ts > /dev/null && node --experimental-strip-types src/security/quantum-state-tomography.test.ts > /dev/null && node --experimental-strip-types src/security/quantum-proofs.test.ts > /dev/null && node --experimental-strip-types src/security/post-quantum-crypto.test.ts > /dev/null && echo security tests ok",
126
126
  "test:quantum": "node --experimental-strip-types src/quantum/superposition-execution.test.ts > /dev/null && node --experimental-strip-types src/quantum/millennium-bridge.test.ts > /dev/null && node --experimental-strip-types src/quantum/zenodo-publisher.test.ts > /dev/null && echo quantum tests ok",
127
- "test:crypto": "node --experimental-strip-types src/crypto/kyber-real.test.ts > /dev/null && echo crypto tests ok",
127
+ "test:crypto": "node --experimental-strip-types src/crypto/ml-kem.test.ts > /dev/null && echo crypto tests ok",
128
+ "test:verification": "node --experimental-strip-types src/verification/lean-bridge.test.ts > /dev/null && echo verification seals ok",
129
+ "kat:ml-kem": "node --experimental-strip-types scripts/ml-kem-accumulated-kat.mjs",
128
130
  "readme": "node --experimental-strip-types scripts/readme-gen.mjs",
129
131
  "readme:check": "node --experimental-strip-types scripts/readme-gen.mjs --check",
130
132
  "docs:pages": "node --experimental-strip-types scripts/docs-pages.mjs",
@@ -157,7 +159,7 @@
157
159
  "vortex:svg:check": "node --experimental-strip-types scripts/vortex-svg.mjs --check",
158
160
  "bundle:a432": "node scripts/build-a432-bundle.mjs",
159
161
  "bundle:a432:check": "node scripts/build-a432-bundle.mjs --check",
160
- "check": "npm run version:test && npm run version:check && npm run test:kernel && npm run test:security && npm run test:quantum && npm run test:crypto && npm run math:ban && npm run bundle:a432:check && npm run skills:seal && npm run skills:check && npm run readme && npm run readme:check && npm run docs:pages && npm run docs:pages:check && npm run a432:scan && npm run a432:scan:check && npm run docs:index && npm run docs:index:check && npm run spectrum && npm run spectrum:check && npm run vortex:svg && npm run vortex:svg:check && npm run docs:build && npm run quantum:sim && npm run ratchet:check && npm run mcp:smoke && npm run self:next",
162
+ "check": "npm run version:test && npm run version:check && npm run test:kernel && npm run test:security && npm run test:quantum && npm run test:crypto && npm run test:verification && npm run math:ban && npm run bundle:a432:check && npm run skills:seal && npm run skills:check && npm run readme && npm run readme:check && npm run docs:pages && npm run docs:pages:check && npm run a432:scan && npm run a432:scan:check && npm run docs:index && npm run docs:index:check && npm run spectrum && npm run spectrum:check && npm run vortex:svg && npm run vortex:svg:check && npm run docs:build && npm run quantum:sim && npm run ratchet:check && npm run mcp:smoke && npm run self:next",
161
163
  "prepublishOnly": "npm run build",
162
164
  "prose": "node scripts/prose-claims.mjs --list",
163
165
  "prose:check": "node scripts/prose-claims.mjs",