{"_id":"@digitaldefiance/node-fhe-accelerate","_rev":"7-fa3dd8db02eaaf17711686a714b0eae7","name":"@digitaldefiance/node-fhe-accelerate","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@digitaldefiance/node-fhe-accelerate","version":"0.1.0","keywords":["fhe","homomorphic-encryption","tfhe","cryptography","privacy","apple-silicon","m4-max","native-addon","napi-rs"],"author":{"name":"Digital Defiance"},"license":"MIT","_id":"@digitaldefiance/node-fhe-accelerate@0.1.0","maintainers":[{"name":"jessica-mulein","email":"jessica@mulein.com"}],"homepage":"https://github.com/Digital-Defiance/node-fhe-accelerate#readme","bugs":{"url":"https://github.com/Digital-Defiance/node-fhe-accelerate/issues"},"os":["darwin"],"cpu":["arm64"],"dist":{"shasum":"891efd97ec38535d29a9cd8895bcd97e0666bf50","tarball":"https://registry.npmjs.org/@digitaldefiance/node-fhe-accelerate/-/node-fhe-accelerate-0.1.0.tgz","fileCount":131,"integrity":"sha512-6sOWMVUG3xi08wwj5HQ5ep+jhL55uZRmdB6+2KlyT6gQ2UxlkDeTnw4Pq5kAcJp9ac3g2sbamuX77u0XZxn4SQ==","signatures":[{"sig":"MEYCIQC1S8GNWCsUnH1+/FwO1BaGw9BdayZvLnrNybcMZV5QrQIhAPSJPGEtN25a+N9oZm2tSOblZcx6LXEkzdHjRlU02doM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":954354},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"1296a24d7914a1ee8d4f3a181cfd16da3f7831bf","scripts":{"lint":"eslint src --ext .ts","test":"vitest run","build":"yarn build:shaders && yarn build:ts && yarn build:native","clean":"rm -rf dist index.node target/shaders && rm -f native/*.node 2>/dev/null || true","format":"prettier --write \"src/**/*.ts\"","build:ts":"yarn build:cjs && yarn build:esm && yarn build:types","benchmark":"./run_benchmark","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","test:watch":"vitest","build:debug":"yarn build:shaders:debug && napi build --target aarch64-apple-darwin","build:types":"tsc -p tsconfig.types.json","test:native":"node test-native.js","build:native":"napi build --target aarch64-apple-darwin --release","build:shaders":"bash scripts/compile-shaders.sh release","test:coverage":"vitest run --coverage","prepublishOnly":"yarn clean && yarn build","publish:public":"npm publish --access public","build:shaders:debug":"bash scripts/compile-shaders.sh debug","build:shaders:watch":"FHE_SHADER_HOT_RELOAD=1 bash scripts/compile-shaders.sh debug","benchmark:comprehensive":"./run_comprehensive_benchmark"},"_npmUser":{"name":"jessica-mulein","email":"jessica@mulein.com"},"deprecated":"Fails to load: extensionless ESM/CJS re-exports. Also shipped a simulated ZK stack whose verifiers returned valid:true for any proof. Upgrade to >=0.1.1.","repository":{"url":"git+https://github.com/Digital-Defiance/node-fhe-accelerate.git","type":"git"},"_npmVersion":"10.9.4","description":"High-performance Fully Homomorphic Encryption (FHE) acceleration library optimized for Apple M4 Max hardware","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"packageManager":"yarn@4.0.0","devDependencies":{"eslint":"^8.54.0","vitest":"^1.0.0","prettier":"^3.1.0","fast-check":"^3.15.0","typescript":"^5.3.0","@types/node":"^20.10.0","@napi-rs/cli":"^2.18.0","@vitest/coverage-v8":"^1.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","@typescript-eslint/parser":"^6.13.0","@typescript-eslint/eslint-plugin":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/node-fhe-accelerate_0.1.0_1768546958811_0.7424937358139316","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@digitaldefiance/node-fhe-accelerate","version":"0.1.2","keywords":["fhe","homomorphic-encryption","tfhe","cryptography","privacy","apple-silicon","m4-max","native-addon","napi-rs"],"author":{"name":"Digital Defiance"},"license":"MIT","_id":"@digitaldefiance/node-fhe-accelerate@0.1.2","maintainers":[{"name":"jessica-mulein","email":"jessica@mulein.com"}],"homepage":"https://github.com/Digital-Defiance/node-fhe-accelerate#readme","bugs":{"url":"https://github.com/Digital-Defiance/node-fhe-accelerate/issues"},"os":["darwin"],"cpu":["arm64"],"dist":{"shasum":"c056361942a9a327a63ba3783adb90120119ce07","tarball":"https://registry.npmjs.org/@digitaldefiance/node-fhe-accelerate/-/node-fhe-accelerate-0.1.2.tgz","fileCount":131,"integrity":"sha512-z2W5QJO1Bhu6Cpi4nTwfkwVmYKiWOQ/uBUZCvyryiYwCOkGXL82ctUb1grI7PRk/v4b3HBW3j+ee3LKz5klAOg==","signatures":[{"sig":"MEYCIQC8pvWcOKKF2/J7odqepOVzj4sOo6vXdhKgfNm5aUIIOAIhANXVGue+2TYDPJSFgySnVIACMQus5IQjyKc6VXj5WMXZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":958557},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"e8e849629b78199ba882383dec22ddacf0bd23c8","scripts":{"lint":"eslint src --ext .ts","test":"vitest run","build":"yarn build:shaders && yarn build:ts && yarn build:native","clean":"rm -rf dist index.node target/shaders && rm -f native/*.node 2>/dev/null || true","format":"prettier --write \"src/**/*.ts\"","build:ts":"yarn build:cjs && yarn build:esm && yarn build:types","benchmark":"./run_benchmark","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","test:watch":"vitest","build:debug":"yarn build:shaders:debug && napi build --target aarch64-apple-darwin","build:types":"tsc -p tsconfig.types.json","test:native":"node test-native.js","build:native":"napi build --target aarch64-apple-darwin --release","build:shaders":"bash scripts/compile-shaders.sh release","test:coverage":"vitest run --coverage","prepublishOnly":"yarn clean && yarn build","publish:public":"npm publish --access public","build:shaders:debug":"bash scripts/compile-shaders.sh debug","build:shaders:watch":"FHE_SHADER_HOT_RELOAD=1 bash scripts/compile-shaders.sh debug","benchmark:comprehensive":"./run_comprehensive_benchmark"},"_npmUser":{"name":"jessica-mulein","email":"jessica@mulein.com"},"deprecated":"Not implemented: createEngine() rejects and no FHE operations exist. Retired until the library does what its name says.","repository":{"url":"git+https://github.com/Digital-Defiance/node-fhe-accelerate.git","type":"git"},"_npmVersion":"10.9.7","description":"High-performance Fully Homomorphic Encryption (FHE) acceleration library optimized for Apple M4 Max hardware","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"packageManager":"yarn@4.0.0","devDependencies":{"eslint":"^8.54.0","vitest":"^1.0.0","prettier":"^3.1.0","fast-check":"^3.15.0","typescript":"^5.3.0","@types/node":"^20.10.0","@napi-rs/cli":"^2.18.0","@vitest/coverage-v8":"^1.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","@typescript-eslint/parser":"^6.13.0","@typescript-eslint/eslint-plugin":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/node-fhe-accelerate_0.1.2_1785775694602_0.5805062273172874","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@digitaldefiance/node-fhe-accelerate","version":"0.1.3","keywords":["apple-silicon","arm64","hardware-detection","modular-arithmetic","napi-rs","not-implemented","work-in-progress"],"author":{"name":"Digital Defiance"},"license":"MIT","_id":"@digitaldefiance/node-fhe-accelerate@0.1.3","maintainers":[{"name":"jessica-mulein","email":"jessica@mulein.com"}],"homepage":"https://github.com/Digital-Defiance/node-fhe-accelerate#readme","bugs":{"url":"https://github.com/Digital-Defiance/node-fhe-accelerate/issues"},"os":["darwin"],"cpu":["arm64"],"dist":{"shasum":"d9a6e414fd1b20ab69aa18cb80dca33462c000fc","tarball":"https://registry.npmjs.org/@digitaldefiance/node-fhe-accelerate/-/node-fhe-accelerate-0.1.3.tgz","fileCount":131,"integrity":"sha512-hW0LtKHwMfQYJYYrNZFjc+H3X9TDjtnNgG2336VthMYn/NKWuet63uGq7gKWZ/2qLkuBJ691ro5eTlzVYkseUQ==","signatures":[{"sig":"MEYCIQC0/EDRVHkfBQTFI9XiGKgOfJ111iKp8gQiyAbQBJQO6wIhAJ1YiAlt4f8hbCuVmPAvlJ/hY5xR27l/AID7ZEdmotxq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":960786},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"efa337ee737b7442949b2b765fa258c9aa5e89bb","scripts":{"lint":"eslint src --ext .ts","test":"vitest run","build":"yarn build:shaders && yarn build:ts && yarn build:native","clean":"rm -rf dist index.node target/shaders && rm -f native/*.node 2>/dev/null || true","format":"prettier --write \"src/**/*.ts\"","build:ts":"yarn build:cjs && yarn build:esm && yarn build:types","benchmark":"./run_benchmark","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","test:watch":"vitest","build:debug":"yarn build:shaders:debug && napi build --target aarch64-apple-darwin","build:types":"tsc -p tsconfig.types.json","test:native":"node test-native.js","build:native":"napi build --target aarch64-apple-darwin --release","build:shaders":"bash scripts/compile-shaders.sh release","test:coverage":"vitest run --coverage","prepublishOnly":"yarn clean && yarn build","publish:public":"npm publish --access public","build:shaders:debug":"bash scripts/compile-shaders.sh debug","build:shaders:watch":"FHE_SHADER_HOT_RELOAD=1 bash scripts/compile-shaders.sh debug","benchmark:comprehensive":"./run_comprehensive_benchmark"},"_npmUser":{"name":"jessica-mulein","email":"jessica@mulein.com"},"repository":{"url":"git+https://github.com/Digital-Defiance/node-fhe-accelerate.git","type":"git"},"_npmVersion":"10.9.7","description":"NOT YET IMPLEMENTED. Apple Silicon hardware detection and modular-arithmetic primitives. No FHE operations exist: createEngine() rejects. Do not use for encryption.","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"packageManager":"yarn@4.0.0","devDependencies":{"eslint":"^8.54.0","vitest":"^1.0.0","prettier":"^3.1.0","fast-check":"^3.15.0","typescript":"^5.3.0","@types/node":"^20.10.0","@napi-rs/cli":"^2.18.0","@vitest/coverage-v8":"^1.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","@typescript-eslint/parser":"^6.13.0","@typescript-eslint/eslint-plugin":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/node-fhe-accelerate_0.1.3_1785784437961_0.7808117657712612","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@digitaldefiance/node-fhe-accelerate","version":"0.1.4","description":"NOT YET IMPLEMENTED. Apple Silicon hardware detection and modular-arithmetic primitives. No FHE operations exist: createEngine() rejects. Do not use for encryption.","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","exports":{".":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}}},"type":"module","scripts":{"build":"yarn build:shaders && yarn build:ts && yarn build:native","build:ts":"yarn build:cjs && yarn build:esm && yarn build:types","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","build:types":"tsc -p tsconfig.types.json","build:native":"napi build --target aarch64-apple-darwin --release","build:debug":"yarn build:shaders:debug && napi build --target aarch64-apple-darwin","build:shaders":"bash scripts/compile-shaders.sh release","build:shaders:debug":"bash scripts/compile-shaders.sh debug","build:shaders:watch":"FHE_SHADER_HOT_RELOAD=1 bash scripts/compile-shaders.sh debug","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:native":"node test-native.js","benchmark":"./run_benchmark","benchmark:comprehensive":"./run_comprehensive_benchmark","lint":"eslint src --ext .ts","format":"prettier --write \"src/**/*.ts\"","clean":"rm -rf dist index.node target/shaders && rm -f native/*.node 2>/dev/null || true","prepublishOnly":"yarn clean && yarn build","publish:public":"npm publish --access public"},"keywords":["apple-silicon","arm64","hardware-detection","modular-arithmetic","napi-rs","not-implemented","work-in-progress"],"author":{"name":"Digital Defiance"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Digital-Defiance/node-fhe-accelerate.git"},"bugs":{"url":"https://github.com/Digital-Defiance/node-fhe-accelerate/issues"},"homepage":"https://github.com/Digital-Defiance/node-fhe-accelerate#readme","engines":{"node":">=18.0.0"},"os":["darwin"],"cpu":["arm64"],"devDependencies":{"@napi-rs/cli":"^2.18.0","@types/node":"^20.10.0","@typescript-eslint/eslint-plugin":"^6.13.0","@typescript-eslint/parser":"^6.13.0","@vitest/coverage-v8":"^1.0.0","eslint":"^8.54.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","fast-check":"^3.15.0","prettier":"^3.1.0","typescript":"^5.3.0","vitest":"^1.0.0"},"packageManager":"yarn@4.0.0","_id":"@digitaldefiance/node-fhe-accelerate@0.1.4","gitHead":"eaac695b56f40f196885c85c0264d4f7a5648ac8","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-ldTk4K3TwaCRK8CIyWpSPWs+Pw8TbjD76l9PejPRlWkqiuI+u+rPDp1t7YE75foOjrZV0SdR/cFw/v17Pql9qA==","shasum":"42d1a5db0f7874caa8b8f935699d7b078b0d1b05","tarball":"https://registry.npmjs.org/@digitaldefiance/node-fhe-accelerate/-/node-fhe-accelerate-0.1.4.tgz","fileCount":131,"unpackedSize":936822,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCAGmfqJiGoYTzO/Cwiv3+mi/vbIz9Un4sPQFnZIZ46cgIhAIlIxXqMrY2kSATgKSftwm0Y1jIKs80CwfQZ9oPu7vn4"}]},"_npmUser":{"name":"jessica-mulein","email":"jessica@mulein.com"},"directories":{},"maintainers":[{"name":"jessica-mulein","email":"jessica@mulein.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-fhe-accelerate_0.1.4_1785784803762_0.9052738353565362"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-16T07:02:38.393Z","modified":"2026-08-03T19:20:04.107Z","0.1.0":"2026-01-16T07:02:39.014Z","0.1.2":"2026-08-03T16:48:14.850Z","0.1.3":"2026-08-03T19:13:58.145Z","0.1.4":"2026-08-03T19:20:03.896Z"},"bugs":{"url":"https://github.com/Digital-Defiance/node-fhe-accelerate/issues"},"author":{"name":"Digital Defiance"},"license":"MIT","homepage":"https://github.com/Digital-Defiance/node-fhe-accelerate#readme","keywords":["apple-silicon","arm64","hardware-detection","modular-arithmetic","napi-rs","not-implemented","work-in-progress"],"repository":{"type":"git","url":"git+https://github.com/Digital-Defiance/node-fhe-accelerate.git"},"description":"NOT YET IMPLEMENTED. Apple Silicon hardware detection and modular-arithmetic primitives. No FHE operations exist: createEngine() rejects. Do not use for encryption.","maintainers":[{"name":"jessica-mulein","email":"jessica@mulein.com"}],"readme":"# @digitaldefiance/node-fhe-accelerate\n\nHardware-accelerated NTT and modular arithmetic primitives for Apple Silicon. The foundation for an FHE library, not yet a complete one.\n\n## Status\n\n**What works today:**\n\n- `NttProcessor` — negacyclic Number Theoretic Transform over Z_q[X]/(X^N + 1). Cooley-Tukey with NEON butterflies when available. Verified with the convolution identity gate (not a round-trip — round-trips cannot catch the defect class this library was built to remove). 0.096ms at N=1024 on M4 Max.\n- `ModularArithmetic` — Montgomery multiplication, modular add/sub, to/from Montgomery form.\n- `detectHardware()` — reports SME, Metal, NEON availability on this machine.\n\n**What does not exist:**\n\n- Polynomial ring multiplication (the orchestration layer over NTT — see roadmap)\n- Key generation, encryption, decryption\n- Homomorphic operations (add, multiply, relinearize, bootstrap)\n- Noise sampling\n- Any complete FHE scheme (TFHE, BFV, CKKS)\n\n`createEngine()` rejects with \"Not yet implemented.\" The ZK proof entry points throw. Do not use this for encryption or for zero-knowledge proofs.\n\n## Install\n\n```sh\nnpm install @digitaldefiance/apple-silicon-caps\n```\n\nRequires macOS arm64 and Xcode Command Line Tools (for the native build).\n\n## Usage\n\n```js\nconst { NttProcessor, ModularArithmetic, detectHardware } = require('@digitaldefiance/node-fhe-accelerate');\n\n// Hardware detection\nconst hw = detectHardware();\nconsole.log(hw); // { hasSme: true, hasMetal: true, hasNeon: true, ... }\n\n// NTT: negacyclic polynomial multiplication\nconst N = 1024;\nconst q = 132120577; // NTT-friendly prime, q ≡ 1 (mod 2N)\nconst ntt = new NttProcessor(N, q);\n\nconst a = new Array(N).fill(0); a[0] = 1; a[1] = 2;\nconst b = new Array(N).fill(0); b[0] = 3; b[1] = 4;\n\nconst aNtt = ntt.forward(a);\nconst bNtt = ntt.forward(b);\n\n// Pointwise multiply in NTT domain (use ModularArithmetic or BigInt)\nconst mulmod = (x, y) => Number(BigInt(x) * BigInt(y) % BigInt(q));\nconst cNtt = aNtt.map((v, i) => mulmod(v, bNtt[i]));\n\nconst c = ntt.inverse(cNtt);\n// c = a * b in Z_q[X]/(X^N + 1)\n\n// Modular arithmetic\nconst ma = new ModularArithmetic(q);\nconsole.log(ma.montgomeryMul(ma.toMontgomery(7), ma.toMontgomery(9)));\n```\n\n## Roadmap\n\nWhat FHE needs, in dependency order. Checked items exist; unchecked items do not.\n\n- [x] **Modular arithmetic** — Montgomery multiplication, add, sub\n- [x] **NTT** — negacyclic Cooley-Tukey, forward and inverse, NEON path\n- [x] **Hardware detection** — SME, Metal, NEON, topology\n- [ ] **Polynomial ring** — multiply/add/sub over Z_q[X]/(X^N+1) via NTT. *Next step. The NTT does the heavy lifting; this is the forward/pointwise/inverse orchestration.*\n- [ ] **Noise sampling** — discrete Gaussian or centered binomial distribution\n- [ ] **Key generation** — LWE/GLWE secret keys, public keys\n- [ ] **Encryption / Decryption** — RLWE samples, rounding\n- [ ] **Homomorphic addition** — coefficient-wise add on ciphertexts\n- [ ] **Key switching** — gadget decomposition, external product\n- [ ] **Homomorphic multiplication** — tensor product + relinearization\n- [ ] **Bootstrapping** — blind rotation, sample extraction. *The research frontier of FHE.*\n\nEach layer builds on the ones above it. The polynomial ring is achievable in a session; bootstrapping is a research project.\n\n## Correctness methodology\n\nThis library uses the **negacyclic convolution identity** as its correctness gate, not round-trip tests. The reason: the Cooley-Tukey / Gentleman-Sande butterfly pair is 2·I for *any* nonzero twiddle, so a forward-then-inverse round-trip passes even with completely wrong twiddle tables. The convolution identity — sparse operands with X^(N-1) populated so the X^N = -1 sign flip is exercised — catches the defect because it requires the psi twist to be a genuine 2N-th root of unity.\n\nThis methodology is documented in detail in the companion paper at [fhe-evolve](https://github.com/Digital-Defiance/fhe-evolve), §6.6 \"Round-Trip Verification Is Insufficient.\"\n\n## History\n\nVersions 0.1.0 and 0.1.1 are deprecated. 0.1.0 could not be imported (extensionless ESM re-exports). Its ZK proof subsystem simulated verification by sleeping via setTimeout and returning `valid: true` for any proof input, including for ballot validity and voter eligibility. That code now throws.\n\n## Platform\n\nmacOS arm64 only. Requires Xcode Command Line Tools for the native build at install time.\n\n## License\n\nMIT. Copyright (c) 2025 Digital Defiance, Jessica Mulein.\n","readmeFilename":"README.md"}